As described in JMS Message Models, a
Message Producer is an EMS client that either publishes messages to a topic or sends messages to a queue. When working with topics, a Message Producer is commonly referred to as a
Publisher. Optionally, when creating a Message Producer, you can set the destination to NULL and specify the destination when you send or publish a message, as described in
Sending Messages.
You must have send permission on a queue to create a message producer that sends messages to that queue. You must have
durable permission on the topic to create a new durable subscriber for that topic, and have at least
use_durable permission on the topic to attach to an existing durable subscriber for the topic. See
User Permissions for details.
See the tibjmsMsgProducer.java sample client for a working example.
See the tibemsMsgProducer.c sample client for a working example.
See the csMsgProducer.cs sample client for a working example.
For example, as described in the Message Delivery Modes, you can set the message deliver mode to either
PERSISTENT,
NON_PERSISTENT, or
RELIABLE_DELIVERY.
Use the MessageProducer object’s
setDeliveryMode() method to configure your Message Producer with a default delivery mode of
RELIABLE_DELIVERY:
See the tibjmsMsgProducerPerf.java sample client for a working example.
Use the tibemsMsgProducer_SetDeliveryMode function to configure your Message Producer to set a default delivery mode for each message it produces to
RELIABLE_DELIVERY:
See the csMsgProducerPerf.cs sample client for a working example.
A completion listener implementation has two methods: onCompletion() is invoked after a message has successfully been sent, and
onException() is invoked if the send failed. These methods are invoked in a different thread from that in which the message was sent. You implement the methods to perform the desired actions when the application is notified of send success or failure. Your implementation should handle all exceptions, and it should not throw any exceptions.
See the tibjmsMsgProducer.java sample client for a working example.
In C, Implement an onCompletion() function to perform the desired actions when a message is sent:
See the tibemsMsgProducer.c sample client for a working example.
Create an implementation of the ICompletionListener interface, create a
CompletionListener and pass that into the appropriate send method.
Create an implementation of the IMessageListener interface to perform actions when a message is sent:
See the csMsgProducer.cs sample client for a working example.