Remove WebSphere Application Server Version 7 and Version 8 durable subscriptions
When using the WebSphere® MQ messaging provider with WebSphere Application Server Version 7 and Version 8, durable subscriptions created by message-driven bean applications bound to activation specifications are not removed. Durable subscriptions can be removed using either the MQ Explorer or a WebSphere MQ command line utility.
About this task
Message-driven bean applications running inside of WebSphere Application Server Version 7 and Version 8 that use WebSphere MQ messaging provider normal mode to connect to WebSphere MQ and take out a durable subscription can be configured to use either listener ports or activation specifications.
If the message-driven bean application is bound to a listener port, then the WebSphere MQ messaging provider will create the durable subscription for the application the first time the application is started. The durable subscription will be removed when the message-driven bean application is uninstalled from an application server, and the application server restarted.
Message-driven bean applications that are bound to an activation specification work in a slightly different way. The durable subscription is created for the application the first time the application is started. However, the durable subscription is not removed when the application is uninstalled and the application server restarted.
This can lead to a number of durable subscriptions remaining on a WebSphere MQ Publish/Subscribe engine for applications that are no longer installed in a WebSphere Application Server system. These subscriptions are known as "orphan subscriptions", and can lead to issues on the queue manager when the Publish/Subscribe engine is running.
When a message is published on a topic, the WebSphere MQ Publish/Subscribe engine makes a copy of that message for each durable subscription that is registered on that topic, and put it on an internal queue. The applications using that durable subscription will then pick up and consume the message from this internal queue.
If the message-driven bean application that was using that durable subscription is no longer installed, the copies of the published messages for the application will continue to be made. However, these messages will never be processed, which means that there could be a large number of messages remaining on the internal queue that will never be removed.
Before you begin
Subscriptions that are registered with the WebSphere MQ Publish/Subscribe engine will have a Subscription Name associated with them.
JMS:<queue manager name>:<client identifier>:<subscription name>
Where:- <queue manager name>
- This is the name of the WebSphere MQ queue manager where the Publish/Subscribe engine is running.
- <client identifier>
- This is the value of the Client ID property of the activation specification to which the message-driven bean is bound.
- <subscription name>
- This is the value of the activation specification property Subscription name for the activation specification that the message-driven bean application has been configured to use.
- Client ID = testClientID
- Subscription name = durableSubscription1
- JMS:testQM:testClientID:durableSubscription1
- The first option is to use the MQ Explorer. When the MQ Explorer has been connected to a queue
manager that is being used for publish/subscribe work, the list of subscribers that are currently
registered with the publish/subscribe engine can be viewed by clicking on the
IBM WebSphere MQ -><queue manager name>-> Subscriptions
entry in the navigation pane. - The other way to view the subscriptions that have been registered with a publish/subscribe
engine is to use the WebSphere MQ command line utility
runmqsc and run the command display sub. To do this, bring up a command prompt, change to the
<WebSphere MQ>\bin directory, and enter the following command to start runmqsc:
runmqsc <queue manager name>
display sub(*) durable
- Generate the list of durable subscriptions that have been registered with the Publish/Subscribe engine.
- For each durable subscription:
- Look at the Subscription name for the durable subscriber, and note the <client identifier> and <subscription name> value.
- Look at the WebSphere Application Server systems that are connecting to this Publish/Subscribe engine. See if there are any activation specifications defined that have the Client ID property that matches the <client identifier> value and the Subscription name property that matches the <subscription name>.
- If no activation specifications are found that have the Client ID and Subscription name properties that match the <client identifier> and <subscription name> fields in the WebSphere MQ subscription name, then there are no activation specifications using this durable subscription. The durable subscription can be deleted.
- If there is an activation specification defined that matches the durable
subscription name, then the final check that needs to be made is to see if there is
a message-driven bean application using this activation specification. To do this:
- Make a note of the JNDI name for the activation specification that has taken out the durable subscription at which you are currently looking.
- Bring up the Configuration pane in the WebSphere Administrative Console for each message-driven bean application that has been installed.
- Click the Message Driven Bean listener bindings link in the Configuration pane.
- A table with information about the message-driven bean application is displayed. If the activation specification radio button is selected in the Bindings column, and the Target Resource JNDI name field contains the JNDI name for the activation specification that has taken out the durable subscription, then the subscription is still in use and cannot be deleted.
- If no message-driven bean applications can be found that are using the activation specification, then the durable subscription can be deleted.
Procedure
Once an "orphaned" durable subscription has been identified, it can be deleted using either the MQ Explorer or the WebSphere MQ command line utility runmqsc.
- Highlight the entry for the subscription
- Right click the entry, and select Delete... from the menu. A confirmation window will appear.
- Check the subscription name displayed in the confirmation window is correct, and click Yes.
- Open a command prompt session
- Navigate to the <WebSphere MQ>\bin directory
- Enter the following command to start runmqsc:
runmqsc <queue manager name>
- When the runmqsc utility has started, enter:
where <Subscription name> is the subscription name of the durable subscription, which takes the form:delete sub(<Subscription name>)
JMS:<queue manager name>:<client identifier>:<subscription name>