Issue Details (XML | Word | Printable)

Key: MQ-269
Type: New Feature New Feature
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: David Zhao
Reporter: Nigel Deakin
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
mq

Extend JMSRA to support unset clientId when subscriptionScope not set

Created: 10/Jan/13 12:28 PM   Updated: 12/Apr/13 06:11 PM   Resolved: 19/Feb/13 01:23 AM
Component/s: mq-ra
Affects Version/s: 5.0-RI (Sprint 8 - 26)
Fix Version/s: 5.0-RI (Sprint 10 - 28)

Time Tracking:
Not Specified

Issue Links:
Dependency
 

Tags: jms-2-implementation
Participants: David Zhao, Nigel Deakin and saradak


 Description  « Hide

The MQ 3.1.2 admin guide currently states here that "If the subscription is being created by the resource adapter for use by a message-driven bean (MDB), and client id is not set, then the resource adapter will set the client id to the name of the MDB."

This is indeed the case if the subscription is non-durable (though the clientId is actually set to the name of the MDB combined with any cluster name).

However if the subscription is durable then if clientId is unset (and the new subscriptionScope is also unset) then an exception is thrown during deployment (the code that does this is EndpointConsumer.setIsDurable)).

The product documentation is probably incorrect. However JMS 2.0 section 12.1 states "Setting this property [ clientId ] is always optional. If subscriptionScope is set (to instance or cluster) then this property must not be set."

This means that JMSRA needs to be changed to allow clientId to be unset in the case where subscriptionScope is unset and subscriptionDurability is Durable.

The simplest way to achieve this is to extend the existing code that generates clientId in the non-durable case to cover the durable case as well. This code is in EndpointConsumer._init. If the application server is not clustered then {{clientId} should be set to the name of the MDB (as passed in from GlassFish via a private API). If the application server is clustered then {{clientId} should be set to the name of the MDB combined with the "group name" which identifies the cluster.

Another way to achieve this is to use a shared durable subscription. That's a possibility (perhaps for the future), but I think it is safer and more consistent to make this consistent with non-durable subscriptions.

In addition, a check should be made to enforce the JMS 2.0 rule that clientId} must not be set if {{subscriptionScope is set.



David Zhao added a comment - 19/Feb/13 01:23 AM

Fixed.


saradak added a comment - 12/Apr/13 06:11 PM


Tests were added to the appserver sqe workspace to verify this bug.