RabbitMQ C/C++ Async Publisher Confirm

436 views
Skip to first unread message

U MK

unread,
Oct 22, 2019, 5:49:20 AM10/22/19
to rabbitmq-users
Hi,

Is there any way to achieve the asynchronous Publisher confirm( i.e. Published receive ack asynchronously once subscriber read message from Queue) in RabbitMQ C/C++ library.

In RabbitMQ tutorial there is a an example for Publisher confirm asynchronously https://www.rabbitmq.com/tutorials/tutorial-seven-dotnet.html
I wanted similar example to achieve in C++, Can some one suggest me how I can achieve in C/C++ windows

Thanks,
Mohan

Yong Hua

unread,
Oct 22, 2019, 5:57:40 AM10/22/19
to rabbitm...@googlegroups.com
Hello
You could refer the documentation defined here:
https://github.com/CopernicaMarketingSoftware/AMQP-CPP

* Publish a message to an exchange
*
* You have to supply the name of an exchange and a routing key.
RabbitMQ will
* then try to send the message to one or more queues. With the
optional flags
* parameter you can specify what should happen if the message could
not be routed
* to a queue. By default, unroutable message are silently discarded.
*
* This method returns a reference to a DeferredPublisher object. You
can use
* this returned object to install callbacks that are called when an
undeliverable
* message is returned, or to set the callback that is called when the
server
* confirms that the message was received.
*
* To enable handling returned messages, or to enable
publisher-confirms, you must
* not only set the callback, but also pass in appropriate flags to
enable this
* feature. If you do not pass in these flags, your callbacks will not
be called.
* If you are not at all interested in returned messages or
publish-confirms, you
* can ignore the flag and the returned object.

U MK

unread,
Oct 22, 2019, 6:03:22 AM10/22/19
to rabbitmq-users
Hi, 

Thanks for your reply.

I have this AMQP-CPP library, In which sample code it demonstrate the async publisher confirm.

U MK

unread,
Oct 22, 2019, 6:13:23 AM10/22/19
to rabbitmq-users
I am using C code in VS2008, it wont support latest C++11 features, Is C++11 support is must for RabbitMQ.

U MK

unread,
Oct 22, 2019, 7:02:47 AM10/22/19
to rabbitmq-users
Hi,

I am using reference library, https://github.com/alanxz/rabbitmq-c


Because our existing application build on VS 2008, which doesn't use C++11 feature.
Can you please guide in plane C RabbitMQ how to get async publisher confirm.

Thanks,
Mohan

On Tuesday, 22 October 2019 15:33:22 UTC+5:30, U MK wrote:
Message has been deleted

Wesley Peng

unread,
Oct 24, 2019, 3:05:51 AM10/24/19
to rabbitm...@googlegroups.com
U MK wrote:
> Publisher confirm means ?

Please see this:

https://www.rabbitmq.com/confirms.html#publisher-confirms

regards.

U MK

unread,
Oct 24, 2019, 3:07:57 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 statement. by using publisher confirm is it possible to achieve?

Thanks,
Mohan
     

On Tuesday, 22 October 2019 15:27:40 UTC+5:30, Yong Hua wrote:
Reply all
Reply to author
Forward
0 new messages