camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Schneider <cschnei...@talend.com>
Subject AW: Camel Osgi JMS
Date Thu, 17 Feb 2011 22:06:14 GMT
Hi Roshan,

I don´t think you can reference the connectionfactory from the endpoint url. I may be wrong
though.

What you can easily do is set up a jms component in spring and reference the connectionfactory
through a service reference.
Perhaps this is already what you need:

	<bean id="jms" class="org.apache.camel.component.jms.JmsComponent">
		<property name="connectionFactory" ref="connectionFactory"/>
	</bean>
               <reference id=" connectionFactory " interface="javax.jms.ConnectionFactory"/>

If you don´t want to use spring for it you can do the same in java:

JmsComponent jmsComponent = new JmsComponent();
jmsComponent.setConnectionFactory(cf);
camelContext.addComponent("jms", jmsComponent);

You will only have to retrieve the connection factory from a service tracker or the camel
registry.

Christian


-----Ursprüngliche Nachricht-----
Von: Roshan A. Punnoose [mailto:rpunnoose@proteuseng.com] 
Gesendet: Donnerstag, 17. Februar 2011 21:40
An: users@camel.apache.org
Betreff: Camel Osgi JMS

Usually we use spring to set up the camel jms component before using, but I wanted to know
if it is possible to reference any bean in the camel registry by name for the connectionFactory.

For example, let's say that I have the jms connection factory exposed as an osgi service in
my container. Thanks to camel, I can actually search the osgi service registry with my camel
registry by just asking for any bean with name "javax.jms.ConnectionFactory". That will return
the first JMS Connection Factory as a bean from teh camel/osgi registry. Is there anyway in
the camel-jms component to do something where I can refer to that connection factory instead
of writing up a spring configuration to do the same?

Something like:
from("jms:topic:heartBeatWithCounts?connectionFactory=javax.jms.ConnectionFactory")

Roshan

Mime
View raw message