Responses inlined<br><br><div class="gmail_quote">On Mon, Jan 16, 2012 at 5:02 AM, TZHA <span dir="ltr">&lt;<a href="mailto:sophiewenxizhang@googlemail.com">sophiewenxizhang@googlemail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi,<br>
<br>
i am working with rabbitmq-c (downloaded from github/newest version -<br>
cmake/VS2010 rebuild under windows) and would like to prepare a<br>
rabbitmq/c/c++ based solution for a production environment.<br>
<br>
However for a real application, we still have some reliability<br>
requirements that are apparently not yet supported by rabbitmq-c.<br>
<br>
The first requirement is to get �cancellation notification� in case,<br>
e.g. whenever a queue is down � so that the client/consumer can<br>
reconnect to the broker.<br>
<br>
For this purpose � as I understood, the client has to send �the<br>
�client-capabilities� with<br>
<br>
 � ...<br>
 � consumer_cancel_notify = true,<br>
 � publisher_confirms = true<br>
<br></blockquote><div>For the consumer_cancel_notify - the client does need to tell the broker that it wants to turn this on.</div><div><br></div><div>For the publisher_confirms - the client is not required to tell the broker to enable this. �To enabled it on a channel you should send send a confirm.select to enable publisher_confirms for a channel. You can send the client capabilities to query the broker to see if it supports this extension before continuing connecting to a broker.</div>
<div><br></div><div>For some more info how rabbit supports these extensions:�<a href="http://www.rabbitmq.com/extensions.html">http://www.rabbitmq.com/extensions.html</a></div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

for the connection setup. In �case of of rabbitmq-c, I saw that one<br>
shall set the capabilities in amqp_login (amqp_socket.c) �method.<br>
Current this is set to NULL.<br>
<br>
 �amqp_connection_open_t s<br>
 �s.capabilities.len = 0;<br>
 �s.capabilities.bytes = NULL;<br></blockquote><div><br></div><div>The format of that field is I believe a shortstr. �However�that&#39;s�not where you want to send capabilities. �When you get the connection.start method from the broker, you need to examine the server-properties (which is a table) parameter to see if the broker supports the extensions you want. �When you respond with a connection.start-ok, you need to put the extensions you want to enable in the client-properties parameter, which is also a table.</div>
<div>�</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Can some expert tell me what kind of syntax can be used for the<br>
s.capabilities.bytes field?<br>
<br>
The next requirement is to receive publisher_confirms. I guess that<br>
the client-capabilities is also a pre-condition, and I have to set the<br>
�mandatory� parameter for the amqp_basic_publish method to 1. Is there<br>
anything else I have to set?<br></blockquote><div><br></div><div>In order to enable publisher confirms,�</div><div><br></div><div>You need to do the confirm.select (amqp_confirm_select(...) ) method on the channel you want to enable publisher confirms on. �</div>
<div>After which anytime you do a basic.publish, (amqp_basic_publish(...)) you will eventually get a basic.ack back from the broker once the message has been processed*.</div><div>* Note: processed does not mean delivered, it just means that the broker received it and did something with it (routed to a queue, returned it, dropped it etc). �If you want ensure that the message got routed a queue - send the mandatory flag. �If the message isn&#39;t routed to a queue the message will returned to the client with a basic.return, then you will be a basic.ack.�</div>
<div><br></div><div>More information on publisher confirms:�<a href="http://www.rabbitmq.com/amqp-0-9-1-reference.html#class.confirm">http://www.rabbitmq.com/amqp-0-9-1-reference.html#class.confirm</a></div><div>More information on the basic publish fields:�<a href="http://www.rabbitmq.com/amqp-0-9-1-reference.html#basic.publish">http://www.rabbitmq.com/amqp-0-9-1-reference.html#basic.publish</a></div>
<div>Finally an example client that leverages rabbitmq-c and uses publisher confirms:�<a href="https://github.com/alanxz/SimpleAmqpClient/blob/master/src/Channel.cpp#L282">https://github.com/alanxz/SimpleAmqpClient/blob/master/src/Channel.cpp#L282</a></div>
<div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Thanks in advance for any advices.<br>
_______________________________________________<br>
rabbitmq-discuss mailing list<br>
<a href="mailto:rabbitmq-discuss@lists.rabbitmq.com">rabbitmq-discuss@lists.rabbitmq.com</a><br>
<a href="https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss" target="_blank">https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss</a><br>
</blockquote></div><br>