You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by ak-dak <ku...@dakosy.de> on 2014/03/11 16:56:32 UTC

Enricher doesn't work with ActiveMQ

Hi all,

I'am using Camel 2.12.1 and three simple camel routes which are connected by
ActiveMQ.
In my second route I try to work with the enricher but the route hangs
before invoking the enricher route.

The enricher works fine if I have hust one camel context, but I want to use
the enricher across several camel contexts and java applications.

I have uploaded a complete Java-Project to reproduce my problem:
http://www14.zippyshare.com/v/34130469/file.html

That are my camel routes:

<?xml version="1.0" encoding="UTF-8"?>

<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
	xmlns:c="http://camel.apache.org/schema/spring"
	xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
	http://camel.apache.org/schema/spring
http://camel.apache.org/schema/spring/camel-spring.xsd
	http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd">


	
	<bean id="jmsConnectionFactory"
class="org.apache.activemq.ActiveMQConnectionFactory">
		<property name="brokerURL"
value="vm://localhost:61616?broker.useJmx=false" />
	</bean>

	<bean id="pooledConnectionFactory"
class="org.apache.activemq.pool.PooledConnectionFactory" init-method="start"
		destroy-method="stop">
		<property name="maxConnections" value="1" />
		<property name="connectionFactory" ref="jmsConnectionFactory" />
	</bean>

	<bean id="jmsConfig"
class="org.apache.camel.component.jms.JmsConfiguration">
		<property name="connectionFactory" ref="pooledConnectionFactory" />
		<property name="transacted" value="true" />
		<property name="concurrentConsumers" value="1" />
		<property name="maxConcurrentConsumers" value="1" />
	</bean>

	<bean id="activemq"
class="org.apache.activemq.camel.component.ActiveMQComponent">
		<property name="configuration" ref="jmsConfig" />
	</bean>

	
	<context:mbean-export server="mBeanServer" />
	<context:mbean-server id="mBeanServer" />

	
	<context:component-scan base-package="beans" />

	
	<context:annotation-config />

	
	<bean class="de.dakosy.pcs.camelTest.Main" />
	<bean id="bean" class="de.dakosy.pcs.camelTest.Bean" />
	<bean id="enrichAggregator"
class="de.dakosy.pcs.camelTest.EnrichAggregator" />

	<c:camelContext id="TestContext">
		<c:route id="TimerRoute">
			<c:from uri="timer://myTimer?fixedRate=true&amp;period=5s" />
			<c:bean ref="bean" method="setBodyText" />
			<c:to uri="activemq:queue:route2"/>
		</c:route>
	</c:camelContext>
	
	<c:camelContext id="TestContext2">
		<c:route id="Route2">
			<c:from uri="activemq:queue:route2"/>
			<c:log message="route2: ${body}" loggingLevel="INFO"/>
			<c:enrich uri="activemq:queue:erichQueue"
strategyRef="enrichAggregator"/>
			<c:log message="after enrich: ${body}" loggingLevel="INFO"/>
		</c:route>
	</c:camelContext>
	
	<c:camelContext id="TestContextEnrich">
		<c:route id="enricherRoute">
			<c:from uri="activemq:queue:erichQueue?exchangePattern=InOut"/>
			<c:log message="enricherTest start route" loggingLevel="INFO"/>
			<c:bean ref="bean" method="newBodyText" />
		</c:route>
	</c:camelContext>

</beans>





--
View this message in context: http://camel.465427.n5.nabble.com/Enricher-doesn-t-work-with-ActiveMQ-tp5748641.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Enricher doesn't work with ActiveMQ

Posted by ak-dak <ku...@dakosy.de>.
Hi all,

has anyone an idea what can I do to solve my problem?

Best Regards



--
View this message in context: http://camel.465427.n5.nabble.com/Enricher-doesn-t-work-with-ActiveMQ-tp5748641p5749346.html
Sent from the Camel - Users mailing list archive at Nabble.com.