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

Dynamic Versus Administered Subscribers

In the previous section, we created a durable subscriber named Borrower1:

TopicSubscriber subscriber = tSession.createDurableSubscriber(topic, "Borrower1");

Some JMS providers allow you to statically define the durable subscriber in the configuration file or admin interface. In this case, the durable subscriber is said to be an administered durable subscriber, meaning that the durable subscriber is statically defined and known by the JMS provider. However, suppose you needed to produce a temporary durable subscriber, say to gather mortgage rates for the next one or two days to do some trend analysis. It would be silly to have to modify the JMS provider configuration files for this simple request.

The JMS specification allows for durable subscribers to be defined dynamically at runtime, without having to statically define them in your JMS provider configuration files. These types of durable subscribers are known as dynamic durable subscribers. For example, if we were to define a new durable subscriber called BorrowerA, we could simply do the following:

TopicSubscriber subscriber = tSession.createDurableSubscriber(topic, "BorrowerA");

In this case, the BorrowerA durable subscriber is not defined in the JMS provider and, therefore, is not an administered durable subscriber. However, once the line of code listed above executes, a new durable subscriber called BorrowerA is created in the JMS provider and, therefore, will receive all rates published ...

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