Product SiteDocumentation Site

1.2. How MRG Messaging operates

MRG Messaging was designed to provide a way to build distributed applications in which programs exchange data by sending and receiving messages. A message can contain any kind of data. Middleware messaging systems allow a single application to be distributed over a network and throughout an organization without being restrained by differing operating systems, languages, or network protocols. Sending and receiving messages is simple, and MRG Messaging provides guaranteed delivery and extremely good performance.
In MRG Messaging a message producer is any program that sends messages. The program that receives the message is referred to as a message consumer. If a program both sends and receives messages it is both a message producer and a message consumer.
The message broker is the hub for message distribution. It receives messages from message producers and uses information stored in the message's headers to decide where to send it on to. The broker will normally attempt to send a message until it gets notification from a consumer that the message has been received.
Within the broker are exchanges and queues. Message producers send messages to exchanges, message consumers subscribe to queues and receive messages from them.
The message headers contain routing information. The routing key is a string of text that the exchange uses to determine which queues to deliver the message to. Message properties can also be defined for settings such as message durability.
A binding defines the relationship between an exchange and a message queue. A queue must be bound to an exchange in order to receive messages from it. When an exchange receives a message from a message producer, it examines its active bindings, and routes the message to the corresponding queue. Consumers read messages from the queues to which they are subscribed. Once a message is read, it is removed from the queue and discarded.
In the following diagram, a producer sends messages to an exchange. The exchange reads the active bindings and places the message in the appropriate queue. Consumers then retrieve messages from the queues.
A producer sends a message through the broker to a consumer