Hi Erik, This is a known issue https://issues.apache.org/jira/browse/CAMEL-17474 and it will be fixed in the coming release of 3.14.2 and 3.16.0.
On Thu, Mar 3, 2022 at 7:20 AM Erik Svendsen <e...@lyngsoesystems.com.invalid> wrote: > I have encountered the following issue when I updated from camel-3.12.0 to > camel-3.13.0 (and all newer releases) > > If a transactional route calls another route using "direct:" and this > route contains a split(), the route never completes. > The last log in "route2" is never written, and the context never stops. > > Regards > Erik Svendsen > Lead Architect > > package camel.test; > import java.util.Arrays; > import org.apache.camel.CamelContext; > import org.apache.camel.ProducerTemplate; > import org.apache.camel.builder.RouteBuilder; > import org.apache.camel.impl.DefaultCamelContext; > import org.springframework.transaction.PlatformTransactionManager; > import org.springframework.transaction.TransactionDefinition; > import org.springframework.transaction.TransactionException; > import org.springframework.transaction.TransactionStatus; > import org.springframework.transaction.support.SimpleTransactionStatus; > > public class CamelTest { > > public static void main(String[] args) throws Exception { > try (CamelContext context = new DefaultCamelContext()) { > context.getRegistry().bind("transactionManager", > createTransactionManager()); > context.addRoutes(createRoute()); > ProducerTemplate template = context.createProducerTemplate(); > context.start(); > // Works in 3.12.0 but not in 3.13.0 > template.sendBody("direct:route1", Arrays.asList("A", "B")); > // Works in a versions > // template.sendBody("direct:route3", Arrays.asList("A","B")); > } > } > > public static RouteBuilder createRoute() { > return new RouteBuilder() { > @Override > public void configure() throws Exception { > from("direct:route1") > .transacted() > .to("direct:route2"); > from("direct:route2") > .log("before: ${body}") > .split(body()) > .log("split: ${body}") > .end() > .log("after: ${body}"); > > from("direct:route3") > .transacted() > .log("before: ${body}") > .split(body()) > .log("split: ${body}") > .end() > .log("after: ${body}"); > } > }; > } > > public static PlatformTransactionManager createTransactionManager() { > return new PlatformTransactionManager() { > @Override > public TransactionStatus getTransaction(TransactionDefinition definition) > throws TransactionException { > return new SimpleTransactionStatus(); > } > @Override > public void commit(TransactionStatus status) throws TransactionException { > } > @Override > public void rollback(TransactionStatus status) throws TransactionException > { > } > }; > } > } > > > Erik Svendsen > Lead Architect > Lyngsoe Systems > > Erik Svendsen > Lead Architect > D: *+45 9698 0926* <+45%209698%200926> > M: *+45 2320 2630* <+45%202320%202630> > E: *e...@lyngsoesystems.com* <e...@lyngsoesystems.com> > W: *www.lyngsoesystems.com* <https://www.lyngsoesystems.com/> > <https://www.lyngsoesystems.com/> > <https://www.linkedin.com/company/lyngsoe-systems> > <https://twitter.com/lyngsoesystems> > <https://www.facebook.com/LyngsoeSystems/> > <https://www.youtube.com/channel/UCiQL1sYj3CpmgGAN5VeLKOQ> > This email is subject to our Company *E-mail Terms and Conditions* > <https://lyngsoesystems.com/privacy-policy/> >