camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Schneider <>
Subject AW: Camel Osgi JMS
Date Thu, 17 Feb 2011 22:15:37 GMT
Hi Roshan,

may I ask what you want to achieve by setting the connection factory from the url?
If you only want to use several connection factories at the same time you can simply create
several jms components with different names.


-----Ursprüngliche Nachricht-----
Von: Roshan A. Punnoose [] 
Gesendet: Donnerstag, 17. Februar 2011 23:08
Betreff: RE: Camel Osgi JMS

Yeah, that's what I expected. Thanks! I think that last solution would work in the short term,
but I also created a component that added a "connectionFactoryName" parameter, so now my string
looks like:


Where it looks up the ConnectionFactory in the camel registry (aka the osgi service registry)

Works for now, but we'll see. 

Thanks for all your help guys.

From: Christian Schneider []
Sent: Thursday, February 17, 2011 5:06 PM
Subject: AW: Camel Osgi JMS

Hi Roshan,

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

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"/>
               <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


-----Ursprüngliche Nachricht-----
Von: Roshan A. Punnoose []
Gesendet: Donnerstag, 17. Februar 2011 21:40
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:


Follow this link to mark it as spam:

View raw message