package com.atomikos.demo;

import org.apache.camel.builder.RouteBuilder;
import org.springframework.stereotype.Component;

/**
 * Demonstrates the use of an XA transaction manager with a JMS component and database.
 */
@Component
public class XATransactionRouteBuilder extends RouteBuilder {

    @Override
    public void configure() {
    	
        from("jms:queue:inbound?transacted=true")
            .transacted("PROPAGATION_REQUIRED")
            .log("Processing message: ${body}")
            .setHeader("message", body())
            .recipientList(header("jms:outbound"))
            .to("mock:out");
    }
}
