Skip to content
Lyes Sefiane edited this page Jul 1, 2021 · 38 revisions

Welcome to the publisher-subscriber-microservices wiki!

What Is Java Message Service ?

The Java Message Service (JMS) was designed to make it easy to develop business applications that asynchronously send and receive business data and events. JMS defines a set of interfaces and semantics that allow Java applications to communicate with other messaging implementations. A JMS implementation is known as a JMS provider, such as : Apache ActiveMQ. [1]

Message Delivery Models

JMS supports two different message delivery models:

Point-to-Point (Queue destination)

"In this model, a message is delivered from a producer to one consumer. The messages are delivered to the destination, which is a queue, and then delivered to one of the consumers registered for the queue. While any number of producers can send messages to the queue, each message is guaranteed to be delivered, and consumed by one consumer. If no consumers are registered to consume the messages, the queue holds them until a consumer registers to consume them." [1]

Publish/Subscribe (Topic destination)

"In this model, a message is delivered from a producer to any number of consumers. Messages are delivered to the topic destination, and then to all active consumers who have subscribed to the topic. In addition, any number of producers can send messages to a topic destination, and each message can be delivered to any number of subscribers. If there are no consumers registered, the topic destination doesn't hold messages unless it has durable subscription for inactive consumers. A durable subscription represents a consumer registered with the topic destination that can be inactive at the time the messages are sent to the topic." [1]

Clone this wiki locally