How disable .compensation in the in the previous call camel-router

31 Views Asked by At

If the application crashes in secondeRoute, then compensationFirstRoute is automatically fired, but I need only compensationSecondRoute to fire, how can I fix this

from("direct:mainRoute")
  .saga()
  .propagation(SagaPropagation.MANDATORY)
    .to("direct:firstRoute")
    .to("direct:secondeRoute");
from("direct:firstRoute")
  .saga()
  .propagation(SagaPropagation.MANDATORY)
  .compensation("direct:compensationFirstRoute")
    .bean(creditService, "reserveCredit")
from("direct:secondeRoute")
  .saga()
  .propagation(SagaPropagation.MANDATORY)
  .compensation("direct:compensationSecondRoute")
    .bean(creditService, "reserveCredit")

0

There are 0 best solutions below