I'm trying to setup a workflow where the Producer sends off a message to the broker, the broker sends the message to a consumer, and a consumer ACK's back to on the same queue/channel and that is picked up as "confirm" by the Producer.
I'm basing my info off of this: http://www.rabbitmq.com/blog/2011/02/10/introducing-publisher-confirms/
According to that document, it should wait for the consumer to send an ack or a nack. However, in my testing, it returns the ack immediately(as soon as it reaches the broker(RabbitMQ)).
The document says that will happen in three scenarios:
an un-routable mandatory or immediate message is confirmed right after the basic.return;
otherwise, a transient message is confirmed the moment it is enqueued; and,
a persistent message is confirmed when it is persisted to disk or when it is consumed on every queue.
I made sure to set my queue to durable and set the delivery mode to 2(persisent) when calling basicPublish. So it is a persisent message. I also made sure that is getting successfully routed to a queue.
Is this expected behavior? Or am doing something wrong to make it ACK immediately instead of waiting for the ack from the consumer?