Book Image

Java EE 7 Development with WildFly

Book Image

Java EE 7 Development with WildFly

Overview of this book

Table of Contents (21 chapters)
Java EE 7 Development with WildFly
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

A short introduction to JMS


JMS defines a vendor-neutral (but Java-specific) set of programming interfaces to interact with asynchronous messaging systems. Messaging enables distributed communication that is loosely coupled. The whole messaging interchange is a two-step process where a component sends a message to a destination that is in turn retrieved by the recipient with the mediation of the JMS server. In JMS, there are two types of destinations: topics and queues. These have different semantics, which are explained next.

In a point-to-point model, messages are sent from producers to consumers via queues. A given queue might have multiple receivers, but only one receiver would be able to consume each of the messages. Only the first receiver who requests the message will get it, while the others will not, as shown in the following image:

A message sent to a topic, on the other hand, might be received by multiple parties. Messages published on a specific topic are sent to all the message...