You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by James Green <ja...@gmail.com> on 2014/10/07 13:18:12 UTC

Application naivity about endpoints

I want my application to connect to ActiveMQ today, and possibly RabbitMQ
tomorrow. Therefore I do not want anything in code to mention either - it
should just be a matter of altering a .properties file and restarting,
right?

However we're having trouble working out how to do this without expressly
referring to individual connection factories in code.

Are we missing something?

Thanks,

James

Re: Application naivity about endpoints

Posted by Matt Sicker <bo...@gmail.com>.
You should use named endpoint references everywhere instead of literal URIs
in the from/to sections. That way you only need to update a single endpoint
to get all the other endpoint references up to date.

On 7 October 2014 07:04, Christian Schneider <ch...@die-schneider.net>
wrote:

> For a standalone application there is no standard way to make your code
> independent of the jms provider.
> You will have to provide the provider client jars at some point.
>
> Of course you can externalize the class name in some way but you are on
> your own in how to do it.
>
> Christian
>
> On 07.10.2014 13:31, James Green wrote:
>
>> This is a standalone Spring app with Java configuration.
>>
>> On 7 October 2014 12:21, Christian Schneider <ch...@die-schneider.net>
>> wrote:
>>
>>  If you are deploying to a web container then you should refer to the
>>> ConnectionFactory using JNDI. If you are using OSGi you can use an OSGi
>>> service.
>>> This way you avoid making your route bundle depend on the jms provider.
>>>
>>> Christian
>>>
>>>
>>>
> --
> Christian Schneider
> http://www.liquid-reality.de
>
> Open Source Architect
> http://www.talend.com
>
>


-- 
Matt Sicker <bo...@gmail.com>

Re: Application naivity about endpoints

Posted by Christian Schneider <ch...@die-schneider.net>.
For a standalone application there is no standard way to make your code 
independent of the jms provider.
You will have to provide the provider client jars at some point.

Of course you can externalize the class name in some way but you are on 
your own in how to do it.

Christian

On 07.10.2014 13:31, James Green wrote:
> This is a standalone Spring app with Java configuration.
>
> On 7 October 2014 12:21, Christian Schneider <ch...@die-schneider.net>
> wrote:
>
>> If you are deploying to a web container then you should refer to the
>> ConnectionFactory using JNDI. If you are using OSGi you can use an OSGi
>> service.
>> This way you avoid making your route bundle depend on the jms provider.
>>
>> Christian
>>
>>

-- 
Christian Schneider
http://www.liquid-reality.de

Open Source Architect
http://www.talend.com


Re: Application naivity about endpoints

Posted by James Green <ja...@gmail.com>.
This is a standalone Spring app with Java configuration.

On 7 October 2014 12:21, Christian Schneider <ch...@die-schneider.net>
wrote:

> If you are deploying to a web container then you should refer to the
> ConnectionFactory using JNDI. If you are using OSGi you can use an OSGi
> service.
> This way you avoid making your route bundle depend on the jms provider.
>
> Christian
>
>
> On 07.10.2014 13:18, James Green wrote:
>
>> I want my application to connect to ActiveMQ today, and possibly RabbitMQ
>> tomorrow. Therefore I do not want anything in code to mention either - it
>> should just be a matter of altering a .properties file and restarting,
>> right?
>>
>> However we're having trouble working out how to do this without expressly
>> referring to individual connection factories in code.
>>
>> Are we missing something?
>>
>> Thanks,
>>
>> James
>>
>>
>
> --
> Christian Schneider
> http://www.liquid-reality.de
>
> Open Source Architect
> http://www.talend.com
>
>

Re: Application naivity about endpoints

Posted by Christian Schneider <ch...@die-schneider.net>.
If you are deploying to a web container then you should refer to the 
ConnectionFactory using JNDI. If you are using OSGi you can use an OSGi 
service.
This way you avoid making your route bundle depend on the jms provider.

Christian

On 07.10.2014 13:18, James Green wrote:
> I want my application to connect to ActiveMQ today, and possibly RabbitMQ
> tomorrow. Therefore I do not want anything in code to mention either - it
> should just be a matter of altering a .properties file and restarting,
> right?
>
> However we're having trouble working out how to do this without expressly
> referring to individual connection factories in code.
>
> Are we missing something?
>
> Thanks,
>
> James
>


-- 
Christian Schneider
http://www.liquid-reality.de

Open Source Architect
http://www.talend.com