users@jms-spec.java.net

[jms-spec users] [jsr343-experts] Re: (JMS_SPEC-40) Allow multiple consumers to be created on the same topic subscription

From: Nigel Deakin <nigel.deakin_at_oracle.com>
Date: Wed, 21 Nov 2012 17:11:10 +0000

On 14/11/2012 14:47, Nigel Deakin wrote:
>
> Please give your comments on these three issues
>
> 1. My proposal to keep the existing behaviour of createDurableSubscription and define completely new methods to create
> shared durable subscriptions.
>
> 2. My proposal that non-shared and shared durable subscriptions should use the same namespace. This would mean that if
> you called createDurableConsumer to create a non-shared durable subscription you couldn't subsequently call
> createSharedDurableConsumer with the same subscription name. (and vice versa).
>
> 3. The suggestion (not yet a proposal) to forbid the use of clientId with shared durable (and non-durable) subscriptions
> (and in consequence drop support for noLocal from both).

As promised I have now drafted the API docs and spec changes for (1) and (2).

These changes affect durable subscriptions. The following methods have been reverted to the JMS 1.1 behaviour:

Methods on Session:
   TopicSubscriber createDurableSubscriber(Topic topic, String name) (JMS 1.1)
   TopicSubscriber createDurableSubscriber(Topic topic, String name, String messageSelector, boolean noLocal) (JMS 1.1)
   MessageConsumer createDurableConsumer(Topic topic, String name) (JMS 2.0)
   MessageConsumer createDurableConsumer(Topic topic, String name, String messageSelector, boolean noLocal) (JMS 2.0)
Methods on JMSContext:
   JMSConsumer createDurableConsumer(Topic topic, String name)
   JMSConsumer createDurableConsumer(Topic topic, String name, String messageSelector, boolean noLocal)

These methods:
* Will only allow a single consumer on a durable subscription
* clientId MUST be set

Rather than reinstate the original API docs I have amended the existing API docs to describe the old behaviour rather
more completely than the original spec did. But they are intended to reinstate the same behaviour as in JMS 1.1, which
means that there are no issues of backwards compatibility.

I have also added the following new methods to support shared durable subscriptions:

Methods on Session:
   MessageConsumer createSharedDurableConsumer(Topic topic, String name)
   MessageConsumer createSharedDurableConsumer(Topic topic, String name, String messageSelector, boolean noLocal)
Methods on JMSContext:
   JMSConsumer createSharedDurableConsumer(Topic topic, String name)
   JMSConsumer createSharedDurableConsumer(Topic topic, String name, String messageSelector, boolean noLocal)

These methods:
* Will allow multiple consumers on a durable subscription
* clientId may or may not be set

You can see the updated API docs here:
http://jms-spec.java.net/2.0-SNAPSHOT/apidocs/index.html

I have also updated the spec to incorporate these changes. The spec doesn't say anything that isn't also in the javadoc.
But if you want to review the spec you can download it from the usual place:
http://java.net/projects/jms-spec/sources/repository/content/jms2.0/specification/word/JMS20.pdf

Comments (and reports of errors) remain welcome.

Nigel