You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by lekkie <le...@gmail.com> on 2010/02/04 10:30:01 UTC

How to configure JMS to persist message until ack is sent

Hi Guys,

I am not sure if this exist today, I 'd like to be able to persist a message
in a queue (after retrieving the message) until I consciously send an
acknowledgement (that the message can now be removed from the queue).

Today, the message leaves the queue as soon as you receive it, but I'd like
to keep it until I can successfully process the message (in my application).

If its possible, how do I set this config in ActiveMQ?

kr.
-- 
View this message in context: http://old.nabble.com/How-to-configure-JMS-to-persist-message-until-ack-is-sent-tp27449867p27449867.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: How to configure JMS to persist message until ack is sent

Posted by Stephen Gargan <st...@gmail.com>.
How about a transaction? 'commit' is your conscious acknowledgement.

On Thu, Feb 4, 2010 at 1:30 AM, lekkie <le...@gmail.com> wrote:
>
> Hi Guys,
>
> I am not sure if this exist today, I 'd like to be able to persist a message
> in a queue (after retrieving the message) until I consciously send an
> acknowledgement (that the message can now be removed from the queue).
>
> Today, the message leaves the queue as soon as you receive it, but I'd like
> to keep it until I can successfully process the message (in my application).
>
> If its possible, how do I set this config in ActiveMQ?
>
> kr.
> --
> View this message in context: http://old.nabble.com/How-to-configure-JMS-to-persist-message-until-ack-is-sent-tp27449867p27449867.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>

Re: How to configure JMS to persist message until ack is sent

Posted by Ashwin Karpe <as...@progress.com>.
Hi,

The Broker always persists the message until it receives an ack from the
consumer just in case the consumer dies abruptly, in which case after the
message is sent to another destination based on the redelivery policy.

But you specific issue deals with the the consumer connection factory
immediately delivering the acknowledgement  to the broker upon successful
dispatch to the consumer and the broker removing its copy. This could be
corrected by 2 ways
   - synchronous acknowledgements and
   - JMS/XA transactions

For synchronous acknowledgements check out 
http://activemq.apache.org/consumer-dispatch-async.html
http://activemq.apache.org/consumer-dispatch-async.html 

For JMS/XA transactions check out 
http://activemq.apache.org/how-do-transactions-work.html
http://activemq.apache.org/how-do-transactions-work.html 

Cheers,

Ashwin...


lekkie wrote:
> 
> Hi Guys,
> 
> I am not sure if this exist today, I 'd like to be able to persist a
> message in a queue (after retrieving the message) until I consciously send
> an acknowledgement (that the message can now be removed from the queue).
> 
> Today, the message leaves the queue as soon as you receive it, but I'd
> like to keep it until I can successfully process the message (in my
> application).
> 
> If its possible, how do I set this config in ActiveMQ?
> 
> kr.
> 


-----
--- 
Ashwin Karpe, Principal Consultant, PS - Opensource Center of Competence 
Progress Software Corporation
14 Oak Park Drive
Bedford, MA 01730
--- 
+1-972-304-9084 (Office) 
+1-972-971-1700 (Mobile) 
---- 
Blog: http://opensourceknowledge.blogspot.com/


-- 
View this message in context: http://old.nabble.com/How-to-configure-JMS-to-persist-message-until-ack-is-sent-tp27449867p27452172.html
Sent from the Camel - Users mailing list archive at Nabble.com.