@Override
protected RouteBuilder createRouteBuilder() {
return new SpringRouteBuilder() {
public void configure() {
Policy requried = new SpringTransactionPolicy(bean(TransactionTemplate.class, "PROPAGATION_REQUIRED"));
Policy notsupported = new SpringTransactionPolicy(bean(TransactionTemplate.class, "PROPAGATION_NOT_SUPPORTED"));
Policy requirenew = new SpringTransactionPolicy(bean(TransactionTemplate.class, "PROPAGATION_REQUIRES_NEW"));
Policy rollback = new Policy() {
public Processor wrap(Processor processor) {
return new DelegateProcessor(processor) {
@Override
public void process(Exchange exchange) throws Exception {
processNext(exchange);
throw new RuntimeException("rollback");
}
@Override
public String toString() {
return "rollback(" + getProcessor() + ")";
}
};
}
};
Policy catchRollback = new Policy() {
public Processor wrap(Processor processor) {
return new DelegateProcessor(processor) {
@Override
public void process(Exchange exchange) {
try {