1

I have two route A and B as below

from("some endpoint")  //route A
.to("direct:x")

from("direct:x")  //route B
.doTry()
   .bean("somebean")  //set Custom object PQR as message body 
.doCatch()
   .bean("some other bean")  //log exception
.end()

Now I want to invoke route B once route A is complete (already done). Now how to get the response PQR object (only if route B succeeds) back from route B in route A?

Abhishek Chatterjee
  • 1,962
  • 2
  • 23
  • 31

1 Answers1

0

It is supposed to do that automatically. If you chain another to in route A after the to("direct:x") , it will take the response from route B. You can try logging the body after the to("direct:x") and check the result.

Sneharghya Pathak
  • 990
  • 1
  • 9
  • 19