Skip to Main Content
Java Message Service, 2nd Edition
book

Java Message Service, 2nd Edition

by Mark Richards, Richard Monson-Haefel, David A Chappell
May 2009
Intermediate to advanced content levelIntermediate to advanced
330 pages
10h 34m
English
O'Reilly Media, Inc.
Content preview from Java Message Service, 2nd Edition

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 ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Reactive Systems in Java

Reactive Systems in Java

Clement Escoffier, Ken Finnigan
Java 8 in Action

Java 8 in Action

Mario Fusco, Alan Mycroft, Raoul-Gabriel Urma
The Well-Grounded Java Developer, Second Edition

The Well-Grounded Java Developer, Second Edition

Benjamin Evans, Martijn Verburg, Jason Clark

Publisher Resources

ISBN: 9780596802264Supplemental ContentErrata Page