[rabbitmq-discuss] Acknowledging to rabbitmq Server
Tim Watson
tim at rabbitmq.com
Fri Sep 27 14:37:41 BST 2013
On 27 Sep 2013, at 13:37, Saurabh Sharma wrote:
> Hi,
> I am making a consumer framework in java for consuming messages from the queues.
> I am sharing a single rabbitmq connection and channel among 4 threads.
> My question is can we store the "delivery.getEnvelope().getDeliveryTag()" in a object while fetching the message from Rabbit and use the same "delivery.getEnvelope().getDeliveryTag()" stored in object for Acknowledgement after processing of message.
Yes, but you must ACK on the same channel that delivered the message in the first place.
> Processing is taking a little more time in our case , So we are thinking of storing the "delivery.getEnvelope().getDeliveryTag()" in an Object and use it later for Acknowledgement.
> Is it fine to do so or will it casue any issue in application.
I cannot tell you if it will cause any issues in your application, but it is safe in terms of the RabbitMQ java client library.
Cheers,
Tim
More information about the rabbitmq-discuss
mailing list