[rabbitmq-discuss] Forcing publish/confirm to return a nack

Simon MacMullen simon at rabbitmq.com
Fri Apr 11 12:49:08 BST 2014


On 10/04/2014 22:35, Ryan Brown wrote:
> I am just about finished working through my new publish/confirm workflow
> and would like to test non-standard workflows in my integration
> environment. Would there be a way that I could force rabbit to return,
> say, a basic.nack?

The confirm mechanism will only return a nack on a queue crash - not on 
queue deletion or queue's node going down.

So this is comparatively hard to test, since you're not exactly meant to 
be able to provoke a queue to crash. About the only way you can do it is 
with something like:

rabbitmqctl eval '{ok, Q} = 
rabbit_amqqueue:lookup(rabbit_misc:r(<<"/">>, queue, <<"test">>)), 
exit(element(7, Q), die).'

Cheers, Simon


More information about the rabbitmq-discuss mailing list