Hi You can use AsyncProcessor and .process instead of the bean, and then use the AsyncCallback to continue routing when you have the result from the web endpoint.
If you do not mind you can likely also add some logic to your bean method that will wait for the web result before you return, but then that thread is waiting/blocking. On Fri, Mar 16, 2018 at 5:16 PM, Marco Westermann <marwesterm...@gmx.de> wrote: > Hi camel riders, > > I have a problem with a route which needs to call a bean but the bean itself > is async (rxjava2) > > My route is created in a vertx verticle using eventbus bridge. > > my route looks like: > > from("direct:process") > > .bean("myProcessor", "process") > > .to("log:bodyAfterProcessing") > > > Now the process method uses vertx webClient async (rxjava2) to call a web > endpoint and then sets the body of the exchange to the result of the call. > > But of cause this does not block the method itself which leads to the route > already continue while the process method does not really finish. > > Is there a solution that I can "wait" for async methods to finish? > > Best regards, > > Marco > > -- Claus Ibsen ----------------- http://davsclaus.com @davsclaus Camel in Action 2: https://www.manning.com/ibsen2