On 3 February 2012 06:09, Emile Joubert <span dir="ltr"><<a href="mailto:emile@rabbitmq.com">emile@rabbitmq.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On 03/02/12 09:35, Liuzhuofu wrote:<br><div class="im">
> 1. What's the behavier of "x-presence" like? direct, fanout or topic?<br>
</div>None of those: the presence exchange is a different kind of exchange<br>
that drops messages that are published to it. Instead it generates<br>
messages when queues bind and unbind.<br></blockquote><div><br>There's also more detailed discussion of this in the README, <a href="https://github.com/tonyg/presence-exchange#readme">https://github.com/tonyg/presence-exchange#readme</a>.<br>
</div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div class="im">> 2. One "x-presence" exchange can only get the event that the binding<br>
> changes on this exchanges, other bindings on other exchanges, it can not<br>
> monitor, am I right?<br>
It only produces notifications of binding on the local exchange, not<br></div>
other exchanges.<br></blockquote><div><br>For the avoidance of doubt, this should get you to where you need to be: clients, when they connect, should bind a temporary (autodelete) queue to a distinguished presence exchange for your application. If they crash, suffer heartbeat failure, or otherwise disconnect, the temporary queue will be deleted, and as a consequence the binding to the presence exchange will be removed, the fact of which will then be broadcast to the presence listeners attached to that exchange.<br>
<br>Regards,<br> Tony<br></div></div>-- <br>Tony Garnock-Jones<br><a href="mailto:tonygarnockjones@gmail.com" target="_blank">tonygarnockjones@gmail.com</a><br><a href="http://homepages.kcbbs.gen.nz/tonyg/" target="_blank">http://homepages.kcbbs.gen.nz/tonyg/</a><br>