Professional JMS

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:

Категории