camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Wang Yan <wyan...@gmail.com>
Subject I could not use .transacted() in camel route with SpringBoot, got exception
Date Thu, 07 Mar 2019 20:46:40 GMT
I could not use  .transacted() in camel route with SpringBoot, got exception
No bean could be found in the registry of type: PlatformTransactionManager"
Is it expected behavior for SpringBoot+Camel setup?

below is example of the code

https://github.com/apache/camel/blob/master/components/camel-spring/src/test/java/org/apache/camel/spring/processor/JavaDslTransactedNoTXManagerTest.java



public class JavaDslTransactedNoTXManagerTest extends ContextTestSupport {
@Test
public void testTransactedNoTXManager() throws Exception {
context.addRoutes(new RouteBuilder() {
@Override
public void configure() throws Exception {
from("direct:start")
.transacted()
.to("mock:result");
}
});
try {
context.start();
fail("Should have thrown an exception");
} catch (FailedToCreateRouteException e) {
NoSuchBeanException cause = assertIsInstanceOf(NoSuchBeanException.class, e.
getCause());
assertEquals("No bean could be found in the registry of type:
PlatformTransactionManager", cause.getMessage());
}
}
@Override
public boolean isUseRouteBuilder() {
return false;
}
}

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message