You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by Freeman Fang <fr...@gmail.com> on 2010/10/01 02:48:32 UTC
Re: Deployed bundle without Service Unit/Assembly and classpath
Hi,
My comment inline
On 2010-9-30, at 下午11:30, Kévin Sailly wrote:
>
> Hi,
>
> I have create some Camel route, but rather than deploying them
> embended into
> a Service Unit and Service Assembly, I just put the camel-
> context.xml file
> into the deploy repository and then my routes works fine.
>
> I have two questions about that use:
>
> 1/ With this method my routes on this projets are not "OSGI compliant"
> anymore and then using default container classes and libs, is there
> any
> other important impacts using this method?
Actually it's just not JBI compliant, but still OSGi Compliant.
KARAF support drop a spring file(camel router for your case) in deploy
folder, and a transformer will transform it to a OSGi bundle
underlying, please get more details from[1].
[1]http://karaf.apache.org/44-deployer.html
>
> 2/ Second point is about the classpath location in that case, I am
> trying to
> declare some properties files to configure my routes, but I can not
> achieve
> in finding them using standard declaration:
> <propertyPlaceholder id="properties" location="test.properties"/>
>
> Servicemix claming:
> Caused by: java.io.FileNotFoundException: Properties file
> test.properties
> not found in classpath
>
> I have searching but I am unable to define where to put the
> properties file
> or the good way to declare it.
>
> Is someone have an idea about that?
You should use "OSGi style" property place holder for SMX4, which will
leverage OSGi ConfigAdmin service t load/set properties, we
demonstrate how it works in camel-osgi example shipped with kit, the
README.txt explains how it work, you may need take a look at.
Freeman
>
> Thanks,
> Kévin
>
>
> --
> View this message in context: http://servicemix.396122.n5.nabble.com/Deployed-bundle-without-Service-Unit-Assembly-and-classpath-tp3047197p3047197.html
> Sent from the ServiceMix - User mailing list archive at Nabble.com.
--
Freeman Fang
------------------------
blog: http://freemanfang.blogspot.com
twitter: http://twitter.com/freemanfang
Open Source SOA: http://fusesource.com
Apache Servicemix:http://servicemix.apache.org
Apache Cxf: http://cxf.apache.org
Apache Karaf: http://karaf.apache.org
Apache Felix: http://felix.apache.org
Re: Deployed bundle without Service Unit/Assembly and classpath
Posted by Claus Ibsen <cl...@gmail.com>.
On Fri, Oct 1, 2010 at 11:31 AM, Kévin Sailly <ke...@gmail.com> wrote:
>
> Hi,
>
> Thanks a lot!
>
> I finally get reference of my property file this way as you explain:
> <osgix:cm-properties id="routesproperties"
> persistent-id="com.xxx.mychannel"/>
>
> But taking reference of it as a camel property placeholder:
> <propertyPlaceholder id="properties" location="ref:routesprops"/>
>
> This way I can confugure my camel routes using a config properties file
> setting the protocol for example:
> <route>
> <from uri="{{protocol}}://0.0.0.0:9999/myservice"/>
>
Nice.
But talk about 2-3 levels of indirection to have that {{protocol}} in
the route :)
>
> Regards,
> Kévin Sailly
> --
> View this message in context: http://servicemix.396122.n5.nabble.com/Deployed-bundle-without-Service-Unit-Assembly-and-classpath-tp3047197p3072283.html
> Sent from the ServiceMix - User 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: Deployed bundle without Service Unit/Assembly and classpath
Posted by Kévin Sailly <ke...@gmail.com>.
Hi,
Thanks a lot!
I finally get reference of my property file this way as you explain:
<osgix:cm-properties id="routesproperties"
persistent-id="com.xxx.mychannel"/>
But taking reference of it as a camel property placeholder:
<propertyPlaceholder id="properties" location="ref:routesprops"/>
This way I can confugure my camel routes using a config properties file
setting the protocol for example:
<route>
<from uri="{{protocol}}://0.0.0.0:9999/myservice"/>
Regards,
Kévin Sailly
--
View this message in context: http://servicemix.396122.n5.nabble.com/Deployed-bundle-without-Service-Unit-Assembly-and-classpath-tp3047197p3072283.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.