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

Design Considerations

There are two main message filtering approaches to consider when designing message-based solutions. You can send all related messages (e.g., trade orders) to a single JMS destination and use message filtering on the message consumer to select specific messages or you can use multiple JMS destinations that contain prefiltered messages. The first approach we will call the Message Filtering approach, and the second we will call the Multiple Destination approach. Understanding the implications of each of these approaches will help you arrive at a proper design for your particular situation.

What we have been focusing on so far in this chapter has been the Message Filtering approach using message filters on the QueueReceiver or TopicSubscriber to receive only those messages we are interested in. With the Message Filtering approach, messages are sent to a single JMS destination and filtered by the message consumer, as shown in Figure 6-1.

Message Filtering approach

Figure 6-1. Message Filtering approach

Notice that with the Message Filtering approach it is the message consumer that has control over filtering and what messages it wants to receive. This approach provides for a higher level of decoupling between the message producer components and the message consumer components because less information needs to be known by the message producer about how the message will be processed. This is particularly ...

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