what does mean by Publisher confirm in AMQP-CPP

68 views
Skip to first unread message

U MK

unread,
Oct 24, 2019, 3:09:21 AM10/24/19
to rabbitmq-users
Hi,

I have doubt, in AMQP-CPP 

Publisher confirm means ?

     1) When publisher publish the message to broker, broker confirms to publisher that I have received and processed 
              OR
     2) When publisher publish message to broker, broker confirms to Publisher  that consumer consume the message and deleted from queue.

Which statement is true?

I want to achieve the 2nd answer. by using publisher confirm is it possible to achieve?

Thanks,
Mohan

Wesley Peng

unread,
Oct 24, 2019, 3:20:27 AM10/24/19
to rabbitm...@googlegroups.com
U MK wrote:
> Publisher confirm means ?
>
>      1) When publisher publish the message to broker, *broker *confirms
> to *publisher *that I have received and processed
>               OR
>      2) When publisher publish message to broker, *broker *confirms to
> *Publisher *that consumer *consume *the message and deleted from queue.
>
> Which statement is true?

The first one.


>
> I want to achieve the 2nd answer. by using publisher confirm is it
> possible to achieve?

Since AMQP is an async specification, the producer won't know the status
of consumers. So to implement the second way, you may want both
publisher confirm and consumer confirm.

regards.

U MK

unread,
Oct 25, 2019, 1:44:37 AM10/25/19
to rabbitmq-users
Thanks for your reply.

let me understand clearly.

1) Publisher confirm
          Publisher publish the data exchange receive the data and route data to respective queue
          then broker send ack to publisher

2) consumer confirm
          After consumer consume data from queue, it send ack to broker
          then on positive ack broker remove data from queue.

so to achieve Ack from Consumer to Publisher, does broker save consumer ack somewhere and that can be read from publisher?
Or publisher confirm can be done once the consumer confirm to broker?

Thanks,
Mohan

Wesley Peng

unread,
Oct 25, 2019, 1:48:36 AM10/25/19
to rabbitm...@googlegroups.com
U MK wrote:
> so to achieve Ack from Consumer to Publisher, does broker save consumer
> ack somewhere and that can be read from publisher?
> Or publisher confirm can be done once the consumer confirm to broker?

The problem is you never know when consumer will connect to the channel
and begins to consume the messages. So I don't think producer will wait
for maybe a long time to get back the ack of consumer through broker.

regards.

Luke Bakken

unread,
Oct 25, 2019, 1:02:45 PM10/25/19
to rabbitmq-users
Hi Mohan,

#1 is correct.

There is no way to achieve #2 using RabbitMQ "out of the box". Your consuming application would have to let the publisher know that it received the message. It could publish a message back to RabbitMQ, which would make your entire system similar to an RPC implementation.

We have a tutorial for publisher confirms in Java: https://www.rabbitmq.com/tutorials/tutorial-seven-java.html

You should be able to adopt that code to AMQP-CPP.

Thanks,
Luke
Reply all
Reply to author
Forward
0 new messages