You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by martin11 <ma...@gmail.com> on 2012/11/16 15:03:53 UTC

Re: How to use camel component properties outside camel context

Hello,

I have the same problem like Martin above, but I still don`t understand how
it should be resolved by osgi or blueprint.
I use property file and I want to read these properties inside application
context with camel-context and also for spring beans.
How can I read the property file by using <osgix:cm-properties> ?
Would you please explain it in more detail? or just put your configuration?

Thanks.



--
View this message in context: http://camel.465427.n5.nabble.com/How-to-use-camel-component-properties-outside-camel-context-tp5721318p5722861.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: How to use camel component properties outside camel context

Posted by Martin Stiborský <ma...@gmail.com>.
Hi!

Here is the promised configuration for Blueprint Admin service.

blueprint.xml:

<blueprint>
...
    <!-- Load in application properties reference -->
    <cm:property-placeholder persistent-id="etb.esb.config">
        <cm:default-properties>
            <cm:property name="foo.conf.value" value="foo"/>
            <cm:property name="bar.conf.value" value="bar"/>
        </cm:default-properties>
    </cm:property-placeholder>
...
</blueprint>

And that's all. Place the "etb.esb.config" file in karaf's etc/ and go use
it.

Usage outside camel context:

<bean id="myBean" class="com.myProject.myBean">
        <property name="myProperty" value="${foo.conf.value}"/>
</bean>

Within Camel context is the usage the same, only format of the config
"placeholders" is a little bi different:
Try "{bar.conf.value}". Hope I"m not wrong here, I don't have such real
example in my project and I can't test it right now.

Also you can use it within Java code easily, if you need code example for
that, I can find you for it. I've used it somewhere.




On Fri, Nov 16, 2012 at 4:41 PM, martin11 <ma...@gmail.com> wrote:

> yes, it would be very helpful to see your blueprint context. Thank you.
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/How-to-use-camel-component-properties-outside-camel-context-tp5721318p5722880.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
S pozdravem / Best regards
Martin Stiborský

Jabber: stibi@njs.netlab.cz
Twitter: http://www.twitter.com/stibi

Re: How to use camel component properties outside camel context

Posted by martin11 <ma...@gmail.com>.
yes, it would be very helpful to see your blueprint context. Thank you.



--
View this message in context: http://camel.465427.n5.nabble.com/How-to-use-camel-component-properties-outside-camel-context-tp5721318p5722880.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: How to use camel component properties outside camel context

Posted by Martin Stiborský <ma...@gmail.com>.
Hello Martin, Blueprint configuration admin service is the key.

http://www.liquid-reality.de/display/liquid/2011/09/23/Karaf+Tutorial+Part+2+-+Using+the+Configuration+Admin+Service

I can send you a complete code example, but right now I have just phone
available.

If nobody help you sooner, I'll post more details here later today.
On Nov 16, 2012 3:06 PM, "martin11" <ma...@gmail.com> wrote:

> Hello,
>
> I have the same problem like Martin above, but I still don`t understand how
> it should be resolved by osgi or blueprint.
> I use property file and I want to read these properties inside application
> context with camel-context and also for spring beans.
> How can I read the property file by using <osgix:cm-properties> ?
> Would you please explain it in more detail? or just put your configuration?
>
> Thanks.
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/How-to-use-camel-component-properties-outside-camel-context-tp5721318p5722861.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>