A MessageProducer object is created by a Session object and is used for sending messages to destinations. For example, using the mySession
object created in Session, the following creates a MessageProducer that sends messages to a queue named myQueue
:
Once you have created a MessageProducer, you can use it to send messages. See Chapter 4, Working With Messages for more information about creating messages. For example, the following sends a message using the queueSender
created above:
You can create MessageProducers that do not identify a destination. When the sender or publisher does not specify a destination, you must specify the destination when you send or publish a message as the first parameter of the send()
or publish()
method.
TIBCO Enterprise Message Service™ User’s Guide Software Release 4.3, February 2006 Copyright © TIBCO Software Inc. All rights reserved www.tibco.com |