You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by hayden74 <hd...@gmail.com> on 2016/02/25 00:37:30 UTC

VirtualTopic message acknowledgment/confirmation

Hi guys,
We use VirtualTopics for event publishing and recently one of the consumers
failed to process the message from the event due to some database error.
>From the ActiveMQ perspectives, the message has been delivered. The client,
however, failed to process it. So my question is, is there a way to send
acknowledgment/confirmation to ActiveMQ once the message has been received
and processed successfully? otherwise, the message will have to be
re-delivered to the consumer for a number of times with fixed intervals eg:
re-deliver 10 times, with 1 hour between each delivery. 

Here the code I am using:


*Producer code*
...
        .from("jms:queue:sales.events")
	.log("Event Type: ${header.eventType}")
	.to("activemq:topic:VirtualTopic.sales.contractChanged")



    *Consumer code*
    @JmsListener(destination =
"Consumer.Privileges.VirtualTopic.sales.contractChanged")
    public void processContractsFromQueue(String someString) {

          //process someString and confirm if all good, otherwise reply
(somehow) with an error message to tell the queue to re-deliver the message
later. 

    }





--
View this message in context: http://camel.465427.n5.nabble.com/VirtualTopic-message-acknowledgment-confirmation-tp5778240.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: VirtualTopic message acknowledgment/confirmation

Posted by Quinn Stevenson <qu...@pronoia-solutions.com>.
Have you tried the other acknowledgement modes?  It sounds like you’re using auto acknowledgment.

You could try setting up transactions as well.

In either case, Camel will acknowledge the message once the exchange completes - so you don’t do that explicitly.  

> On Feb 24, 2016, at 4:37 PM, hayden74 <hd...@gmail.com> wrote:
> 
> Hi guys,
> We use VirtualTopics for event publishing and recently one of the consumers
> failed to process the message from the event due to some database error.
> From the ActiveMQ perspectives, the message has been delivered. The client,
> however, failed to process it. So my question is, is there a way to send
> acknowledgment/confirmation to ActiveMQ once the message has been received
> and processed successfully? otherwise, the message will have to be
> re-delivered to the consumer for a number of times with fixed intervals eg:
> re-deliver 10 times, with 1 hour between each delivery. 
> 
> Here the code I am using:
> 
> 
> *Producer code*
> ...
>        .from("jms:queue:sales.events")
> 	.log("Event Type: ${header.eventType}")
> 	.to("activemq:topic:VirtualTopic.sales.contractChanged")
> 
> 
> 
>    *Consumer code*
>    @JmsListener(destination =
> "Consumer.Privileges.VirtualTopic.sales.contractChanged")
>    public void processContractsFromQueue(String someString) {
> 
>          //process someString and confirm if all good, otherwise reply
> (somehow) with an error message to tell the queue to re-deliver the message
> later. 
> 
>    }
> 
> 
> 
> 
> 
> --
> View this message in context: http://camel.465427.n5.nabble.com/VirtualTopic-message-acknowledgment-confirmation-tp5778240.html
> Sent from the Camel - Users mailing list archive at Nabble.com.