Chapter 3. Messaging Concepts

HornetQ is an asynchronous messaging system; an example of Message Oriented Middleware, which will be referred to as messaging systems.

3.1. Messaging Concepts

Messaging systems are designed to loosely couple heterogeneous systems together, while maintaining reliability, transactions, and many other features.
Unlike systems based on a Remote Procedure Call (RPC) pattern, messaging systems primarily use an asynchronous message passing pattern with no tight relationship between requests and responses. Most messaging systems also support a request-response mode, however this is not a primary feature of messaging systems.
Designing systems to be asynchronous from end-to-end provides improvements to hardware resource usage, minimizes the number of threads blocking IO operations, and uses network bandwidth to its full capacity.
With an RPC approach you have to wait for a response for each request you make so are limited by the network round trip time, or latency of your network. With an asynchronous system you can pipeline flows of messages in different directions, so are limited by the network bandwidth not the latency. This typically allows you to create much higher performance applications.
Messaging systems decouple the senders of messages from the consumers of messages. Message senders and consumers are completely independent, which allows flexible, loosely coupled systems to be created.
Large enterprises often use a messaging system to implement a message bus which loosely couples heterogeneous systems together. Message buses often form the core of an Enterprise Service Bus (ESB). Using a message bus to decouple disparate systems can allow the system to grow and adapt more easily, or retire obsolete systems.