Hi Nigel,
Thanks for your clear and unambiguous answers. Yes, I do think it would
be worth spelling out in the spec that the multiple active consumers can
be on different Connections in both cases (shared non-durable, and
durable when clientID is unset). It would also be helpful to explicitly
make the point about the global nature of the names, along the lines of
your sentence "So the name of the shared non-durable subscription is
global to the JMS provider (just as the name of a durable subscription
is if clientid is unset)."
thanks,
Chris
On 6/28/2012 3:02 AM, Nigel Deakin wrote:
> Chris,
>
> Thank you for your helpful and very clearly-worded comments.
>
> On 27/06/2012 23:34, Chris Barrow wrote:
>> Hi,
>>
>> I have been reading the JMS 2.0 public draft specification and some
>> question about the scope of shared non-durable and durable subscriptions.
>
> Just to be clear: we haven't released the public draft yet (that's a
> formal stage in the JCP process, planned for Q3), the latest pdf is a
> working draft of that official draft.
>
>>
>> 1. Can a given durable subscription be used on more than one
>> Connection (assuming no clientID's are set)? If so, can this be at
>> the same time?
>> The spec states "A durable subscription may have more than one active
>> consumer (this was not permitted prior to JMS 2.0). Each message from
>> the subscription will be delivered to only one of the consumers on
>> that subscription." What I am asking is: do the active consumers have
>> to be created on the same Connection or can they be created on
>> different Connections?
>
> The multiple active consumers can be on the same or different
> Connections. That's why the draft spec simply referred to "more than
> one active consumer". Do you think we need to spell out that they can
> be on different Connections?
>
> As you observe, they can only be on different Connections if clientID
> is unset, because of the existing clientId uniqueness rule.
>
>> And (a weaker question): once the active consumer(s) created on one
>> Connection have been closed, is it then possible to subsequently to
>> create further consumers on another Connection for the same durable
>> subscription?
>
> Yes. I hope this follows as a natural consequence of the nature of
> durable subscriptions, allowing clientid to be unset, and allowing a
> durable subscription to have more than one active consumer.
>
>>
>> 2. Same questions for shared non-durable subscriptions. The spec says
>> "A non-durable shared subscription is used by a client which needs to
>> be able to share the work of receiving messages from a topic
>> subscription amongst multiple consumers.". So my question is whether
>> those consumers can be created on multiple Connections. This really
>> amounts to asking whether the name of the shared non-durable
>> subscription is *scoped to a Connection* or *global*.
>
> Again, the "multiple consumers" do not need to be on the same
> Connection. So the name of the shared non-durable subscription is
> global to the JMS provider (just as the name of a durable subscription
> is if clientid is unset).
>
>>
>> The answers to these questions (especially the last one) have quite
>> far-reaching implications for JMS provider implementations.
>
> Indeed!. Given my responses, do you think the spec/javadoc needs
> clarifying, or is what we have sufficient?
>
> Nigel
>
>>
>> Thanks,
>> Chris Barrow