Niels, I think what you are looking for is not throttling, but single
threading groups of related messages, correct?  If so, then ActiveMQ message
groups is designed for exactly that and is trivial to implement...

Just route your messages through a JMS queue and set the JMSXGroupId header
set to your "id"  value and AMQ handles the rest...you can also use a
throttler to manage throughput per unit of time if needed...

see these pages for details:

http://activemq.apache.org/message-groups.html

http://camel.apache.org/parallel-processing-and-ordering.html


nbertram wrote
> I have a route that is invoked to get a status of an object "foo". The
> instance of foo is identified by a key. 
> 
> Concurrently at any given time I may receive following requests on the
> camel route:
> 
> GET status of foo/@id=A12
> GET status of foo/@id=A12
> GET status of foo/@id=A12
> GET status of foo/@id=A30
> GET status of foo/@id=A30
> GET status of foo/@id=A10
> 
> The id of foo is an infinite collection (could be anything).
> 
> I would like to throttle all queries for foo/@id=A12, foo/@id=30 and
> foo/@id=A10 separately. So that in the example above, 1 route for foo A12,
> A30 and A10 is executed but all other requests for A12 and A30 are
> throttled.
> 
> The Camel Throttle does not seem to support something like this and the
> only other thought I had is to use JMS topic. Anyone ever came across a
> use case like this before and if so how did you solve it in Camel?
> 
> Many thanks,
> Niels





-----
Ben O'Day
IT Consultant -http://consulting-notes.com

--
View this message in context: 
http://camel.465427.n5.nabble.com/can-camel-throttle-messages-based-a-dynamic-message-key-tp5757611p5758148.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to