Name

QueueSender

Synopsis

A QueueSender is a MessageProducer used to send messages in a point-to-point context. QueueSenders are created using the createQueue() method on QueueSession, specifying a default Queue as the target of messages. Clients can override the default message target by using one of the send() methods on the QueueSender that accepts a target Queue. If a send() method is called without a target Queue, and the QueueSender does not have a default target Queue defined (e.g., it was created with a null target Queue), then an InvalidDestinationException is thrown.

                  
public interface QueueSender extends MessageProducer {
// Public Instance Methods
   public abstract Queue getQueue() throws JMSException;  
   public abstract void send(
        javax.jms.Message message) throws JMSException;  
   public abstract void send(Queue queue, 
        javax.jms.Message message) throws JMSException;  
   public abstract void send(javax.jms.Message message, 
        int deliveryMode, int priority, 
        long timeToLive) throws JMSException;  
   public abstract void send(Queue queue, 
        javax.jms.Message message, int deliveryMode, 
        int priority, 
        long timeToLive) throws JMSException;  
}

Returned By

QueueSession.createSender()

Get Java Enterprise in a Nutshell, Second Edition 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.