Ghazi Naceur
2018-08-25 17:54:25 UTC
Hello everyone,
I am facing the following issue :
Caused by: org.apache.camel.NoSuchBeanException: No bean could be
found in the registry of type: PlatformTransactionManager
at org.apache.camel.model.TransactedDefinition.doResolvePolicy(TransactedDefinition.java:247)
~[camel-core-2.22.0.jar:2.22.0]
at org.apache.camel.model.TransactedDefinition.resolvePolicy(TransactedDefinition.java:181)
~[camel-core-2.22.0.jar:2.22.0]
at org.apache.camel.model.TransactedDefinition.createProcessor(TransactedDefinition.java:158)
~[camel-core-2.22.0.jar:2.22.0]
at org.apache.camel.model.ProcessorDefinition.makeProcessorImpl(ProcessorDefinition.java:562)
~[camel-core-2.22.0.jar:2.22.0]
at org.apache.camel.model.ProcessorDefinition.makeProcessor(ProcessorDefinition.java:523)
~[camel-core-2.22.0.jar:2.22.0]
at org.apache.camel.model.ProcessorDefinition.addRoutes(ProcessorDefinition.java:239)
~[camel-core-2.22.0.jar:2.22.0]
at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:1343)
~[camel-core-2.22.0.jar:2.22.0]
... 23 common frames omitted
My camel route is :
public void configure() throws Exception {
from("activemq:queue:inbound.endpoint")
.transacted()
.log(LoggingLevel.INFO, log, "Received message")
.process(exchange -> {
LOGGER.info("Exchange : {}", exchange);
})
.process(exchange -> {
Object obj = exchange.getIn().getBody(Object.class);
repository.insertIntoElasticsearch(obj);
})
.to("activemq:queue:outbound.endpoint")
.log(LoggingLevel.INFO, log, "Message sent.")
.end();
}
My code :
CamelContext context = new DefaultCamelContext();
context.addRoutes(new JmsRoute());
ConnectionFactory connectionFactory = new
ActiveMQConnectionFactory("tcp://0.0.0.0:61616");
context.addComponent("jms",
JmsComponent.jmsComponentAutoAcknowledge(connectionFactory));
ProducerTemplate template = context.createProducerTemplate();
context.start();
template.sendBody("activemq:queue:inbound.endpoint", new Person("10",
"firstName","lastName",29, "Occupation"));
My pom.xml file :
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-spring-boot-starter</artifactId>
<version>2.22.0</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-jms</artifactId>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-camel</artifactId>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-client</artifactId>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-broker</artifactId>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-pool</artifactId>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-kahadb-store</artifactId>
</dependency>
I appreciate you help.
I am facing the following issue :
Caused by: org.apache.camel.NoSuchBeanException: No bean could be
found in the registry of type: PlatformTransactionManager
at org.apache.camel.model.TransactedDefinition.doResolvePolicy(TransactedDefinition.java:247)
~[camel-core-2.22.0.jar:2.22.0]
at org.apache.camel.model.TransactedDefinition.resolvePolicy(TransactedDefinition.java:181)
~[camel-core-2.22.0.jar:2.22.0]
at org.apache.camel.model.TransactedDefinition.createProcessor(TransactedDefinition.java:158)
~[camel-core-2.22.0.jar:2.22.0]
at org.apache.camel.model.ProcessorDefinition.makeProcessorImpl(ProcessorDefinition.java:562)
~[camel-core-2.22.0.jar:2.22.0]
at org.apache.camel.model.ProcessorDefinition.makeProcessor(ProcessorDefinition.java:523)
~[camel-core-2.22.0.jar:2.22.0]
at org.apache.camel.model.ProcessorDefinition.addRoutes(ProcessorDefinition.java:239)
~[camel-core-2.22.0.jar:2.22.0]
at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:1343)
~[camel-core-2.22.0.jar:2.22.0]
... 23 common frames omitted
My camel route is :
public void configure() throws Exception {
from("activemq:queue:inbound.endpoint")
.transacted()
.log(LoggingLevel.INFO, log, "Received message")
.process(exchange -> {
LOGGER.info("Exchange : {}", exchange);
})
.process(exchange -> {
Object obj = exchange.getIn().getBody(Object.class);
repository.insertIntoElasticsearch(obj);
})
.to("activemq:queue:outbound.endpoint")
.log(LoggingLevel.INFO, log, "Message sent.")
.end();
}
My code :
CamelContext context = new DefaultCamelContext();
context.addRoutes(new JmsRoute());
ConnectionFactory connectionFactory = new
ActiveMQConnectionFactory("tcp://0.0.0.0:61616");
context.addComponent("jms",
JmsComponent.jmsComponentAutoAcknowledge(connectionFactory));
ProducerTemplate template = context.createProducerTemplate();
context.start();
template.sendBody("activemq:queue:inbound.endpoint", new Person("10",
"firstName","lastName",29, "Occupation"));
My pom.xml file :
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-spring-boot-starter</artifactId>
<version>2.22.0</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-jms</artifactId>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-camel</artifactId>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-client</artifactId>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-broker</artifactId>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-pool</artifactId>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-kahadb-store</artifactId>
</dependency>
I appreciate you help.