High Quality JMS & AMQP Messaging.

Message Distribution

Message Dispatch

The Queue Manager Swiftlet sends and receives status messages about clustered queues and their consumers via topic "swiftmq.cluster", hence, it knows about consumers of a particular clustered queue and where they are located, means to which physical queue on which router they are attached.

When a message is sent to a clustered queue, it decides on base of its internal dispatch policy which linked physical queue the message will finally receive. The dispatch policy is round-robin over those queues with consumers. If there is no consumer at all, messages are dispatched evenly over all linked physical queues.

For example, assume there is a clustered queue "cqueue" with linked physical queues "c1" and "c2" on router1 and "c1", "c2", "c3" on router2. If there is a consumer on "c2@router1" and "c1@router2" and a producer sends 100 messages, "c2@router1" will get 50 and "c1@router2" will get 50. If there is no consumer at all and 100 messages are produced, all 5 linked physical queues will get 20 messages.

Message Order

Because messages are distributed to multiple consumers on demand, message order is not respected, except there is only 1 consumer at a time for a particular clustered queue. In that case, message order is always the order in which the messages were produced.

Message Redispatch

Messages of linked physical queues without consumers are automatically redispatched to linked physical queues with consumers. This ensures that all messages of a clustered queue are consumed, no matter where the consumers are located.