Hello,

I was wondering if something I have in mind is possible using Camel.

Our projects needs a route to listen for jms messages, then persist
something to the database in a custom bean using another route and only
continue the first route once the item has been successfully persisted.

I was hoping something like this would work:

<route id="handle-requests">
            <from uri="activemq:incoming-request"/>
            <bean ref="randomBean" method="doSomething"/>
            <to uri="activemq:persist-request"/>
            <bean ref="itemPersistedActivator" method="doSomething"/>
        </route>

        <route id="persist-request">
            <from uri="activemq:persist-request"/>
            <bean ref="requestPersister" method="persistRequest"/>
        </route>

What I need is the itemPersistedActivator bean's method to only be called
when the request has been persisted to the database. I have simulated a
waiting time in the requestPersister (5 seconds). Currently the route
continues as the message has been dispatched.

Any ideas on this?
Thanks




--
View this message in context: 
http://camel.465427.n5.nabble.com/Waiting-for-a-bean-to-finish-before-continuing-route-tp5742398.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to