-
1. Re: Problem: Multiple Durable Subscriptions on One Client ID
joelvogt Oct 10, 2002 8:56 PM (in response to temafm)I don't think you will be able to use the same client id. After all, the jms server only checks that the messages were delivered to that id, if they are delivered once, then they will not be sent again.
-
2. Re: Problem: Multiple Durable Subscriptions on One Client ID
temafm Oct 11, 2002 2:13 PM (in response to temafm)That means, we can only have one subscription (without message selector) per client id?
I again ran my test program with two subscriptions (lets say SUB1 & SUB2), this time WITH message selector, per client id. I published three events. I received the messages that matched my second (SUB2) subscription but did not receive any message for first (SUB1) subscription.
Then, I swap the creation of subscriptions. That is, I subscribed SUB2 first and then subscribed SUB1 using the same client id. I published same three events. This time I received messages that matched my fist (SUB1) subscription.
It seems to me, we can only subscribe one subscription per client id but the JMS specs says that we can subscribe multiple subscriptions per client id.
Any thoughts.
Thank you. -
3. Re: Problem: Multiple Durable Subscriptions on One Client ID
temafm Oct 11, 2002 2:22 PM (in response to temafm)That means, we can only have one subscription (without message selector) per client id?
I again ran my test program with two subscriptions (lets say SUB1 & SUB2), this time WITH message selector, per client id. I published three events. I received the messages that matched my second (SUB2) subscription but did not receive any message for first (SUB1) subscription.
Then, I swap the creation of subscriptions. That is, I subscribed SUB2 first and then subscribed SUB1 using the same client id. I published same three events. This time I received messages that matched my fist (SUB1) subscription.
It seems to me, we can only subscribe one subscription per client id but the JMS specs says that we can subscribe multiple subscriptions per client id.
Any thoughts.
Thank you. -
4. Re: Problem: Multiple Durable Subscriptions on One Client ID
joelvogt Oct 16, 2002 2:55 AM (in response to temafm)it is my understanding that the opposite is true. That is, one connection per client id. The client id is what is used to determine if a message has been received or not. If you try to reuse it, then how would it know who has got the message yet?
<spec snip>
TopicSubscriber. A durable TopicSubscriber can be created by a Session or by a
TopicSession. JMS retains a record of this durable subscription and insures that
all messages from the Topic’s publishers are retained until either they are
acknowledged by this durable subscriber or they have expired.
Sessions with durable subscribers must always provide the same client
identifier. In addition, each client must specify a name that uniquely identifies
(within client identifier) each durable subscription it creates. Only one session
at a time can have a TopicSubscriber for a particular durable subscription. See
Section 4.3.2, “Client Identifier,” for more information.
A client can change an existing durable subscription by creating a durable
TopicSubscriber with the same name and a new topic and/or message selector,
or NoLocal attribute. Changing a durable subscription is equivalent to deleting
and recreating it.
Sessions and TopicSessions provide the unsubscribe -
5. Re: Problem: Multiple Durable Subscriptions on One Client ID
bernd.koecke Oct 18, 2002 7:52 AM (in response to temafm)Hi,
> it is my understanding that the opposite is true.
> That is, one connection per client id. The client id
> is what is used to determine if a message has been
> received or not. If you try to reuse it, then how
> would it know who has got the message yet?
>
I think that's not ok. Your spec snip says it, see below. But I think also that some interesting things aren't clear in the spec :)
> <spec snip>
>
> TopicSubscriber. A durable TopicSubscriber can be
> created by a Session or by a
> TopicSession. JMS retains a record of this durable
> subscription and insures that
> all messages from the Topic?s publishers are retained
> until either they are
> acknowledged by this durable subscriber or they have
> expired.
> Sessions with durable subscribers must always provide
> the same client
> identifier. In addition, each client must specify a
> name that uniquely identifies
> (within client identifier) each durable subscription
> it creates.
I think the clientId and the name identifies a durable subscription. These two subscriptions must come through the same connection with the same clientId but a different name. Then it is possible to have more than one receiver per clientId, wich all must get the messages. And they could have different message selectors.
> Only one session
> at a time can have a TopicSubscriber for a particular
> durable subscription. See
> Section 4.3.2, ?Client Identifier,? for more
> information.
[...]
Regards
Bernd -
6. Re: Problem: Multiple Durable Subscriptions on One Client ID
joelvogt Oct 20, 2002 8:43 PM (in response to temafm)A spec unclear? ;)