public void configure()

in saga/saga-flight-service/src/main/java/org/apache/camel/example/saga/FlightRoute.java [28:42]


    public void configure() throws Exception {
        from("jms:queue:{{example.services.flight}}")
            .saga()
                .propagation(SagaPropagation.MANDATORY)
                .option("id", header("id"))
                .compensation("direct:cancelPurchase")
                .log("Buying flight #${header.id}")
                .to("jms:queue:{{example.services.payment}}?exchangePattern=InOut" +
                        "&replyTo={{example.services.payment}}.flight.reply")
                .log("Payment for flight #${header.id} done with transaction ${body}")
            .end();

        from("direct:cancelPurchase")
                .log("Flight purchase #${header.id} has been cancelled due to payment failure");
    }