You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by focaldi <fe...@tav.aero> on 2011/12/13 09:21:14 UTC

Deploy Camel project to Activemq

Hi I am using Activemq 5.5.1 and I wanna deploy my camel application what it
is adding dynamic routes and some datasource registry. But I couldnt add
datasources to camel instance that provided by Active MQ. If I would use
"camelContext = new DefaultCamelContext(registry);", I can register to camel
context but then there are two Camel Instance in tomcat server.Am I right?
If I am right then how can I add datasources (JndiRegistry) to camel
instance that provided by Active MQ???Pls help me. Thanks



--
View this message in context: http://camel.465427.n5.nabble.com/Deploy-Camel-project-to-Activemq-tp5070710p5070710.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Deploy Camel project to Activemq

Posted by focaldi <fe...@tav.aero>.
Thanks Willem but I didnt create another camelcontext. Just I want to use
ActiveMQ camelcontext instance. So when I tried to add this context in java
code, I couldnt find like "camelContext.addRegister" command.

--
View this message in context: http://camel.465427.n5.nabble.com/Deploy-Camel-project-to-Activemq-tp5070710p5070765.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Deploy Camel project to Activemq

Posted by focaldi <fe...@tav.aero>.
Thanks Willem, but my config.xml is not spring base config. it is simple
configuration file that it holds some information about application and
route information. I couldnt solve my problem. So I created another Camel
context object and I added my routes to this context object :)...Thanks your
answer.

--
View this message in context: http://camel.465427.n5.nabble.com/Deploy-Camel-project-to-Activemq-tp5070710p5074367.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Deploy Camel project to Activemq

Posted by Willem Jiang <wi...@gmail.com>.
I think you can just put the setting of the datasrouces into your 
config.xml.

On Tue Dec 13 16:41:56 2011, focaldi wrote:
> Thanks Claus, but I am trying to add in ActiveMQ library. And my project has
> a myconfig.xml for configuration and I want to register datasources what
> defined in myconfig.xml to camelcontext. So I cannot use a jndi.properties
> file... May be I couldt explain what is my problem...
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Deploy-Camel-project-to-Activemq-tp5070710p5070785.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Willem
----------------------------------
FuseSource
Web: http://www.fusesource.com
Blog:    http://willemjiang.blogspot.com (English)
         http://jnn.javaeye.com (Chinese)
Twitter: willemjiang 
Weibo: willemjiang 


Re: Deploy Camel project to Activemq

Posted by focaldi <fe...@tav.aero>.
Thanks Claus, but I am trying to add in ActiveMQ library. And my project has
a myconfig.xml for configuration and I want to register datasources what
defined in myconfig.xml to camelcontext. So I cannot use a jndi.properties
file... May be I couldt explain what is my problem...

--
View this message in context: http://camel.465427.n5.nabble.com/Deploy-Camel-project-to-Activemq-tp5070710p5070785.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Deploy Camel project to Activemq

Posted by Claus Ibsen <cl...@gmail.com>.
On Tue, Dec 13, 2011 at 9:32 AM, Willem Jiang <wi...@gmail.com> wrote:
> On Tue Dec 13 16:21:14 2011, focaldi wrote:
>>
>> Hi I am using Activemq 5.5.1 and I wanna deploy my camel application what
>> it
>> is adding dynamic routes and some datasource registry. But I couldnt add
>> datasources to camel instance that provided by Active MQ. If I would use
>> "camelContext = new DefaultCamelContext(registry);", I can register to
>> camel
>> context but then there are two Camel Instance in tomcat server.Am I right?
>
>
> Did you also use spring configuration file to create another the camel
> context?
>
> I will be OK if you there are more than one CamelContext in the ActiveMQ
> instance.
> You just need to make sure the routes don't consumer the same queue.
>
>
>> If I am right then how can I add datasources (JndiRegistry) to camel
>> instance that provided by Active MQ???Pls help me. Thanks
>
>
> You can bind the datasource with a name and instance into the registry.
> If you are using spring configuration, it is easy to setup it in spring.
>

I think you should also be able to drop a jndi.properties in the root
of your classpath, if you deploy Camel as a WAR in tomcat.
And in that jndi.properties you specify the JNDI stuff to link to the
JNDI registry in Tomcat.

Its standard from JNDI. Camel just creates a new InitialContext()


>>
>>
>>
>> --
>> View this message in context:
>> http://camel.465427.n5.nabble.com/Deploy-Camel-project-to-Activemq-tp5070710p5070710.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>
>
>
>
> --
> Willem
> ----------------------------------
> FuseSource
> Web: http://www.fusesource.com
> Blog:    http://willemjiang.blogspot.com (English)
>        http://jnn.javaeye.com (Chinese)
> Twitter: willemjiang Weibo: willemjiang



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Re: Deploy Camel project to Activemq

Posted by Willem Jiang <wi...@gmail.com>.
On Tue Dec 13 16:21:14 2011, focaldi wrote:
> Hi I am using Activemq 5.5.1 and I wanna deploy my camel application what it
> is adding dynamic routes and some datasource registry. But I couldnt add
> datasources to camel instance that provided by Active MQ. If I would use
> "camelContext = new DefaultCamelContext(registry);", I can register to camel
> context but then there are two Camel Instance in tomcat server.Am I right?

Did you also use spring configuration file to create another the camel 
context?

I will be OK if you there are more than one CamelContext in the 
ActiveMQ instance.
You just need to make sure the routes don't consumer the same queue.

> If I am right then how can I add datasources (JndiRegistry) to camel
> instance that provided by Active MQ???Pls help me. Thanks

You can bind the datasource with a name and instance into the registry.
If you are using spring configuration, it is easy to setup it in spring.
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Deploy-Camel-project-to-Activemq-tp5070710p5070710.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Willem
----------------------------------
FuseSource
Web: http://www.fusesource.com
Blog:    http://willemjiang.blogspot.com (English)
         http://jnn.javaeye.com (Chinese)
Twitter: willemjiang 
Weibo: willemjiang