[rabbitmq-discuss] Consumer Throttling

Ben Hood 0x6e6562 at gmail.com
Tue Nov 25 14:51:36 GMT 2008


Nathan,

On Tue, Nov 25, 2008 at 1:11 AM, Nathan Woodhull <nathan at mcommons.com> wrote:
> In our application we have a third party service that we are only
> allowed to make requests to 10 times/per second. If we exceed the
> 10msgs/second throttle, we are charged a fine for breaking the
> contractual agreement.
>
> Our application generates requests in large spurts, so we would like
> to use a queue to throttle the outgoing messages to the external
> service to comply with the SLA. Is there a good way to do this through
> RabbitMQ configuration? Doing this in the producer or consumer itself
> does not seem like it is likely to work since they are both
> distributed. Basically, we want to implement this pattern:
>
> http://activemq.apache.org/camel/throttler.html

Off the top of my head I can't see how you can do this without
creating a custom queue implementation that implements this sliding
window check before delivering to a consumer.

Whilst this would probably be doable, it wouldn't be available in
Rabbit OOTB, i.e. you would have to try it with a patched version.

HTH,

Ben




More information about the rabbitmq-discuss mailing list