Hi,

I working on camel-saga route which have similar to below.
Regardless if the transaction is failed and get compensated, how do i get
the detail of the error that catch?
i try to use options to get the CamelExceptionCaught but seem saga is
creating new exchange and old exchange is not being copy over.

is that any way to get the exception detail?

from("direct:start")
    .saga()
    .to("direct:order")
    .to("direct:payment");

from("direct:order")
    .to("http://localhost:8000/order?orderid=100";)
    .log("payment done");

from("direct:payment")
    .saga()
    .propagation(SagaPropagation.MANDATORY)
    .compensation("direct:cancelOrder")
    .completion("direct:notification")
    .to("http://localhost:8000/payment?payment=100";)

from("direct:cancelOrder")
    .to("http://localhost:8000/cancelOrder?orderid=100";)
    .to("direct:notification")

from(" direct:notification  ")
     .process(e->{
        // get the exception detail if transaction failed as msg
     })
    .to("http://localhost:8000/notification?status=${status}&msg=${msg}";)






Thanks and Regards,
Chio Chuan

Reply via email to