You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Hossein <ma...@csc.com> on 2010/10/07 13:16:14 UTC

property-placeholder and classpath

Hello,

Environment: fuse 4.2 sp1 (camel 2.2)

I am using the following in my spring config file load properties and it
works with no problem. However, I was under assumption that when my bundles
are deployed into SMX, if I place a new version of of my properties file
(integration.properties) into SMX home/etc folder, the new file will be
picked up, BUT it does not.

[1] <context:property-placeholder
location="classpath:integration.properties"/>

Question1: is there anyway to change [1] so that an updated  properties file
would be picked up by the spring my config file? 

Question2: Can [1] be changed so that it will load from a folder rather than
classpath?

Thanks,
Hossein Amerkashi


-- 
View this message in context: http://camel.465427.n5.nabble.com/property-placeholder-and-classpath-tp3202843p3202843.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: property-placeholder and classpath

Posted by Guillaume Nodet <gn...@gmail.com>.
FWIW, you may want to try with blueprint instead of spring-dm (the camel
schema is the same, so migration is really easy) and you should be able to
leverage property placeholders fully (they are similar to the spring ones).

On Fri, Oct 8, 2010 at 06:11, Claus Ibsen <cl...@gmail.com> wrote:

> On Fri, Oct 8, 2010 at 1:34 AM, Hossein <ma...@csc.com> wrote:
> >
> > Using file instead of classpath worked-out great and I can just refresh
> the
> > bundle so that it will reload the new property file.
> >
>
> Great.
>
> > Follow-up to that, we have a camel route (bundle) that is that invokes a
> > camel cxf andd is completely in spring dsl and I can't really change that
> to
> > java dsl. I would also like to have that use properties so that
> information
> > such as address or aFolderName [1] can be specified in property file. Any
> > recommendation on how to use placeholders in a spring dsl?
> >
> > e.g.
> >        <route>
> >            <from uri="file:/tmp/aFolderName?delete=true" />  [1]
> >            <to uri="someUri"/>
> >            <to uri="cxf:bean:someservice"/>
> >            <to uri="anotherUri"/>
> >        </route>
> >
>
> Yeah check this FAQ
>
> http://camel.apache.org/how-do-i-use-spring-property-placeholder-with-camel-xml.html
>
>
>
> > --
> > View this message in context:
> http://camel.465427.n5.nabble.com/property-placeholder-and-classpath-tp3202843p3203866.html
> > Sent from the Camel - Users mailing list archive at Nabble.com.
> >
>
>
>
> --
> Claus Ibsen
> Apache Camel Committer
>
> Author of Camel in Action: http://www.manning.com/ibsen/
> Open Source Integration: http://fusesource.com
> Blog: http://davsclaus.blogspot.com/
> Twitter: http://twitter.com/davsclaus
>



-- 
Cheers,
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/
------------------------
Open Source SOA
http://fusesource.com

Re: property-placeholder and classpath

Posted by Claus Ibsen <cl...@gmail.com>.
On Fri, Oct 8, 2010 at 1:34 AM, Hossein <ma...@csc.com> wrote:
>
> Using file instead of classpath worked-out great and I can just refresh the
> bundle so that it will reload the new property file.
>

Great.

> Follow-up to that, we have a camel route (bundle) that is that invokes a
> camel cxf andd is completely in spring dsl and I can't really change that to
> java dsl. I would also like to have that use properties so that information
> such as address or aFolderName [1] can be specified in property file. Any
> recommendation on how to use placeholders in a spring dsl?
>
> e.g.
>        <route>
>            <from uri="file:/tmp/aFolderName?delete=true" />  [1]
>            <to uri="someUri"/>
>            <to uri="cxf:bean:someservice"/>
>            <to uri="anotherUri"/>
>        </route>
>

Yeah check this FAQ
http://camel.apache.org/how-do-i-use-spring-property-placeholder-with-camel-xml.html



> --
> View this message in context: http://camel.465427.n5.nabble.com/property-placeholder-and-classpath-tp3202843p3203866.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Claus Ibsen
Apache Camel Committer

Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Re: property-placeholder and classpath

Posted by Hossein <ma...@csc.com>.
Using file instead of classpath worked-out great and I can just refresh the
bundle so that it will reload the new property file.

Follow-up to that, we have a camel route (bundle) that is that invokes a
camel cxf andd is completely in spring dsl and I can't really change that to
java dsl. I would also like to have that use properties so that information
such as address or aFolderName [1] can be specified in property file. Any
recommendation on how to use placeholders in a spring dsl?

e.g.
        <route>
            <from uri="file:/tmp/aFolderName?delete=true" />  [1]
            <to uri="someUri"/>
            <to uri="cxf:bean:someservice"/>
            <to uri="anotherUri"/>
        </route> 

-- 
View this message in context: http://camel.465427.n5.nabble.com/property-placeholder-and-classpath-tp3202843p3203866.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: property-placeholder and classpath

Posted by Claus Ibsen <cl...@gmail.com>.
On Thu, Oct 7, 2010 at 4:10 PM, Hossein <ma...@csc.com> wrote:
>
> Ok, will definitely give that a try.
> Meanwhile, per original post, can I use file: instead of classpath in [1] ?
>
> [1] <context:property-placeholder
> location="classpath:integration.properties"/>
>

Yeah I think so. Isn't this the Spring property placeholder? You can
check the spring documentation what they support. But I think they
generally support using
- classpath:
- file:
- http:

where classpath: is the default if omitted.


> Thanks
> Hossein Amerkashi
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/property-placeholder-and-classpath-tp3202843p3203107.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Claus Ibsen
Apache Camel Committer

Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Re: property-placeholder and classpath

Posted by Hossein <ma...@csc.com>.
Ok, will definitely give that a try.
Meanwhile, per original post, can I use file: instead of classpath in [1] ?

[1] <context:property-placeholder
location="classpath:integration.properties"/> 

Thanks
Hossein Amerkashi

-- 
View this message in context: http://camel.465427.n5.nabble.com/property-placeholder-and-classpath-tp3202843p3203107.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: property-placeholder and classpath

Posted by Hossein <ma...@csc.com>.
Hi Ade,

I haven't, but I believe there is a JIRA against this. Also, not sure if
that alternative would work with fuse 4.2 sp1

-Hossein Amerkashi

-- 
View this message in context: http://camel.465427.n5.nabble.com/property-placeholder-and-classpath-tp3202843p3202968.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: property-placeholder and classpath

Posted by Adrian Trenaman <tr...@progress.com>.
  Hi Hossein,

Sorry for coming in late on this topic. Have you tried just using a 
Spring PropertyPlaceHolder configurer? Then, if you're deploying into 
ServiceMix, you can just use ${karaf.home}/etc/my.properties in one of 
the locations.

/Ade

On 07/10/2010 13:11, Hossein wrote:
> Thanks Claus. It seems an awful lot to go through to make OSGify this. Is
> there anyway to load properties from a folder rather than classpath? If this
> is possible, atleast I can just stop, start bundle so that it would pick-up
> the new properties file.
>
> Does camel 2.3 work differently or is it same concept?
>
> Thanks
> Hossein

Re: property-placeholder and classpath

Posted by Hossein <ma...@csc.com>.
Thanks Claus. It seems an awful lot to go through to make OSGify this. Is
there anyway to load properties from a folder rather than classpath? If this
is possible, atleast I can just stop, start bundle so that it would pick-up
the new properties file.

Does camel 2.3 work differently or is it same concept?

Thanks
Hossein
-- 
View this message in context: http://camel.465427.n5.nabble.com/property-placeholder-and-classpath-tp3202843p3202906.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: property-placeholder and classpath

Posted by Claus Ibsen <cl...@gmail.com>.
On Thu, Oct 7, 2010 at 1:16 PM, Hossein <ma...@csc.com> wrote:
>
> Hello,
>
> Environment: fuse 4.2 sp1 (camel 2.2)
>
> I am using the following in my spring config file load properties and it
> works with no problem. However, I was under assumption that when my bundles
> are deployed into SMX, if I place a new version of of my properties file
> (integration.properties) into SMX home/etc folder, the new file will be
> picked up, BUT it does not.
>
> [1] <context:property-placeholder
> location="classpath:integration.properties"/>
>
> Question1: is there anyway to change [1] so that an updated  properties file
> would be picked up by the spring my config file?
>
> Question2: Can [1] be changed so that it will load from a folder rather than
> classpath?
>

Yeah there is some OSGi way of defining a property as being "OSGified"
which means when you update the file, its updated in the kernel as
well.

See the FUSE documentation
http://fusesource.com/products/enterprise-servicemix/#documentation

In the _Deploying into the OSGi Container_ on page 66 in the pdf there
is something about osgi and properties.


> Thanks,
> Hossein Amerkashi
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/property-placeholder-and-classpath-tp3202843p3202843.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Claus Ibsen
Apache Camel Committer

Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus