public void configure()

in saga/saga-train-service/src/main/java/org/apache/camel/example/saga/TrainRoute.java [25:39]


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