Hi

You can use control bus to control routes
http://camel.apache.org/controlbus

And related to that would be route policy
http://camel.apache.org/routepolicy.html



On Wed, Mar 25, 2015 at 5:48 PM, lancemethot
<lance.met...@libertymutual.com> wrote:
> Greetings,
>
> I am new to Camel, so forgive me if my terminology is not correct.
>
> I have a process that must perform the following work:
>
> - process 'new users'
> - process 'new customers'
> - process relationships between users and customers
>
> Processing relationships will fail unless the users and customers have
> already been processed.
>
> I have implemented the above using three separate Camel routes and the
> mybatis interface. An example route is:
>
>  from("mybatis:fetchUserUpdates"+
>     "?statementType=SelectList"+
>     "&consumer.useIterator=true"+
>     "&consumer.routeEmptyResultSet=false"+
>     "&consumer.onConsume=updateLastUserProcessed"+
>     "&delay=5m")
>    .setHeader("TransmissionIdentifier", simple("${body?.getmUUID}"))
>    .marshal(cdf)
>    .to("file:/request/"+
>       "?fileName=Request-${header.TransmissionIdentifier}.xml"+
>       "&doneFileName=${file:name}.{{trigger.extension}}"+
>       "&autoCreate=true"+
>       "&fileExist=Override")
>    .end();
>
> The customer and relationship routes are similar.
>
> I am only able to make use of mybatis consumer.useIterator and
> consumer.onConsume attributes if mybatis is invoked in the "from" method.
> These didn't seem to work when called from to()... which makes sense to me.
> I really like consumer.useIterator and consumer.onConsume, as it
> considerably simplifies the code.
>
> But how can I chain these three separate routes so that they process
> sequentially and synchronously? They are each firing on independent delays
> and there is no guarantee that the user and customer information is
> processed before relationships.
>
> I looked into direct() but didn't have much luck. Is there another way to
> define route dependencies or to chain producers?
>
>
> Thanks,
> Lance
>
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Help-with-sequential-synchronous-routes-tp5764776.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cib...@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/

Reply via email to