Exact :
1) one bundle exposes an object that implements the EventNotifier interface
as a service in ts blueprint.
2) two other bundles with their blueprints run Camel contexts, and do not
reference the service. All the exchanges of these routes are trapped as
events by the service.
Strange, no ? It seems that the global service is added to each bundle
registry without any explicit reference, and detected as a listener by
Camel.
An explanation ?
FYI : I'm using SMX 7.0.1 with just its given Camel features.
Thanks.
Regards.

Le mar. 2 juil. 2019 à 10:51, Jean-Baptiste Onofré <[email protected]> a
écrit :

> Hi,
>
> I guess you are using camel-blueprint, right ?
>
> The EventNotifier service is in a dedicated bundle ?
>
> Regards
> JB
>
> On 02/07/2019 10:40, Ephemeris Lappis wrote:
> > Hello.
> >
> > I've been trying to provide a org.apache.camel.spi.EventNotifier as a
> > shared OSGi service.
> >
> > When I instantiates a similar object as a bean in a bundle blueprint, the
> > Camel context registers it and all events are received as expected.
> >
> > If I try to expose the same kind of object as a service from another
> > bundle, It seems that it is automatically added to all my Camel contexts
> in
> > any bundle, masking all others EventNotifier created as simple beans, ans
> > without using a service reference.
> >
> > I expose it like that :
> >
> > <bean
> >     id="my.pure.service.bean"
> >     class="my.tests.t13.spy.service.SpyPureService" />
> > <service
> >     id="my.spy.pure.service"
> >     interface="org.apache.camel.spi.EventNotifier"
> >     ref="my.pure.service.bean" />
> >
> > Is it a normal behavior ?
> >
> > Why does the service appear all the bundles without setting a reference ?
> >
> > Thanks for your help.
> >
> > Regards.
> >
>
> --
> Jean-Baptiste Onofré
> [email protected]
> http://blog.nanthrax.net
> Talend - http://www.talend.com
>

Reply via email to