What defines 'active' for a topic subscription?
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Mike_Squance
Posted On:   Wednesday, January 16, 2002 11:28 AM

The JMS spec says that a non-durable topic subscription only receives messages while it is active. Does active mean that the subscription hasn't been closed, or does it mean that it is calling receive()? Basically what I need to know is that if I have a topic subscriber, can I sit in a while loop calling receive() and expect to get every message published, even if it is published while I'm handling the last message (before I've come back to the receive()). I think that you must be able to do that, or non-durable subscriptions would not be very useful, however I seem to be missing messages and I want to confirm if its a bug in the JMS implementation that I'm using. Thanks, Mike.    More>>

The JMS spec says that a non-durable topic subscription only receives messages while it is active.
Does active mean that the subscription hasn't been closed, or does it mean that it is calling receive()?


Basically what I need to know is that if I have a topic subscriber, can I sit in a while loop calling receive() and expect to get every message published, even if it is published while I'm handling the last message (before I've come back to the receive()).


I think that you must be able to do that, or non-durable subscriptions would not be very useful, however I seem to be missing messages and I want to confirm if its a bug in the JMS implementation that I'm using.


Thanks,
Mike.

   <<Less

Re: What defines 'active' for a topic subscription?

Posted By:   Mike_Squance  
Posted On:   Wednesday, January 16, 2002 01:13 PM

I've answered my own question.


A topic subscription is active when the topic connection is started.


Therefore, the while loop calling receive() should be okay if it is after the topic connection is started and before it is stopped. In my case, I realized that the while loop was actually outside the set-up of the connection and session.

About | Sitemap | Contact