You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by helander <le...@gmail.com> on 2012/07/09 02:27:50 UTC

Define JMS component in separate blueprint

I am using Camel and in some routes JMS are used to send messages to an
external broker.
The routes are defined in blueprint files ( xml files) and they all refer to
the same broker, so I would like to have the broker definition in a separate
blueprint file.

Is this possible? How do you do it?

/Lars

--
View this message in context: http://karaf.922171.n3.nabble.com/Define-JMS-component-in-separate-blueprint-tp4025178.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Define JMS component in separate blueprint

Posted by Freeman Fang <fr...@gmail.com>.
Hi,

That broker expose javax.jms.ConnectionFactory as OSGi service, so in  
your camel router blueprint bundle, you can refer that OSGi service.

Freeman
On 2012-7-9, at 下午3:22, helander wrote:

> How can I refer to this particular broker in my Camel route  
> blueprints?
>
> /Lars
>
>
> Freeman-2 wrote
>>
>> Hi,
>>
>> Yeah, it's possible. For an instance in Servicemix we have etc/
>> activemq-broker.xml blueprint file to define an Activemq broker, you
>> may need take a look.
>>
>> Though the Servicemix etc/activemq-broker.xml use embeded broker,  
>> it's
>> quite straightforward to configure an external broker
>> You just need remove <broker.....>... </broker> bean from etc/ 
>> activemq-
>> broker.xml
>> Also you need revise
>> <bean id="activemqConnectionFactory"
>> class="org.apache.activemq.ActiveMQConnectionFactory">
>>          <property name="brokerURL" value="vm://default?
>> create=false&amp;waitForStart=10000" />
>> </bean>
>> change
>> <property name="brokerURL" value="vm://default?
>> create=false&amp;waitForStart=10000" />
>> to
>> <property name="brokerURL" value="the external broker url you  
>> have" />
>>
>> Freeman
>> On 2012-7-9, at 上午8:27, helander wrote:
>>
>>> I am using Camel and in some routes JMS are used to send messages to
>>> an
>>> external broker.
>>> The routes are defined in blueprint files ( xml files) and they all
>>> refer to
>>> the same broker, so I would like to have the broker definition in a
>>> separate
>>> blueprint file.
>>>
>>> Is this possible? How do you do it?
>>>
>>> /Lars
>>>
>>> --
>>> View this message in context:
>>> http://karaf.922171.n3.nabble.com/Define-JMS-component-in-separate-blueprint-tp4025178.html
>>> Sent from the Karaf - User mailing list archive at Nabble.com.
>>
>> ---------------------------------------------
>> Freeman Fang
>>
>> FuseSource
>> Email:ffang@
>> Web: fusesource.com
>> Twitter: freemanfang
>> Blog: http://freemanfang.blogspot.com
>> http://blog.sina.com.cn/u/1473905042
>> weibo: http://weibo.com/u/1473905042
>>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/Define-JMS-component-in-separate-blueprint-tp4025178p4025180.html
> Sent from the Karaf - User mailing list archive at Nabble.com.

---------------------------------------------
Freeman Fang

FuseSource
Email:ffang@fusesource.com
Web: fusesource.com
Twitter: freemanfang
Blog: http://freemanfang.blogspot.com
http://blog.sina.com.cn/u/1473905042
weibo: http://weibo.com/u/1473905042











Re: Define JMS component in separate blueprint

Posted by helander <le...@gmail.com>.
How can I refer to this particular broker in my Camel route blueprints?

/Lars


Freeman-2 wrote
> 
> Hi,
> 
> Yeah, it's possible. For an instance in Servicemix we have etc/ 
> activemq-broker.xml blueprint file to define an Activemq broker, you  
> may need take a look.
> 
> Though the Servicemix etc/activemq-broker.xml use embeded broker, it's  
> quite straightforward to configure an external broker
> You just need remove <broker.....>... </broker> bean from etc/activemq- 
> broker.xml
> Also you need revise
> <bean id="activemqConnectionFactory"  
> class="org.apache.activemq.ActiveMQConnectionFactory">
>           <property name="brokerURL" value="vm://default? 
> create=false&amp;waitForStart=10000" />
> </bean>
> change
> <property name="brokerURL" value="vm://default? 
> create=false&amp;waitForStart=10000" />
> to
> <property name="brokerURL" value="the external broker url you have" />
> 
> Freeman
> On 2012-7-9, at 上午8:27, helander wrote:
> 
>> I am using Camel and in some routes JMS are used to send messages to  
>> an
>> external broker.
>> The routes are defined in blueprint files ( xml files) and they all  
>> refer to
>> the same broker, so I would like to have the broker definition in a  
>> separate
>> blueprint file.
>>
>> Is this possible? How do you do it?
>>
>> /Lars
>>
>> --
>> View this message in context:
>> http://karaf.922171.n3.nabble.com/Define-JMS-component-in-separate-blueprint-tp4025178.html
>> Sent from the Karaf - User mailing list archive at Nabble.com.
> 
> ---------------------------------------------
> Freeman Fang
> 
> FuseSource
> Email:ffang@
> Web: fusesource.com
> Twitter: freemanfang
> Blog: http://freemanfang.blogspot.com
> http://blog.sina.com.cn/u/1473905042
> weibo: http://weibo.com/u/1473905042
> 


--
View this message in context: http://karaf.922171.n3.nabble.com/Define-JMS-component-in-separate-blueprint-tp4025178p4025180.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Define JMS component in separate blueprint

Posted by Freeman Fang <fr...@gmail.com>.
Hi,

Yeah, it's possible. For an instance in Servicemix we have etc/ 
activemq-broker.xml blueprint file to define an Activemq broker, you  
may need take a look.

Though the Servicemix etc/activemq-broker.xml use embeded broker, it's  
quite straightforward to configure an external broker
You just need remove <broker.....>... </broker> bean from etc/activemq- 
broker.xml
Also you need revise
<bean id="activemqConnectionFactory"  
class="org.apache.activemq.ActiveMQConnectionFactory">
          <property name="brokerURL" value="vm://default? 
create=false&amp;waitForStart=10000" />
</bean>
change
<property name="brokerURL" value="vm://default? 
create=false&amp;waitForStart=10000" />
to
<property name="brokerURL" value="the external broker url you have" />

Freeman
On 2012-7-9, at 上午8:27, helander wrote:

> I am using Camel and in some routes JMS are used to send messages to  
> an
> external broker.
> The routes are defined in blueprint files ( xml files) and they all  
> refer to
> the same broker, so I would like to have the broker definition in a  
> separate
> blueprint file.
>
> Is this possible? How do you do it?
>
> /Lars
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/Define-JMS-component-in-separate-blueprint-tp4025178.html
> Sent from the Karaf - User mailing list archive at Nabble.com.

---------------------------------------------
Freeman Fang

FuseSource
Email:ffang@fusesource.com
Web: fusesource.com
Twitter: freemanfang
Blog: http://freemanfang.blogspot.com
http://blog.sina.com.cn/u/1473905042
weibo: http://weibo.com/u/1473905042