Example usage for javax.jms MessageProducer setDisableMessageID

List of usage examples for javax.jms MessageProducer setDisableMessageID

Introduction

In this page you can find the example usage for javax.jms MessageProducer setDisableMessageID.

Prototype

void setDisableMessageID(boolean value) throws JMSException;

Source Link

Document

Specify whether message IDs may be disabled.

Usage

From source file:com.ccc.ccm.client.JMSTemplateAutowired.java

/**
* Create a JMS MessageProducer for the given Session and Destination,
* configuring it to disable message ids and/or timestamps (if necessary).
* <p>Delegates to {@link #doCreateProducer} for creation of the raw
* JMS MessageProducer, which needs to be specific to JMS 1.1 or 1.0.2.
* @param session the JMS Session to create a MessageProducer for
* @param destination the JMS Destination to create a MessageProducer for
* @return the new JMS MessageProducer/*from  ww w .j a  va  2  s .co m*/
* @throws JMSException if thrown by JMS API methods
* @see #setMessageIdEnabled
* @see #setMessageTimestampEnabled
*/
protected MessageProducer createProducer(Session session, Destination destination) throws JMSException {
    MessageProducer producer = doCreateProducer(session, destination);
    if (!isMessageIdEnabled()) {
        producer.setDisableMessageID(true);
    }
    if (!isMessageTimestampEnabled()) {
        producer.setDisableMessageTimestamp(true);
    }
    return producer;
}