You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Jean-Baptiste Onofré (JIRA)" <ji...@apache.org> on 2015/05/21 14:56:01 UTC

[jira] [Created] (CAMEL-8787) camel-blueprint registers only one context as OSGi services, even if it's multiple Camel Contexts are defined

Jean-Baptiste Onofré created CAMEL-8787:
-------------------------------------------

             Summary: camel-blueprint registers only one context as OSGi services, even if it's multiple Camel Contexts are defined
                 Key: CAMEL-8787
                 URL: https://issues.apache.org/jira/browse/CAMEL-8787
             Project: Camel
          Issue Type: Bug
          Components: camel-blueprint
    Affects Versions: 2.12.1
            Reporter: Jean-Baptiste Onofré


If we have a blueprint bundle containing the following:
- OSGI-INF/blueprint/context1.xml containing:

{code}
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">

        <camelContext xmlns="http://camel.apache.org/schema/blueprint">
                <route id="route1">
                        <from uri="direct-vm:route1"/><to uri="log:route1"/>
                </route>
        </camelContext>
        <camelContext xmlns="http://camel.apache.org/schema/blueprint">
                <route id="route2">
                        <from uri="direct-vm:route2"/><to uri="log:route2"/>
                </route>
        </camelContext>

</blueprint>
{code}

- OSGI-INF/blueprint/context2.xml containing:

{code}
<?xml version="1.0" encoding="UTF-8"?>
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">

        <camelContext xmlns="http://camel.apache.org/schema/blueprint">
                <route id="route3">
                        <from uri="direct-vm:route3"/><to uri="log:route3"/>
                </route>
        </camelContext>
        <camelContext xmlns="http://camel.apache.org/schema/blueprint">
                <route id="route4">
                        <from uri="direct-vm:route4"/><to uri="log:route4"/>
                </route>
        </camelContext>

</blueprint>
{code}

However, when deploying this bundle, only the first CamelContext (containing route1) is registered as an OSGi service:

{code}
karaf@trun> ls 197

multicontext (197) provides:
----------------------------
objectClass = org.osgi.service.blueprint.container.BlueprintListener
service.id = 383
----
camel.context.name = 197-camel-6
camel.context.symbolicname = jbonofre.multicontext
camel.context.version = 1.0.0.SNAPSHOT
objectClass = org.apache.camel.CamelContext
service.id = 384
----
objectClass = org.osgi.service.blueprint.container.BlueprintListener
service.id = 385
----
objectClass = org.osgi.service.blueprint.container.BlueprintListener
service.id = 386
----
objectClass = org.osgi.service.blueprint.container.BlueprintListener
service.id = 387
----
osgi.blueprint.container.version = 1.0.0.SNAPSHOT
osgi.blueprint.container.symbolicname = jbonofre.multicontext
objectClass = org.osgi.service.blueprint.container.BlueprintContainer
service.id = 388
{code}

All CamelContexts and routes should register the corresponding OSGi services.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)