The Message Queue JMS Resource Adapter provides a special feature called shared subscriptions for containers that support clustering, such as Sun Java System GlassFish Enterprise Server. This feature enables clustered containers to share the load of processing messages for topic subscriptions across the instances of a cluster.
When this feature is enabled, the following behaviors apply:
A client id must be set when creating any subscription, even a nondurable subscription (which does not normally require a client id). Attempting to create a subscription without a client id throws an exception.
Attempts by multiple connections to use the same client id do not result in an exception, provided that the connections are from different instances in the cluster.
Two or more subscriptions on the same topic with the same client id and the same durable subscription name (if the subscription is durable) are considered “shared”; that is, they are treated as a single subscription, with each message being sent to only one of the participating subscriptions.
By default, the shared subscriptions feature is enabled. In some applications that use nondurable subscriptions, however, the shared behavior is not desired. In such cases, the useSharedSubscriptionInClusteredContainer property can be set to false to disable the feature.