postwait / node-amqp

[UNMAINTAINED] node-amqp is an AMQP client for nodejs
MIT License
1.69k stars 357 forks source link

Default behavior for ack: true is not what one might expect #215

Open CodeShark opened 11 years ago

CodeShark commented 11 years ago

I realize others have already posted issues concerning related topics (i.e. issue 26 and 210), but I wasn't able to get a definitive answer just browsing the comments nor the API docs nor the tests. It seems to me that subscribing with ack: true should have as default behavior that the message is not dequeued unless explicitly acknowledged. It is unsafe to dequeue it considering the client might have crashed. However, this is not the behavior I'm getting. Could someone please point me towards exactly what I need to do to get this behavior?

Specifically, I'm looking for an example that implements 2. Explicit under 3.1.8 Acknowledgements on page 29 of http://www.rabbitmq.com/resources/specs/amqp0-9-1.pdf

Any help would be tremendously appreciated.

Thank you in advance.

CodeShark commented 11 years ago

I think I figured it out. { durable: true, autoDelete: false } for the queue on both the sender and receiver.