Defining the Persistent Store Setting the Client ID Policy

Managing Your Applications 6-17 For non-durable subscriptions, WebLogic JMS delivers messages only to applications with an active session. Messages sent to a topic while an application is not listening are never delivered to that application. In other words, non-durable subscriptions last only as long as their subscriber objects. By default, subscribers are non-durable. The following sections describe: ■ Section 6.7.1, Defining the Persistent Store ■ Section 6.7.2, Setting the Client ID Policy ■ Section 6.7.3, Defining the Client ID ■ Section 6.7.4, Creating a Sharable Subscription Policy ■ Section 6.7.5, Creating Subscribers for a Durable Subscription ■ Section 6.7.6, Best Practice: Always Close Failed JMS ClientIDs ■ Section 6.7.7, Deleting Durable Subscriptions ■ Section 6.7.8, Modifying Durable Subscriptions ■ Section 6.7.9, Managing Durable Subscriptions

6.7.1 Defining the Persistent Store

You must configure a persistent file or database store and assign it to your JMS server so WebLogic JMS can store a message until it has been delivered to the subscribers or has expired. ■ Create a JMS file store or JMS JDBC backing store using the Stores node. ■ Target the configured store to your JMS server by selecting it from the Store fields drop-down list on the JMS Server Configuration General tab.

6.7.2 Setting the Client ID Policy

The Client ID Policy specifies whether more than one JMS connection can use the same Client ID in a cluster. Valid values for this policy are: ■ RESTRICTED: The default. Only one connection that uses this policy can exist in a cluster at any given time for a particular Client ID if a connection already exists with a given Client ID, attempts to create new connections using this policy with the same Client ID fail with an exception. ■ UNRESTRICTED: Connections created using this policy can specify any Client ID, even when other restricted or unrestricted connections already use the same Client ID. When a durable subscription is created using an Unrestricted Client ID, it can only be cleaned up using weblogic.jms.extensions.WLSession.unsubscribeTopic topic, Note: Durable subscriptions cannot be created for distributed topics. However, you can still create a durable subscription on distributed topic member and the other topic members will forward the messages to the member that has the durable subscription. For more information on using distributed topics, see Chapter 9, Using Distributed Destinations. Note: No two JMS servers can use the same backing store. 6-18 Programming JMS for Oracle WebLogic Server String name. See Managing Durable Subscriptions in Programming JMS for Oracle WebLogic Server. Oracle recommends setting the Client ID policy to Unrestricted for new applications unless your application architecture requires exclusive Client IDs, especially if sharing a subscription durable or non-durable. Subscriptions created with different Client ID policies are always treated as independent subscriptions. See ClientIdPolicy in the Oracle WebLogic Server MBean Reference. To set the Client ID Policy on the connection factory using the WebLogic Console, see Configure multiple connections using the same client Id in the Oracle WebLogic Server Administration Console Help. The connection factory setting can be overridden programatically using the the setClientIDPolicy method of the WLConnection interface in the Oracle WebLogic Server API Reference. For more information on advanced concepts and functionality of Uniform Distributed Topics UDTs necessary to design high availability applications, see Section 13.2.1, Shared Subscriptions and Client ID Policy.

6.7.3 Defining the Client ID