Chapter 5: PublishSubscribe Messaging

Overview

Publish/Subscribe (Pub/Sub) messaging in JMS is based on the concept of topics. The destination in the Pub/Sub domain model is the topic and message producers publish messages to a specified topic. Message consumers subscribe for messages from the topic and receive the messages from the topic when they become available.

Every topic can have multiple publishers (message producers) or subscribers (message consumers) and every message published is received by all the subscribers. Therefore, unlike the Point-to-Point (PTP) messaging model, multiple subscribers will receive the same message that was published to that topic.

These messages can either be persistent or non-persistent. If they are non-persistent, they are not stored in a persistent storage (like a database). This means, they may be lost if the messaging server were to crash. However, persistent messages are not even considered sent before they are stored in the persistent store. The JMS specification dictates that the messaging system guarantees to deliver a persistent message at least once.

What we'll learn in this chapter:

  • We'll start off with a discussion on topics, including a look at Quality of Service in JMS applications.

  • Then we'll move on to see how to set up our software environment to start coding Pub/Sub applications.

  • After configuring our JMS server, we'll move on to developing a retail stock brokerage application, which provides ample opportunities for us to explore Pub/Sub messaging and transactions.

  • While we develop our stock brokerage example, we will also learn about the key JMS Pub/Sub features.



Professional JMS
Professional JMS
ISBN: 1861004931
EAN: 2147483647
Year: 2000
Pages: 154

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net