Camel has no special feature for declarative services it treats them as
any other osgi service. So it does not matter if you specify your
services using spring dm, blueprint or ds.
Camel resolves services using its internal registry. When inside OSGi
this registry also looks up OSGi services. So when you use a bean in
your route with a certain name then camel looks this
bean up in the OSGi service registry too. I am not sure though what
exact filter criteria are used.
I think the cleanest way to use OSGi services in camel is to first add a
service reference into the spring context. So the service is available
as a bean in the spring context and then usse it like a normal bean in
camel.
Btw. when in OSGi you should consider replacing spring dm with
blueprint. It works much better in an OSGi environment. When using
spring dm you often have to configure a lot of package imports or
require bundle statements. In blueprint you normally do not need to
define any as the maven bundle plugin figures them out itself and
blueprint uses the classpath better and so needs less configs anyway.
Christian
Am 12.03.2012 07:08, schrieb sanketh.reddy:
Hi,
i have a single monolithic project which has its components segregated by
packages . i used a lot of spring xml's to define :
1. camel route's between these packages to send serialized java objects
2. create singleton instances with injected properties which took care of
application lifecycle,
3. trigger some cron jobs on beans...etc .
I deployed this project as a single osgi bundle in servicemix with no config
admin,service dependency management..etc because it was a single bundle
.Now, we have a new requirement where some of our packages need to be
updated dynamically without bringing down the system .We have decided to
embrace the osgi standard and divide our project into independent component
bundles communicating via services .
I have chosen osgi declarative services(felix
SCR) as my service dependency manager as it very light compared to
spring-DM(blueprint) and provides most of the features i need . Moving to
OSGI DS means writing your service implementation classes as components .
Now , i want to keep my camel routes in spring xml and use some of the
components as beans in my camel routes (static instances) . Will this cause
any abnormal behaviour , how does camel context work along with the
bundlecontext provided by OSGI . Are there any best practices to keep in
mind when using camel with OSGI DS ?
Thanks
sanre6
-----
thanks
sanketh
mail : [email protected]
--
View this message in context:
http://camel.465427.n5.nabble.com/Questions-regarding-usage-of-camel-along-with-OSGI-Declarative-services-tp5556728p5556728.html
Sent from the Camel - Users mailing list archive at Nabble.com.
--
Christian Schneider
http://www.liquid-reality.de
Open Source Architect
Talend Application Integration Division http://www.talend.com