In our project we are trying to use the camel dsl to help non programmers write 
simple groovy route builders that will be used to build routes and do 
processing. If it was just for me, it would be really easy to set up the 
JmsComponent, but I'd like these non-programmers to just type 
"jms:topic:something" and start receiving data because the underlying osgi 
container includes a ConnectionFactory as a service. 

Lofty goal, I know, but I think it is possible. Currently the JmsComponent does 
a search (I believe) of all ConnectionFactories in a spring context 
(applicationContext), and it would be pretty easy to get that switched over to 
the registry, especially because in the camel osgi registry, I love this, we 
can just use the interface name to retrieve the osgi service from the registry.

I think the camel dsl is so simple to use and code completion makes it even 
easier, so I'd like to stick to that if at all possible.

Short answer, it's for people who don't really know how to code, so the more I 
can do in the url or component the better.

Roshan
________________________________________
From: Christian Schneider [[email protected]]
Sent: Thursday, February 17, 2011 5:15 PM
To: [email protected]
Subject: AW: Camel Osgi JMS

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:[email protected]]
Gesendet: Donnerstag, 17. Februar 2011 23:08
An: [email protected]
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 [[email protected]]
Sent: Thursday, February 17, 2011 5:06 PM
To: [email protected]
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:[email protected]]
Gesendet: Donnerstag, 17. Februar 2011 21:40
An: [email protected]
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



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


Reply via email to