You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by sandp <sa...@gmail.com> on 2014/10/27 13:38:54 UTC

camel-jms consumer 2.14.0 on JBOSS EAP 6.1.1. connectionFactory must be specified

Hi All,
I'm facing an issue with a jms consumer endpoint. The deployment fails due 
with a exception 
*java.lang.IllegalArgumentException: connectionFactory must be specified*

 
The route below fails on startup. However, the jms producer endpoint does
not complain about connection factory.

*JMS Consumer Route============*
from("jms:queue:ctsCamelQueue?transacted=false").id("processFailedRestRequestMessageFromQueue")
			//some processing
 .end();

*JMS Producer Route=============*
.to("jms:queue:ctsCamelQueue?timeToLive={{message.time.to.live}}&forceSendOriginalMessage=true")

The connectionFactory is setup successfully for the jms component in the
camel registry, as shown below.
*===Registry===============*
	registry.put("jms", 
JmsComponent.jmsComponent(CamelJMSConnectionFactory.createHornetQJmsConfiguration()));

public static JmsConfiguration createHornetQJmsConfiguration() throws
NamingException, HornetQException{
		JmsConfiguration jmsConfiguration = new JmsConfiguration();
		hornetQContext = getInitialContext();
		HornetQQueue hornetQQueue = (HornetQQueue)
hornetQContext.lookup(JMSConstants.HORNETQ_QUEUE_LOOKUP_PATH);
		if (logger.isDebugEnabled()) {
			logger.debug(" Connection was successfully established to queue " +
hornetQQueue.getName() + " Address: " + hornetQQueue.getAddress());
		}
	
jmsConfiguration.setConnectionFactory((ConnectionFactory)hornetQConnectionFactory);
		return jmsConfiguration;
	}

Am I missing anything?



--
View this message in context: http://camel.465427.n5.nabble.com/camel-jms-consumer-2-14-0-on-JBOSS-EAP-6-1-1-connectionFactory-must-be-specified-tp5758089.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: camel-jms consumer 2.14.0 on JBOSS EAP 6.1.1. connectionFactory must be specified

Posted by sandp <sa...@gmail.com>.
Not sure what the problem is, after a couple of refreshes and builds it
worked. Looks like a environment related issue (Eclipse, Maven)



--
View this message in context: http://camel.465427.n5.nabble.com/camel-jms-consumer-2-14-0-on-JBOSS-EAP-6-1-1-connectionFactory-must-be-specified-tp5758089p5758108.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: camel-jms consumer 2.14.0 on JBOSS EAP 6.1.1. connectionFactory must be specified

Posted by sandp <sa...@gmail.com>.
It works when I add the *connectionFactory* option to the route, but my
question is even though the jms component is initialized with
JmsConfiguration containing the ConnectionFactory, why is the consumer
expecting the connectionFactory option on the endpoint again?

=======Consumer Route=========
from("jms:queue:ctsCamelQueue?transacted=false&connectionFactory=hornetQConnectionFactory").id("processFailedRestRequestMessageFromQueue")
//some processing
		 .end();



--
View this message in context: http://camel.465427.n5.nabble.com/camel-jms-consumer-2-14-0-on-JBOSS-EAP-6-1-1-connectionFactory-must-be-specified-tp5758089p5758094.html
Sent from the Camel - Users mailing list archive at Nabble.com.