Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-2047

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

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0.0
    • 2.1.0
    • camel-jms
    • None

    Description

      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?

      Attachments

        Issue Links

          Activity

            People

              davsclaus Claus Ibsen
              rgavlin Ron Gavlin
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: