Partitioned queues

 

+

Search Tips   |   Advanced Search

 

A queue is partitioned automatically for you when a queue destination is assigned to a cluster bus member. Every messaging engine within the cluster owns a partition of that queue and is responsible for managing messages assigned to the partition. Every message sent to the queue is assigned to exactly one of the partitions.

When a JMS client attempting to access a partitioned queue is connected to a messaging engine hosting one of those partitions (a messaging engine in the cluster), then the client is able to access only that local partition of the queue for both consuming and producing messages.

The only instance where messages are not sent to the local partition is when that local partition is full and other partitions of the queue are not. In this case, messages are routed to an available remote partition.

Clients attempt to consume only from the local partition, even if there are no messages on the local partition and there are messages available on other partitions.

If the JMS client connects to a messaging engine not hosting a destination partition, a messaging engine in the same bus but not in the cluster, then each client-created consumer connects to one remote partition to consume messages. Each session created is workload managed with respect to which remote partition it connects for consuming messages.

Messages sent to a remote partitioned destination are workload-managed across the individual partitions on an individual message basis, regardless of the session.

Message producers and JMS clients connect directly to the cluster, rather, message producers connect to messaging engines that are not part of the cluster. This requires servers outside of the cluster to be available and added to the bus, and for the message producers to make their JMS connections to those messaging engines. Once a messaging engine outside of the cluster accepts a message, the engine becomes responsible for routing the message through the bus to a queue point for the destination. Workload management selects a particular queue point of the partitioned destination so messages are spread evenly across all partitions of the queue.

An EJB or servlet in a cluster produces messages. Because the calls to the EJB or servlet are workload-managed across the cluster, and assuming that messages are produced to a local queue partition, it follows that the messages produced will be workload managed across the partitions of the queue.

Message consumers must be configured to connect to each partition of a partitioned queue to consume messages. If any partitions do not have consumers, then the messages sent to that partition might never be consumed.

The simplest and recommended way of configuring consumers to every partition of a partitioned queue is by installing a message-driven bean on the cluster.

Next