basicAck not work outside of handleDelivery

44 views
Skip to first unread message

Rodrigo Cañete

unread,
Jul 24, 2020, 6:06:19 PM7/24/20
to rabbitmq-users
HI.
My program uses handledelivery to get the messages from rabbit. 
When a message arrive I store the deliveryTag long value from envelope.getDeliveryTag() method and  the message are stored in an arraylist.

In other part of the program I have a listener checking if some message arrive to the arraylist, if arrive then take the message and the deliveryTag.
When the message was procesed I use channel.basicAck with the deliveryTag to tell to rabbit ack the message, But the message is still in unacked list and when I close th program and startup again receive the same message, ie, rabbit never receive my acknowledge.

But If i change the program and uses channel.BasicAck inside the handleDelivery it works! 



Any idea? Thanks!.


Arnaud Cogoluègnes

unread,
Jul 27, 2020, 3:09:55 AM7/27/20
to rabbitm...@googlegroups.com
The channel the message is received on and the channel that acknowledges the message must be the same. Are you sure this is the case?

________________________________________
From: rabbitm...@googlegroups.com <rabbitm...@googlegroups.com> on behalf of Rodrigo Cañete <rodrigo...@gmail.com>
Sent: Saturday, July 25, 2020 12:06 AM
To: rabbitmq-users
Subject: [rabbitmq-users] basicAck not work outside of handleDelivery
--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-user...@googlegroups.com<mailto:rabbitmq-user...@googlegroups.com>.
To view this discussion on the web, visit https://groups.google.com/d/msgid/rabbitmq-users/43d3ede4-228f-4d84-931f-292b410bc918o%40googlegroups.com<https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgroups.google.com%2Fd%2Fmsgid%2Frabbitmq-users%2F43d3ede4-228f-4d84-931f-292b410bc918o%2540googlegroups.com%3Futm_medium%3Demail%26utm_source%3Dfooter&data=02%7C01%7Cacogoluegnes%40vmware.com%7C0626eca69d574f89362008d8301dce84%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C1%7C637312251865502166&sdata=U8Hh3yEf33JELH63l2R6ZL0fpG6rU89sh1lzrdIh9bQ%3D&reserved=0>.
Reply all
Reply to author
Forward
0 new messages