Re: Durable Topics and message expiry

Tim Anderson <[email protected]> Wed, 17 Oct 2007 11:27:46 +1000
Newsgroups gmane.comp.java.openjms.user
Message-ID <[email protected]>
Actually, now that I think about it, thats not correct.
In OpenJMS, a subscriber only receives messages published after the time 
that their
subscription was registered.  So although you could  pre-register a 
durable subscriber
to force OpenJMS to retain old messages, new durable subscribers 
wouldn't be able to
access them.
You could possibly simulate what you want to do with a Queue and 
QueueBrowsers,
but you'd have to write logic to ensure you didn't process the same 
message twice.

-Tim

George H wrote:
> Ok thanks.
>
> On 10/16/07, Tim Anderson <[email protected]> wrote:
>   
>> George H wrote:
>>     
>>> Hi,
>>>
>>> I have this idea and I don't know how plausable it is to do with
>>> OpenJMS... So i'll run it by here and see the feedback :)
>>>
>>> I am thinking of implementing a Durable Topic on openjms that will
>>> hold a copy of messages that are sent to other clients. I want this
>>> topic to keep those messages indefinitely (set expiry date never to
>>> expire?) and I don't want the messages to disappear either once a
>>> subscriber has read them.
>>>
>>> The point being to create a "history topic" where subscribers can hook
>>> on to it, receive all messages in order from time X to current and
>>> then unsubscribe. But they can go back and check out the "history
>>> topic" again at any time.
>>>
>>> I haven't tried to do this but wondering if this is feesable to do
>>> with OpenJMS or if not I should just use a separate DB and a query.
>>>
>>> Thanks.
>>>
>>>       
>> OpenJMS holds onto persistent topic messages while there is a durable
>> subscriber for the
>> topic that has not yet received it.
>> To do what you want, you could pre-register a durable subscriber for
>> each topic that you want messages
>> retained for. This subscriber would never be used, but would ensure
>> that  non-expiring messages
>> are never discarded.
>>
>> -Tim
>>     
>
>   


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/