Class DirectExchange

  • All Implemented Interfaces:
    Externalizable, Serializable, IExchangeMBean

    public class DirectExchange
    extends IExchange
    The direct exchange type provides routing of messages to zero or more queues based on an exact match between the routing key of the message, and the binding key used to bind the queue to the exchange. This can be used to construct the classic point-to-point queue based messaging model, however, as with any of the defined exchange types, a message may end up in multiple queues when multiple binding keys match the message's routing key.
    The direct exchange type works as follows:
    • 1. A message queue is bound to the exchange using a binding key, K.
    • 2. A publisher sends the exchange a message with the routing key R.
    • 3. The message is passed to all message queues bound to the exchange with key K where K = R.
    See Also:
    Serialized Form