WebSphere MQ class: MQTopicPublisher
java.lang.Object | +----com.ibm.mq.jms.MQMessageProducer | +----com.ibm.mq.jms.MQTopicPublisher |
A client uses a TopicPublisher for publishing messages on a topic. TopicPublisher is the Pub/Sub variant of a JMS message producer.
public void close() throws JMSException
Because a provider may allocate some resources outside of the JVM on behalf of a TopicPublisher, 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 Topic getTopic() throws JMSException
Get the topic associated with this publisher.
public void publish(Message message) throws JMSException
Publish a Message to the topic Use the topic's default delivery mode, time to live, and priority.
public void publish(Message message, int deliveryMode, int priority, long timeToLive) throws JMSException
Publish a Message to the topic specifying delivery mode, priority, and time to live to the topic.
WebSphere MQ Event Broker note |
---|
If deliveryMode is PERSISTENT or timeToLive is greater than 0, this method throws a JMSException when you have a direct connection to WebSphere MQ Event Broker. |
public void publish(Topic topic, Message message) throws JMSException
Publish a Message to a topic for an unidentified message producer. Use the topic's default delivery mode, time to live, and priority.
public void publish(Topic topic, Message message, int deliveryMode, int priority, long timeToLive) throws JMSException
Publish a Message to a topic for an unidentified message producer, specifying delivery mode, priority, and time to live.
WebSphere MQ Event Broker note |
---|
If deliveryMode is PERSISTENT or timeToLive is greater than 0, this method throws a JMSException when you have a direct connection to WebSphere MQ Event Broker. |