You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Hilderich <hi...@yahoo.de> on 2013/12/13 17:51:21 UTC

Access another CamelContext

Dear Camel Support Team,

We have about 3 bundles running in an OSGi-Container (Karaf) and each has
its own
CamelContext - we are using Aries Blueprint by the way. 
Now we have the requirement to stop a route from another CamelContext. 
Furthermore this CamelContext is defined in another bundle. Can I take
access to 
this CamelContext and stop the route?

Can this be done and what is here the best practice? I was thinking about a
OSGi-Service.

Many thanks and kind regards
Hilderich 



--
View this message in context: http://camel.465427.n5.nabble.com/Access-another-CamelContext-tp5744744.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Access another CamelContext

Posted by Richard Kettelerij <ri...@gmail.com>.
Thanks for the update. This might help other users.


On Fri, Jan 3, 2014 at 10:58 AM, Hilderich <hi...@yahoo.de> wrote:

> Hello *,
>
> I figured it out:
>
> In Apache Karaf I checked the service metadata via:
>
>
>
> The following output gave me a view to the server metadata
> and I saw the key *camel.context.name*
>
> In my blueprint I was able to write the following:
>
>
>
> The crucial thing above is the filter attribute.
>
> That's it.
>
> Kind regards
> Hilderich
>
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Access-another-CamelContext-tp5744744p5745480.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>

Re: Access another CamelContext

Posted by Hilderich <hi...@yahoo.de>.
Hello *,

I figured it out:

In Apache Karaf I checked the service metadata via:



The following output gave me a view to the server metadata
and I saw the key *camel.context.name*

In my blueprint I was able to write the following:



The crucial thing above is the filter attribute.

That's it.

Kind regards
Hilderich





--
View this message in context: http://camel.465427.n5.nabble.com/Access-another-CamelContext-tp5744744p5745480.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Access another CamelContext

Posted by Hilderich <hi...@yahoo.de>.
Hello again,

My approach above doesn't work steadily because more than one bundle exports
a service
with the same interface org.apache.camel.CamelContext. Now I have the
situation that
sometimes the Camel-Context is from that and then later the Camel-Context
is from the other bundle.
How can I use OSGi-Service-Metadata in Blueprint to use only the
Camel-Context of
one specific bundle?

Kind Regards
Hilderich



--
View this message in context: http://camel.465427.n5.nabble.com/Access-another-CamelContext-tp5744744p5745478.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Access another CamelContext

Posted by Hilderich <hi...@yahoo.de>.
Many thanks!



--
View this message in context: http://camel.465427.n5.nabble.com/Access-another-CamelContext-tp5744744p5744847.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Access another CamelContext

Posted by Claus Ibsen <cl...@gmail.com>.
Yeah or use JMX to stop the route on the other bundle.



On Sun, Dec 15, 2013 at 12:33 PM, Richard Kettelerij
<ri...@gmail.com> wrote:
> If you're using blueprint the CamelContext is already automatically
> registered in the OSGi Service Registry. Just type 'ls' in Karaf and you'll
> notice there's a CamelContext service associated with each bundle. So yes,
> you can just lookup the CamelContext of another bundle and start/stop a
> particular route.
>
>
> On Fri, Dec 13, 2013 at 5:51 PM, Hilderich <hi...@yahoo.de> wrote:
>
>> Dear Camel Support Team,
>>
>> We have about 3 bundles running in an OSGi-Container (Karaf) and each has
>> its own
>> CamelContext - we are using Aries Blueprint by the way.
>> Now we have the requirement to stop a route from another CamelContext.
>> Furthermore this CamelContext is defined in another bundle. Can I take
>> access to
>> this CamelContext and stop the route?
>>
>> Can this be done and what is here the best practice? I was thinking about a
>> OSGi-Service.
>>
>> Many thanks and kind regards
>> Hilderich
>>
>>
>>
>> --
>> View this message in context:
>> http://camel.465427.n5.nabble.com/Access-another-CamelContext-tp5744744.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
Make your Camel applications look hawt, try: http://hawt.io

Re: Access another CamelContext

Posted by Richard Kettelerij <ri...@gmail.com>.
If you're using blueprint the CamelContext is already automatically
registered in the OSGi Service Registry. Just type 'ls' in Karaf and you'll
notice there's a CamelContext service associated with each bundle. So yes,
you can just lookup the CamelContext of another bundle and start/stop a
particular route.


On Fri, Dec 13, 2013 at 5:51 PM, Hilderich <hi...@yahoo.de> wrote:

> Dear Camel Support Team,
>
> We have about 3 bundles running in an OSGi-Container (Karaf) and each has
> its own
> CamelContext - we are using Aries Blueprint by the way.
> Now we have the requirement to stop a route from another CamelContext.
> Furthermore this CamelContext is defined in another bundle. Can I take
> access to
> this CamelContext and stop the route?
>
> Can this be done and what is here the best practice? I was thinking about a
> OSGi-Service.
>
> Many thanks and kind regards
> Hilderich
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Access-another-CamelContext-tp5744744.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>