Hello Ade, Ron and Claus!

Thanks for your responses. I assume that I can send/receive a message in SMX
using Camel in this way:

first OSGI bundle:
{code}
  from("direct:start")
  .to("nmr:orderEntryPreProcessor");
{code}

second OSGI bundle:
{code}
  from("nmr:orderEntryPreProcessor")
  .to("mock:end");
{code}

But how it is possible to discover routes, deployed in another OSGI bundle
to "extend" or modify a route dynamicly? I understood the following code
will not work, if the route "nmr:orderEntryPreProcessor" is defined in
another OSGI bundle:
{code}
  Endpoint endpoint =
exchange.getContext().hasEndpoint("nmr:orderEntryPreProcessor"); 
{code}

Du you advice a solution like this:

first OSGI bundle:
{code}
  <bean id="orderEntryPreProcessorRoute"
class="com.company.OrderEntryPreProcessorRoute" />

  <osgi:service ref="orderEntryPreProcessorRoute">
    <osgi:interfaces>
      <value>org.apache.camel.RoutesBuilder</value>
    </osgi:interfaces>
    <osgi:service-properties>
      <entry key="routeName" value="orderEntryPreProcessorRoute" />
    </osgi:service-properties>
  </osgi:service>
{code}

and in the other bundle, I need a reference to the OSGI service registry and
lookup the exported route (by service property because we export multiple
routes).
I don't know whether this works and how I can inject the OSGI service
registry in a Spring managed bean. I assume, this is not the Spring
application context...

Thanks for your help,
Christian
-- 
View this message in context: 
http://camel.465427.n5.nabble.com/Camel-OSGI-and-container-wide-Camel-route-lookups-tp2269094p2473177.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to