camel-jms async consumer needs dynamic mechanism to throttle message consumption
--------------------------------------------------------------------------------

                 Key: CAMEL-2047
                 URL: https://issues.apache.org/activemq/browse/CAMEL-2047
             Project: Apache Camel
          Issue Type: Improvement
          Components: camel-jms
    Affects Versions: 2.0.0
            Reporter: Ron Gavlin


camel-jms should provide an async consumer that can throttle consumption of 
incoming messages. This is necessary in scenarios where a large backlog of 
messages exists on the input queue. In this case, it is likely that an async 
consumer will overload camel with message exchanges resulting in problems. A 
dynamic throttling mechanism on the async camel-jms consumer is required to 
avoid this problem.

One possible implementation might be as follows:

First, add a property "maxPendingAsyncExchanges" on the async camel-jms 
consumer endpoint. Then add support in the endpoint to track the total number 
of pending/in-progress exchanges, i.e., the number of exchanges for which no 
SUCCESS/ERROR acknowledgement has been returned. When this value reaches 
"maxPendingAsyncExchanges", then the endpoint would stop its Spring JMS 
DefaultMessageListenerContainer. Once the number of "pending" exchanges drops 
below a percentage of the "maxPendingAsyncExchanges" threshold, say 
"reconnectPercentOfMax", the Spring DMLC would be restarted. 

The CXF implementation of this capability is described in CXF-2002, CXF-2342, 
and CXF-2391. CXF has properties maxSuspendedContinuations and 
reconnectPercentOfMax to control the throttling behavior.

This is the type of dynamic throttling I envisioned in Camel. Thoughts?


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to