<br><div class="gmail_quote">On Wed, Feb 17, 2010 at 2:02 PM, glenner <span dir="ltr">&lt;<a href="mailto:glenn.ergeerts@artesis.be">glenn.ergeerts@artesis.be</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
I have one server application and multiple client applications. The server<br>
can publish different kind of events to the interested clients. Clients<br>
express their interest in a certain event type (together with a predicate<br>
which describes in which situation they should get an event, so they can<br>
filter events). From that moment on the server pushes events to the<br>
subscribed clients when they occur and match the predicates.<br>
<br>
For implementing this i thought to have the server listening (using<br>
SimpleRpcServer) to one central queue where the subscription requests get<br>
send to. A new queue matching that subscription is then constructed by the<br>
server. The server publishes messages on the correct queues when certain<br>
events occur. The clients listen on their specific queue(s) (also using a<br>
SimpleRpcServer). The client knows which queue to listen to based on a<br>
convention (name of the event etc).<br>
<br>
Now the question: i want to be able to let the server specify (generate) a<br>
unique queue name for each client/event subscription and then send it back<br>
to the client so the client knows which queue to subscribe to. Is something<br>
like this possible? I could not find any support for replying inside the<br>
SimpleRpcServer.<br>
<br>
And, more general, is this a valid design using RabbitMQ/AMQP? I&#39;m still new<br>
to RabbitMQ/AMQP so maybe i overlooked a more approriate way to do this..<br></blockquote><div><br>The Erlang amqp client lib has an example RPC server.<br><br>In essence, when your client fires the &quot;new subscription please&quot; request it also has to create a reply queue. The initial message from client to server has to contain your &quot;subscription request&quot; plus your reply_to queue name and, ideally, a correlation_id. The reply_to and correlation_id fields, I think, are already part of the AMPQ message properties.<br>
<br>Your client can then receive the desired &quot;new subscription&quot; queue name as a message from the server on the reply_to queue with the appropriate correlation_id.<br><br>Hope this gets you into the right direction,<br>
Robby<br><br></div></div>