[rabbitmq-discuss] Testing lightweight publisher confirms

Simon MacMullen simon at rabbitmq.com
Wed Feb 6 11:19:30 GMT 2013


On 05/02/13 17:55, DLB9000 wrote:
> On Thursday, December 1, 2011 9:42:39 AM UTC-5, Simon MacMullen wrote:
>
>  > Ah, hang on. One way to "crash" a queue is to have it running on a
>  > single node in a cluster and take that node down. So:
>
>  > 1) Create a two node cluster, node1 and node2.
>  > 2) Create a non-mirrored queue on node1.
>  > 3) Start a publisher using confirms on node2, publishing to that queue.
>  > 4) Stop node1.
>
>  > You should see nacks then I think.
>
>
> Tried this, but was still unable to generate a NACK.

Yes, sorry, my previous suggestion doesn't work. We only generate nacks 
for queues that have died unexpectedly. So you need to actually kill a 
queue. This is in general meant to be hard :-), but with "rabbitmqctl 
eval" you can do anything:

$ rabbitmqctl eval '{ok, Q} = 
rabbit_amqqueue:lookup(rabbit_misc:r(<<"/">>, queue, <<"test">>)), 
[{pid, Pid}] = rabbit_amqqueue:info(Q, [pid]), exit(Pid, bang).'

The above command kills the queue "test" in the virtual host "/". I've 
just tested this, and it does indeed cause nacks to be sent.

Cheers, Simon

-- 
Simon MacMullen
RabbitMQ, VMware


More information about the rabbitmq-discuss mailing list