Throttler – restricting the number of messages flowing to an endpoint

When you need to limit the number of messages flowing through a route during a specified time period, the Throttler EIP can help. For example, if you have a downstream system that can only handle 10 requests per second, using a Throttler EIP within your route can ensure that you do not exceed that rate.

This recipe will show you how to restrict the number of messages routed to a set of endpoints during a specified time period.

Getting ready

The Java code for this recipe is located in the org.camelcookbook.routing.throttler package. The Spring XML files are located under src/main/resources/META-INF/spring and prefixed with throttler.

How to do it...

In order to use the Throttler, ...

Get Apache Camel Developer's Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.