You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Thorsten Höger <li...@hoegernet.de> on 2011/09/26 09:36:13 UTC

Configuring Camel without modifying the jar

Hi!

Is there a possibility to place the camel-context.xml outside the .jar
file to enable configuring the system without changing the jar package?
The use case is to deploy the same .jar but changing the .xml for
individual customers.

Thanks in advance.
Thorsten Höger


Re: Configuring Camel without modifying the jar

Posted by Thorsten Höger <li...@hoegernet.de>.
Thanks to all!

Adding this to my Spring config did the trick.

<import resource="file:files/eai/context/camel-context.xml" />

Regards,
Thorsten

Am 26.09.2011 09:44, schrieb Łukasz Dywicki:
> Hey Thorsten,
> You may put general import directive in Spring XML configuration file. For example:
>
> <import resource="file*:/var/myproduct/camel.xml" />
>
> Another option is to extract configuration variables to properties and re-use them in camel configuration.
>
> Best regards,
> Lukasz
>
>> Hi!
>>
>> Is there a possibility to place the camel-context.xml outside the .jar
>> file to enable configuring the system without changing the jar package?
>> The use case is to deploy the same .jar but changing the .xml for
>> individual customers.
>>
>> Thanks in advance.
>> Thorsten Höger
>>


Re: Configuring Camel without modifying the jar

Posted by Łukasz Dywicki <lu...@code-house.org>.
Hey Thorsten,
You may put general import directive in Spring XML configuration file. For example:

<import resource="file*:/var/myproduct/camel.xml" />

Another option is to extract configuration variables to properties and re-use them in camel configuration.

Best regards,
Lukasz

> Hi!
> 
> Is there a possibility to place the camel-context.xml outside the .jar
> file to enable configuring the system without changing the jar package?
> The use case is to deploy the same .jar but changing the .xml for
> individual customers.
> 
> Thanks in advance.
> Thorsten Höger
> 


Re: Configuring Camel without modifying the jar

Posted by Claus Ibsen <cl...@gmail.com>.
2011/9/26 Thorsten Höger <li...@hoegernet.de>:
> Am 26.09.2011 09:41, schrieb Claus Ibsen:
>> Hi
>>
>> What version of Camel are you using?
> I'm using Camel version 2.7.2 as a standalone application by using the
> class org.apache.camel.spring.Main.
>

The Main class has options to load from file system. Check out its source code.
https://svn.apache.org/repos/asf/camel/branches/camel-2.7.x/components/camel-spring/src/main/java/org/apache/camel/spring/Main.java
https://svn.apache.org/repos/asf/camel/branches/camel-2.7.x/camel-core/src/main/java/org/apache/camel/impl/MainSupport.java

You can run the Main without any arguments, or with -help to display
the option it supports.


>>
>> And what server/container are you using?
>>
>> But in general the .xml file can be placed on the filesystem, and you
>> can refer to it with the file: prefix.
> Where do I specify this file?
>
> Thanks,
> Thorsten
>>
>>
>> 2011/9/26 Thorsten Höger <li...@hoegernet.de>:
>>> Hi!
>>>
>>> Is there a possibility to place the camel-context.xml outside the .jar
>>> file to enable configuring the system without changing the jar package?
>>> The use case is to deploy the same .jar but changing the .xml for
>>> individual customers.
>>>
>>> Thanks in advance.
>>> Thorsten Höger
>>>
>>>
>>
>>
>
>



-- 
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: Configuring Camel without modifying the jar

Posted by Thorsten Höger <li...@hoegernet.de>.
Am 26.09.2011 09:41, schrieb Claus Ibsen:
> Hi
>
> What version of Camel are you using?
I'm using Camel version 2.7.2 as a standalone application by using the
class org.apache.camel.spring.Main.

>
> And what server/container are you using?
>
> But in general the .xml file can be placed on the filesystem, and you
> can refer to it with the file: prefix.
Where do I specify this file?

Thanks,
Thorsten
>
>
> 2011/9/26 Thorsten Höger <li...@hoegernet.de>:
>> Hi!
>>
>> Is there a possibility to place the camel-context.xml outside the .jar
>> file to enable configuring the system without changing the jar package?
>> The use case is to deploy the same .jar but changing the .xml for
>> individual customers.
>>
>> Thanks in advance.
>> Thorsten Höger
>>
>>
>
>


Re: Configuring Camel without modifying the jar

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

What version of Camel are you using?

And what server/container are you using?

But in general the .xml file can be placed on the filesystem, and you
can refer to it with the file: prefix.


2011/9/26 Thorsten Höger <li...@hoegernet.de>:
> Hi!
>
> Is there a possibility to place the camel-context.xml outside the .jar
> file to enable configuring the system without changing the jar package?
> The use case is to deploy the same .jar but changing the .xml for
> individual customers.
>
> Thanks in advance.
> Thorsten Höger
>
>



-- 
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/