Configure the consumer queue
We cannot configure a consumer queue if the transport type is direct.
In the publish/subscribe messaging domain, we can configure message consumers in two ways:
- The multiple queue approach.
Each consumer has its own exclusive queue and retrieves all its messages from this queue. JMS creates a new queue for each consumer.
- The shared queue approach.
Each consumer retrieves its messages from a queue that is shared with other consumers. This approach requires only one queue to serve multiple consumers. It is the default approach used with WebSphere MQ JMS.
We can choose which approach to use, and configure which queues to use.
In general, there is a modest performance advantage if you use the shared queue approach. For systems with a high throughput, there are also large system management and administrative advantages because of the significant reduction in the number of queues required.
In some situations, however, there are good reasons for using the multiple queue approach:
- In theory, we can store more messages.
There is an upper limit to the number of messages that a WebSphere MQ queue can hold and so, in the shared queue approach, the total number of messages for all the message consumers that share the queue cannot exceed this limit. This issue is more significant for durable topic subscribers, because the lifetime of a durable topic subscriber is usually much longer than that of a nondurable message consumer. Therefore, more messages might accumulate for a durable subscriber.
- The WebSphere MQ administration of consumer queues is easier.
For certain applications, an administrator might want to monitor the state and depth of particular consumer queues. This task is much simpler when each consumer has its own queue.
uj25140_