What is the Subscription Key Configuring a Shared Subscription

Developing Advanced PubSub Applications 13-3

13.2 Advanced Messaging Features for High Availability

In order to understand how an application can achieve One-copy-per-instance and One-copy-per-application design patterns, you need to understand the following new and changed features: ■ Section 13.2.1, Shared Subscriptions and Client ID Policy ■ Section 13.2.2, How Sharing a Non-Durable Subscription Works ■ Section 13.2.3, How Sharing a Durable Subscription Works ■ Section D, Advanced Programming with Distributed Destinations Using the JMS Destination Availability Helper API

13.2.1 Shared Subscriptions and Client ID Policy

Prior to WebLogic Server 10.3.4.0, one subscription, durable or non-durable, could only be accessed by a single subscriber instance at any given time. Each subscriber receives all messages that are sent to a topic after the subscription is established and the messages for each subscription are processed sequentially by one consumer. In this WebLogic Server release, multiple subscribers can share one subscription durable or non-durable. Messages are distributed among multiple consumers that share the same subscription and can be processed in parallel. Subscription sharing only occurs on the same destination instance or the same member instance of a DT. See Configure Shared Subscriptions in Configuring and Managing JMS for Oracle WebLogic Server. In order to share a subscription, durable or non-durable subscriptions need to have the Client Id set on their connection factory or connection. Prior to WebLogic Server 10.3.4.0, a Client ID was exclusively used by one connection at any given time. In this release of WebLogic Server, this restriction is relaxed and a new Client ID Policy is used to restricted or not restricted use of a Client ID. The default policy, Restricted, allows only one Client ID to be used by one connection. The Unrestricted policy allows multiple connections to use the same client ID. For more information, see Section 13.2.3, How Sharing a Durable Subscription Works.

13.2.1.1 What is the Subscription Key

A subscription key is used to uniquely identify a subscription. For non-durable subscriptions, the key is composed of the Client ID and Client ID Policy. For durable subscriptions, the key is composed of the Client ID, Client ID Policy, and Subscription Name.

13.2.1.2 Configuring a Shared Subscription

To configure a shared subscription, you need to configure the Subscription Sharing Policy attribute on the connection factory. Setting the Subscription Sharing Policy to Sharable allows subscribers created using a connection factory to share their subscriptions with other subscribers, regardless of whether those subscribers are Note: Oracle recommends designing applications that utilize WebLogic Server MDBs. See Configuring and Deploying MDBs Using JMS Topics in Programming Message-Driven Beans for Oracle WebLogic Server for detailed information on how to design and implement applications that use message-driven beans to provide improved HA and scalability. 13-4 Programming JMS for Oracle WebLogic Server created using the same connection factory or a different connection factory. Consumers can share a non-durable subscriptions only if they have the same Client ID and Client ID Policy. Consumers can share a durable subscription only if they have the same Client ID, Client ID Policy, and Subscription Name. See: ■ Configure a connection factory subscription sharing policy in Oracle WebLogic Server Administration Console Help ■ ClientIdPolicy in Oracle WebLogic Server MBean Reference

13.2.2 How Sharing a Non-Durable Subscription Works