B Topic Subscription Identifiers

Examine how the topic subscription identifiers are generated.

For MDBs using WebLogic Server's built-in JMS integration, subscription selection uses the following information, as applicable:

  1. The topic with which the subscription is associated

  2. The connection "Client ID" string that is specified for the connection that is used to access the subscription

  3. For a durable subscription, the subscription name. The MDB container uses the configured subscriptionName value, if provided; otherwise, it derives the name as shown in Table B-1. It supplies that name when creating the durable subscriber.

  4. The "Client ID Policy" option, by which a subscription is also identified in WebLogic JMS. If two WebLogic JMS subscription references on the same physical topic have the same client ID and subscription name, then the references resolve to:

    • A single subscription, if the client ID policies are also the same

    • Two different subscriptions, if the client ID policies are different

The MDB container uses the configured destination and determines the applicable client ID, durable subscription name, and Client ID Policy from the following settings:

  • ejb-name

  • jms-client-id

  • topicMessagesDistributionMode

  • subscriptionName configuration property

  • distributedDestinationConnection

  • generate-unique-jms-client-id

  • subscriptionDurability

  • Other elements of the MDB deployment and JMS configurations

Configure generate-unique-jms-client-id under message-driven-descriptor in weblogic-ejb-jar.xml, or use the generateUniqueID member of @weblogic.javaee.JMSClientID.

The generate-unique-jms-client-id setting affects client-ID generation only in Compatibility mode. The distributedDestinationConnection setting controls local distributed-topic member selection in the One-Copy modes and can also affect generated client IDs in Compatibility mode. The subscriptionDurability setting applies in all three modes.

Table B-1 shows the client-ID expressions generated from the MDB's configuration. For a durable MDB in Compatibility mode, the effective connection client ID is the ID already assigned by the connection factory, if present; otherwise, the container sets the generated client ID. Unless subscriptionName is configured, the durable subscription name is derived from the generated client-ID expression in the corresponding row, even when the connection uses a different preconfigured client ID. For the One-Copy modes, leave the connection factory's client ID unset and configure the client-ID base on the MDB; the container must set the connection's client ID itself.

Table B-1 summarizes how the settings are used to generate subscription IDs:

Table B-1 How Subscription IDs are Generated

Setting Generated Client ID Subscription Name for the Durable Subscription Case Client ID Policy for WebLogic Topics

topicMessagesDistributionMode = One-Copy-Per-Application

jmsClientIDBase

subscriptionName property, if used, or ejb-name

Unrestricted

topicMessagesDistributionMode = One-Copy-Per-Server

jmsClientIDBase

+ "_"

+ currentDomainName

+ "_"

+ currentServerName

subscriptionName property, if used, or ejb-name

Unrestricted

topicMessagesDistributionMode = Compatibility

generate-unique-jms-client-id = true

distributedDestinationConnection = LocalOnly

subscriptionDurability = Durable Foot 1

jmsClientIDBase

+ "_"

+ currentDomainName

+ "_"

+ uniqueKey

subscriptionName, if configured; otherwise, the generated client ID shown in this row.

Connection factory's Client ID Policy; Restricted by default.

Same as previous row, except:

distributedDestinationConnection = EveryMember

jmsClientIDBase

+ "_"

+ currentDomainName

+ "_"

+ uniqueKey

+ "_"

+ DDMemberName

subscriptionName, if configured; otherwise, the generated client ID shown in this row.

Connection factory's Client ID Policy; Restricted by default.

topicMessagesDistributionMode = Compatibility

generate-unique-jms-client-id = false

subscriptionDurability = Durable Foot 1

jmsClientIDBase

subscriptionName, if configured; otherwise, the generated client ID shown in this row.

Connection factory's Client ID Policy; Restricted by default.

Foot 1. For non-durable MDBs in Compatibility mode, the container does not assign a client ID or a durable subscription name. A client ID already supplied by the connection factory remains in effect. For WebLogic JMS, the connection factory's Client ID Policy applies and defaults to Restricted.

Key:
  • jms-client-id — Optional MDB client-ID configuration in weblogic-ejb-jar.xml. The MDB client-ID base can also be configured using an activation property or annotation; see Deployment Elements and Annotations for MDBs. A client ID configured on the JMS connection factory is a separate connection setting.

  • subscriptionName — an optional setting to establish the durable subscription name. If specified, this setting takes precedence over any automatically generated name.

  • ejb-name = the name of the EJB

  • jmsClientIDBase — The client-ID base obtained from the MDB's configuration, or ejb-name if no MDB client ID is configured. A client ID configured on the JMS connection factory does not supply this base.

  • currentDomainName — the name of the WebLogic domain that runs the MDB

  • currentServerName — the name of the Oracle WebLogic Server that the MDB is running on

  • uniqueKey — A generated value combining MDB deployment information with either currentServerName or the name of the migratable target associated with that MDB connection.

  • DDMemberName — the name of a distributed destination member; or, alternatively, the destination name if the topic is a singleton or a distributed destination in releases of Oracle WebLogic Server prior to 10.3.4.

Client ID uniqueness is enforced as follows:

  • For foreign (non-WebLogic) JMS vendors: Some JMS vendors prevent more than one connection from specifying the same connection Client ID. (An exception is thrown on an attempt to create the second connection.) This limitation in turn can prevent more than one free pool from using the same Client ID, because each free pool creates a single JMS connection with potentially the same Client ID as other free pool connections. After a first free pool instance of the MDB starts on a server instance in the cluster, an additional instance of the EJB can deploy successfully on another clustered server; but when the MDB attempts to create a JMS connection, a Client ID conflict is detected and that instance of the MDB fails to fully connect to JMS.

  • For WebLogic JMS: For WebLogic JMS in releases of Oracle WebLogic Server prior to 10.3.4, JMS connections were restricted so only one connection with the same Client ID could exist in the scope of a cluster. However, for Oracle WebLogic Server 10.3.4 and later, WebLogic JMS connection factories or connections can optionally set a Client ID Policy to control this restriction. With a Client ID Policy of RESTRICTED, the pre-10.3.4 behavior remains in effect, while with a Client ID Policy of UNRESTRICTED, this limitation is lifted. See Developing JMS Applications for Oracle WebLogic Server. Unrestricted client IDs make it possible for multiple WebLogic subscriber connections and subscriptions to share the same client ID. Both One-Copy-Per-Server and One-Copy-Per-Application Topic Message Distribution Modes set the ClientIDPolicy to Unrestricted. Note that if two WebLogic JMS subscription references on the same physical topic have the same Client ID and durable subscription name, then the references resolve to a single subscription if the Client ID Policy is also the same, but they resolve to two different subscriptions if the Client ID Policies are different.