Accessing OSGI Services across bundles in Java DSL in OSGi Blueprint

Solution Unverified - Updated -

Issue

  • We are trying to load an OSGI service from another bundle into Java DSL routebuilder and having some difficulties finding exactly how to do that. We have found the following article:

https://access.redhat.com/documentation/en-US/Fuse_ESB_Enterprise/7.1/html/Deploying_into_the_Container/files/DeploySimple-CamelRegistry.html

  • The link provides information about how to invoke it directly in the route, but we would like to access the service before we use it within the route. Is there some kind of annotation or method within the registry to access this service and set it into an object so we can access all methods on it?

  • We have been looking into using something like getContext().getRegistry().lookupByName("myService"), but we are not sure if this is correct nor how to really test it properly.

Environment

  • Red Hat JBoss Fuse
    • 6.x
  • Aries Blueprint

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content