May be you are looking for a pipe line? http://camel.apache.org/pipes-and-filters.html
-Shreyas ---------------------------------------- > Date: Wed, 25 Mar 2015 09:48:21 -0700 > From: lance.met...@libertymutual.com > To: users@camel.apache.org > Subject: Help with sequential, synchronous routes > > 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.