saga/saga-train-service/src/main/java/org/apache/camel/example/saga/TrainRoute.java [28:42]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    public void configure() throws Exception {
        from("jms:queue:{{example.services.train}}")
            .saga()
                .propagation(SagaPropagation.MANDATORY)
                .option("id", header("id"))
                .compensation("direct:cancelPurchase")
                .log("Buying train #${header.id}")
                .to("jms:queue:{{example.services.payment}}?exchangePattern=InOut" +
                        "&replyTo={{example.services.payment}}.train.reply")
                .log("Payment for train #${header.id} done with transaction ${body}")
            .end();

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



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");
    }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



