Subinterfaces: QueueSender and TopicPublisher
WebSphere MQ class: MQMessageProducer
java.lang.Object | +----com.ibm.mq.jms.MQMessageProducer |
A client uses a message producer to send messages to a Destination.
public MQMessageProducer()
public void close() throws JMSException
Because a provider may allocate some resources outside of the JVM on behalf of a MessageProducer, clients should close them when they are not needed. You cannot rely on garbage collection to reclaim these resources eventually, because this may not occur soon enough.
public int getDeliveryMode() throws JMSException
Get the producer's default delivery mode.
public boolean getDisableMessageID() throws JMSException
Get an indication of whether message IDs are disabled.
public boolean getDisableMessageTimestamp() throws JMSException
Get an indication of whether message timestamps are disabled.
public int getPriority() throws JMSException
Get the producer's default priority.
public long getTimeToLive() throws JMSException
Get the default length of time in milliseconds from its dispatch time that a produced message should be retained by the message system.
public void setDeliveryMode(int deliveryMode) throws JMSException
Set the producer's default delivery mode.
Delivery mode is set to DeliveryMode.PERSISTENT by default.
public void setDisableMessageID(boolean value) throws JMSException
Set whether message IDs are disabled.
Message IDs are enabled by default.
public void setDisableMessageTimestamp(boolean value) throws JMSException
Set whether message timestamps are disabled.
Message timestamps are enabled by default.
public void setPriority(int priority) throws JMSException
Set the producer's default priority.
Priority is set to 4, by default.
public void setTimeToLive(long timeToLive) throws JMSException
Set the default length of time, in milliseconds from its dispatch time, that a produced message should be retained by the message system.
Time to live is set to zero by default.
WebSphere MQ Event Broker note |
---|
This method throws a JMSException if set to other than 0 when you make a direct connection to WebSphere MQ Event Broker. |