Point-to-Point API

This section covers the queue-based point-to-point interfaces and classes.

Queue

The Queue is an administered object that acts as a handle or identifier for an actual queue, called a physical queue , on the messaging server. A physical queue is a channel through which many clients can receive and send messages. The Queue is a subtype of the Destination interface.

Multiple receivers may connect to a queue, but each message in the queue may only be consumed by one of the queue’s receivers. Messages in the queue are ordered so that consumers receive messages in the order the message server placed them in the queue:

public interface Queue extends Destination {
    public String getQueueName() throws JMSException; 
    public String toString();
}

QueueBrowser

A QueueBrowser is a specialized object that allows you to peek ahead at pending messages on a Queue without actually consuming them. This feature is unique to point-to-point messaging. Queue browsing can be useful for monitoring the contents of a queue from an administration tool, or for browsing through multiple messages to locate a message that is more important than the one that is at the head of the queue:

public interface QueueBrowser {
    public Queue getQueue() throws JMSException;
    public String getMessageSelector() throws JMSException; 
    public Enumeration getEnumeration() throws JMSException; 
    public void close() throws JMSException;
}

QueueConnection

The QueueConnection is created by the QueueConnectionFactory. Each QueueConnection ...

Get Java Message Service, 2nd 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.