[rabbitmq-discuss] asynchronous RPC / activation with RabbitMQ

Alexandru Scvorţov alexandru at rabbitmq.com
Tue Oct 25 12:06:26 BST 2011


Hi Chris,

> By "Asynchronous RPC" what I am after is the ability for a task to fire off when an item is enqueued without the client having to hang around for any response. Also by throttling, what I was referring to was the ability to limit the number of RPCs that are fired off concurrently. Please forgive me explanation, as it may have caused some confusion.

There isn't any automatic way to limit the number of messages a
producer can publish without its cooperation.  You'll have to write that
on top of RabbitMQ; the producers will have to keep track of how many
unanswered requests they've made.  It's not hard to do; several of our
example programs (in particular MulticastMain.java) do this sort of
throttling.

There are a bunch of tutorials that build up to an RPC system:
  http://www.rabbitmq.com/getstarted.html
On top of that, you'll just need to do the throttling.

Cheers,
Alex

On Tue, Oct 25, 2011 at 11:49:25AM +0100, Chris Adkin wrote:
> Hi Alexandru,
> 
> By "Asynchronous RPC" what I am after is the ability for a task to fire off when an item is enqueued without the client having to hang around for any response. Also by throttling, what I was referring to was the ability to limit the number of RPCs that are fired off concurrently. Please forgive me explanation, as it may have caused some confusion.
> 
> Regards,
> 
> Chris
> 
> 
> 
> 
> ________________________________
> From: Alexandru Scvorţov <alexandru at rabbitmq.com>
> To: ChrisAdkin <chris1adkin at yahoo.co.uk>
> Cc: rabbitmq-discuss at lists.rabbitmq.com
> Sent: Tuesday, 25 October 2011, 11:44
> Subject: Re: [rabbitmq-discuss]  asynchronous RPC / activation with RabbitMQ
> 
> > Is it possible with RabbitMQ to implement asynchronous remote procedure calls
> > and throttle the rate at which these are called ?,
> 
> Probably.  You can certainly do RPC, asynchronous messaging and
> rate throttling with RabbitMQ.
> 
> Have a look at the examples in your preferred language:
>   http://hg.rabbitmq.com/rabbitmq-java-client/file/default/test/src/com/rabbitmq/examples/
>   http://hg.rabbitmq.com/rabbitmq-dotnet-client/file/default/projects/examples/client/
> You'll be looking for the client/server pairs.
> 
> I'm not sure what you mean by *asynchronous* RPC.  I think you mean
> "send a message"/"a bit later, a reply comes back".
> 
> > throttle the rate at which these are called 
> 
> Depending on what you mean, that may be a bit hard.  There's no way in
> RabbitMQ to throttle producers (you can certainly write throttling into
> your clients, but a rogue producer will still be able to dump a lot of
> messages onto RabbitMQ).  The consumer can still throttle the broker,
> though.  So, the broker is going to be the one overloaded with
> messages; in this case, it will start writing messages to disk; only if
> it is really having problems with lack of memory, will it throttle
> publishers.
> 
> Hope this helps.
> 
> Cheers,
> Alex
> 
> On Tue, Oct 25, 2011 at 03:10:33AM -0700, ChrisAdkin wrote:
> > 
> > Is it possible with RabbitMQ to implement asynchronous remote procedure calls
> > and throttle the rate at which these are called ?, I ask this as a complete
> > newbie to RabbitMQ. 
> > -- 
> > View this message in context: http://old.nabble.com/asynchronous-RPC---activation-with-RabbitMQ-tp32716352p32716352.html
> > Sent from the RabbitMQ mailing list archive at Nabble.com.
> > 
> > _______________________________________________
> > rabbitmq-discuss mailing list
> > rabbitmq-discuss at lists.rabbitmq.com
> > https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss


More information about the rabbitmq-discuss mailing list