Differentiate between ack and nack (requeue = false) messeges?

621 views
Skip to first unread message

qsxm...@gmail.com

unread,
Mar 24, 2017, 12:11:09 PM3/24/17
to rabbitmq-users

I am working on an RabbitMQ plugin there monitor / log all acks on all queues using the rabbit_backing_queue behaviour.
Whenever a ack is made the plugin publish a clone of the messages without body onto a monitor queue.

My problem is that both ack and nack (requeue = false) use the ack callback, is there a way differentiate between the two?

I am working on a fix using dead letter exchanges, but this is not optimal as it removes my clients access to this feature.


Michael Klishin

unread,
Mar 24, 2017, 12:24:41 PM3/24/17
to rabbitm...@googlegroups.com
acks and reject/nack with requeue = false are identical from both the client and server point of view.

I guess you could implement a channel interceptor that can differentiate at the protocol
method level. Sounds potentially much easier and less risky than implementing your own
backing_queue.

--
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-users+unsubscribe@googlegroups.com.
To post to this group, send email to rabbitmq-users@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
MK

Staff Software Engineer, Pivotal/RabbitMQ

qsxm...@gmail.com

unread,
Mar 30, 2017, 5:27:07 AM3/30/17
to rabbitmq-users
Sorry it tog me so long to get back to this.

My main concerns with this solution are:
1. Is it possible to have multiple channel interceptors at the same time?
I use a public rabbitmq-auth-token plugin to authorize the clients,
But as I understand it, it adds a exstre argument to the intercept with init/1,
     only explicitly intercepts 'basic.publish',
     but then it cleans after itself with:
           intercept(Method, Content, _) -> {Method, Content}.

And I found this line: "Keep in mind that while we can enable several interceptors, only one interceptor can intercept a particular AMQP method"
When I was looking up you solution.

2. Is it possible for a plugin to have both a channel_interceptor and backing_queue behaviour?
The easiest for me, would be if the channel interceptor added something to reject/nack with requeue = false, that my backing_queue could recognize.

3. If I ware to make at channel_interceptor plugin ther logs ack, nack and reject is it the possible to access the messages headers?
     As this is inporten for the log.





On Friday, March 24, 2017 at 5:24:41 PM UTC+1, Michael Klishin wrote:
acks and reject/nack with requeue = false are identical from both the client and server point of view.

I guess you could implement a channel interceptor that can differentiate at the protocol
method level. Sounds potentially much easier and less risky than implementing your own
backing_queue.
On Fri, Mar 24, 2017 at 7:11 PM, <qsxm...@gmail.com> wrote:

I am working on an RabbitMQ plugin there monitor / log all acks on all queues using the rabbit_backing_queue behaviour.
Whenever a ack is made the plugin publish a clone of the messages without body onto a monitor queue.

My problem is that both ack and nack (requeue = false) use the ack callback, is there a way differentiate between the two?

I am working on a fix using dead letter exchanges, but this is not optimal as it removes my clients access to this feature.


--
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.
To post to this group, send email to rabbitm...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages