All Known Implementing Classes:
QueueSender, TopicPublisher
MessageProducer object to send messages to a
destination. A MessageProducer object is created by passing a
Destination object to a message-producer creation method
supplied by a session.
MessageProducer is the parent interface for all message
producers.
A client also has the option of creating a message producer without
supplying a destination. In this case, a destination must be provided with
every send operation. A typical use for this kind of message producer is
to send replies to requests using the request's JMSReplyTo
destination.
A client can specify a default delivery mode, priority, and time to live for messages sent by a message producer. It can also specify the delivery mode, priority, and time to live for an individual message.
A client can specify a time-to-live value in milliseconds for each message it sends. This value defines a message expiration time that is the sum of the message's time-to-live and the GMT when it is sent (for transacted sends, this is the time the client sends the message, not the time the transaction is committed).
A JMS provider should do its best to expire messages accurately; however, the JMS API does not define the accuracy provided.
| Method from javax.jms.MessageProducer Summary: |
|---|
| close, getDeliveryMode, getDestination, getDisableMessageID, getDisableMessageTimestamp, getPriority, getTimeToLive, send, send, send, send, setDeliveryMode, setDisableMessageID, setDisableMessageTimestamp, setPriority, setTimeToLive |
| Method from javax.jms.MessageProducer Detail: |
|---|
Since a provider may allocate some resources on behalf of a
|
|
MessageProducer. |
|
|
|
|
MessageProducer's
default delivery mode, priority, and time to live. |
MessageProducer's default delivery mode, priority,
and time to live.
Typically, a message producer is assigned a destination at creation time; however, the JMS API also supports unidentified message producers, which require that the destination be supplied every time a message is sent. |
|
Typically, a message producer is assigned a destination at creation time; however, the JMS API also supports unidentified message producers, which require that the destination be supplied every time a message is sent. |
Delivery mode is set to |
Since message IDs take some effort to create and increase a
message's size, some JMS providers may be able to optimize message
overhead if they are given a hint that the message ID is not used by
an application. By calling the Message IDs are enabled by default. |
Since timestamps take some effort to create and increase a
message's size, some JMS providers may be able to optimize message
overhead if they are given a hint that the timestamp is not used by an
application. By calling the Message timestamps are enabled by default. |
The JMS API defines ten levels of priority value, with 0 as the lowest priority and 9 as the highest. Clients should consider priorities 0-4 as gradations of normal priority and priorities 5-9 as gradations of expedited priority. Priority is set to 4 by default. |
Time to live is set to zero by default. |