40.3. Methods

The QueueSender interface inherits the methods of the interface javax.jms.MessageProducer. The following methods are defined in the interface javax.jms.QueueSender.

getQueue

public Queue getQueue()

Gets the queue associated with this QueueSender.

RETURNS:

this sender's queue

THROWS:

JMSException if the JMS provider fails to get the queue for this QueueSender due to some internal error

send(Message)

public void send(Message message)

Sends a message to the queue. Uses the QueueSender's default delivery mode, priority, and time to live.

PARAMETERS:

message the message to send

THROWS:

JMSException if the JMS provider fails to send the message due to some internal error
MessageFormatException if an invalid message is specified
InvalidDestinationException ...

Get Java™ Message Service API Tutorial and Reference: Messaging for the J2EE™ Platform now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.