Reputation: 1610
I am trying to use AMQP queues as both the start and end of a route. I am having trouble getting this to work, following the example at http://camel.apache.org/amqp.html
Could someone please point me in the right direction?
I am deploying this in a blueprint container in karaf.
My setup is:
<bean id="amqpConnectionFactory"
class="org.apache.qpid.amqp_1_0.jms.impl.ConnectionFactoryImpl"
factory-method="createFromURL">
<argument value="${IssBroker.url}" />
</bean>
<bean id="amqpConnection"
class="org.apache.camel.component.jms.JmsComponent" >
<property name="connectionFactory" ref="amqpConnectionFactory"/>
</bean>
...
<route>
<from uri="amqp:{{IssFrom.queue}}"/>
<process ref="issPreprocessor"/>
<unmarshal ref="IssRequest"/>
<process ref="webServiceProcessor"/>
<to uri="webService"/>
<process ref="packageWebServiceReplyForIss"/>
<to uri="amqp:{{IssTo.queue}}"/>
</route>
When I start this in karaf I get:
2015-10-08 13:34:00,968 | ERROR | nsole user karaf | BlueprintCamelContext | 109 - org.apache.camel.camel-blueprint - 2.15.3 | Error occurred during starting Camel: CamelContext(myCamelContext) due connectionFactory must be specified
java.lang.IllegalArgumentException: connectionFactory must be specified
at org.apache.camel.util.ObjectHelper.notNull(ObjectHelper.java:293)
at org.apache.camel.component.jms.JmsConfiguration.createConnectionFactory(JmsConfiguration.java:1131)
at org.apache.camel.component.jms.JmsConfiguration.getConnectionFactory(JmsConfiguration.java:485)
at org.apache.camel.component.jms.JmsConfiguration.createListenerConnectionFactory(JmsConfiguration.java:1140)
at org.apache.camel.component.jms.JmsConfiguration.getListenerConnectionFactory(JmsConfiguration.java:504)
at org.apache.camel.component.jms.JmsConfiguration.configureMessageListenerContainer(JmsConfiguration.java:967)
at org.apache.camel.component.jms.JmsConfiguration.createMessageListenerContainer(JmsConfiguration.java:448)
at org.apache.camel.component.jms.JmsEndpoint.createMessageListenerContainer(JmsEndpoint.java:184)
at org.apache.camel.component.jms.JmsEndpoint.createConsumer(JmsEndpoint.java:179)
at org.apache.camel.component.jms.JmsEndpoint.createConsumer(JmsEndpoint.java:71)
...
Upvotes: 1
Views: 1140
Reputation: 756
Seems like your amqpConnectionFactory bean is ending up null, one of the reasons for that would be that your IssBroker.url property is null or malformed. Have you got this property overridden in your karaf container?
You've given your JmsComponent the id amqpConnection and then used amqp:${{IssFrom.queue}}
change the id to amqp or change the component used in the route to amqpConnection:${{IssFrom.queue}}
Upvotes: 2