Introduction
You may want to your JMS triggers to consume messages from a destination in a load-balanced fashion. To load balance message consumption, you can use multiple consumers on one or more Integration Servers to retrieve and process messages concurrently.
Within Integration Server, the ability to receive messages from a destination in a load-balanced fashion is important in two situations:
Concurrent JMS triggers
When a concurrent JMS trigger receives messages from the JMS provider, it creates multiple consumers. Each consumer receives a message from the JMS provider, processes the message, and acknowledges the message to the JMS provider. Each consumer needs to consume a message from the same destination but not process any duplicate messages.
A cluster of
Integration Servers
The same JMS trigger, running on multiple Integration Servers, needs to consume messages from the same destination without processing any duplicate messages.
Note: | Load balancing is necessary for concurrent JMS triggers regardless of whether or not they are running in a cluster of Integration Servers. |
The Java Message Service standard does not supply semantics for consuming messages from a destination in a load-balanced fashion. However, it does state that a client can have multiple sessions in which each session is an independent consumer and producer of messages. Regarding the type of destination used by each messaging style, the Java Message Service standard makes the following provisions:
Queues (point-to-point messaging). While the Java Message Service standard does not supply the semantics for multiple consumers receiving messages concurrently, it does not prohibit a JMS provider from supporting it. Most JMS providers support load balancing of messages from a queue across multiple consumers. However, review your JMS provider’s documentation to determine how to consume messages from a queue concurrently. For information about using the
webMethods Broker to consume messages from a queue concurrently, see
Consuming JMS Messages Concurrently
from the webMethods
Broker
.
Topics (publish-subscribe messaging). The Java Message Service standard specifies that each subscriber to the same topic receives each message. The standard does not provide semantics regarding how to concurrently consume messages published to a topic in a load-balanced fashion. Some JMS providers work around this limitation by offering a proprietary extension to the JMS API. Review your JMS provider’s documentation to determine how to consume messages from a topic concurrently. For information about how to configure JMS triggers and the
webMethods Broker to consume messages from a topic in a load-balanced fashion, see
Consuming JMS Messages Concurrently
from the webMethods
Broker
.