You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by cineva <an...@yahoo.com> on 2013/07/22 08:37:57 UTC

ActiveMQ-CPP - Is there a way to keep track of how many times a message has been redelivered?

I know about the "JMSXDeliveryCount" property but it seems it doesn't work
between consumers. Everytime a message is redelivered for the same consumer
the property is increased by one which is correct but if a second consumer
gets the same message, the property is set to 1, for the third consumer it's
2 and so on. 




--
View this message in context: http://activemq.2283324.n4.nabble.com/ActiveMQ-CPP-Is-there-a-way-to-keep-track-of-how-many-times-a-message-has-been-redelivered-tp4669562.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: ActiveMQ-CPP - Is there a way to keep track of how many times a message has been redelivered?

Posted by cineva <an...@yahoo.com>.
Assuming there is a message in the queue, I was expecting the following code
to output: 0123456789 but I get 0123412345.

	for ( i=1; i<=5; i++ )
	{
		msg = consumer->receive(TIMEOUT);
		cout << msg->getIntProperty("JMSXDeliveryCount");
		session->rollback();
	}

	consumer->close();
	delete consumer;

	for ( i=1; i<=5; i++ )
	{
		msg = consumer2->receive(TIMEOUT);
		cout << msg->getIntProperty("JMSXDeliveryCount");
		session->rollback();
	}




--
View this message in context: http://activemq.2283324.n4.nabble.com/ActiveMQ-CPP-Is-there-a-way-to-keep-track-of-how-many-times-a-message-has-been-redelivered-tp4669562p4669574.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: ActiveMQ-CPP - Is there a way to keep track of how many times a message has been redelivered?

Posted by Timothy Bish <ta...@gmail.com>.
On 07/22/2013 02:37 AM, cineva wrote:
> I know about the "JMSXDeliveryCount" property but it seems it doesn't work
> between consumers. Everytime a message is redelivered for the same consumer
> the property is increased by one which is correct but if a second consumer
> gets the same message, the property is set to 1, for the third consumer it's
> 2 and so on.
>
>
>
>
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/ActiveMQ-CPP-Is-there-a-way-to-keep-track-of-how-many-times-a-message-has-been-redelivered-tp4669562.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
Can you provide some code or more context.  What do you mean about the 
same message being delivered to a second consumer?

-- 
Tim Bish
Sr Software Engineer | RedHat Inc.
tim.bish@redhat.com | www.fusesource.com | www.redhat.com
skype: tabish121 | twitter: @tabish121
blog: http://timbish.blogspot.com/