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: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.

Christian

-----Ursprüngliche Nachricht-----
Von: Roshan A. Punnoose [mailto:rpunnoose@proteuseng.com] 
Gesendet: Donnerstag, 17. Februar 2011 23:08
An: users@camel.apache.org
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:

"myjms:topic:heartBeatWithCounts?connectionFactoryName=javax.jms.ConnectionFactory"

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.

Roshan
________________________________________
From: Christian Schneider [cschneider@talend.com]
Sent: Thursday, February 17, 2011 5:06 PM
To: users@camel.apache.org
Subject: AW: Camel Osgi JMS

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

--
Follow this link to mark it as spam:
http://mailfilter.proteus-technologies.com/cgi-bin/learn-msg.cgi?id=ECEF027DF1.A1454



Mime
View raw message