2 Replies Latest reply on Feb 25, 2010 3:53 PM by scranton_scranton

    Strategy advice for correlated route

    scranton_scranton

      I have scenario where I need to wait on two things before moving on to the next steps:

       

      1) response from an InOut call to an external service

       

      AND

       

      2) database row field value to change (with exception timeout handling)

       

      If it wasn't for the database poll, it looks like multicast would do the job. I've even looked at using pollEnrich with the database call, but that doesn't look like it will work either.

       

      I also need to handle the exception that the database value does not change within a fixed timeout.

       

      Thoughts on the best way to structure a route(s) to handle this scenario?

       

      I am using Camel 2.2.0.

       

      Thanks

        • 1. Re: Strategy advice for correlated route
          davsclaus

          I have thought of adding timeout support for multicast but haven't got around the time to do it. And haven't seen any requests for it.

           

          Sometimes using regular Java is often easy so I would suggest to use a bean for the database work where you can do your own timeout check. For example loop X times and check for that database value changed. Using Spring JDBC is easy to invoke JDBC calls.

          • 2. Re: Strategy advice for correlated route
            scranton_scranton

            Claus,

             

            Thanks for the response.

             

            For this effort, I'm trying to minimize custom code, so I'm going to give the aggregator EIP a try to see if I can use that correctly to correlate my InOut route with a polling db route (using something like a timer).

             

            Thanks again,

            Scott