apache-camelosgi-bundleapache-servicemixblueprint-osgi

Set the bundle version and start level when deploying camel route as XML in deploy folder of ServiceMix


When deploying bundle in the "deploy" folder in ServiceMix, I am wondering if it is possible to set the bundle version in the blueprint XML.

Example of Camel route (blueprint xml):

<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ext="http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.0.0" xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0" xsi:schemaLocation="
       http://www.osgi.org/xmlns/blueprint/v1.0.0 https://osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd
       http://camel.apache.org/schema/blueprint http://camel.apache.org/schema/blueprint/camel-blueprint.xsd
       http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0 http://aries.apache.org/schemas/blueprint-cm/blueprint-cm-1.1.0.xsd">


    <cm:property-placeholder persistent-id="my.deploy.route" update-strategy="reload">
        <cm:default-properties>
            <cm:property name="amq.url" value="tcp://my-amq-host:61616?jms.watchTopicAdvisories=false" />
            <cm:property name="tracer.enable" value="false" />
        </cm:default-properties>
    </cm:property-placeholder>

    <camelContext xmlns="http://camel.apache.org/schema/blueprint">
        <onException useOriginalMessage="true">
            <exception>java.lang.Exception</exception>
            <handled>
                <constant>true</constant>
            </handled>
            <to uri="activemq:queue:SYNCHRO.DLQ" />
        </onException>

        <route id="route-countries">
            <from uri="activemq:queue:SYS.SOURCE.COUNTRY" />
            <to uri="activemq:queue:OTHER.DESTINATION.COUNTRY" />
        </route>

    </camelContext>

    <bean id="activemq" class="org.apache.activemq.camel.component.ActiveMQComponent">
        <property name="brokerURL" value="${amq.url}" />
    </bean>
</blueprint>

And when deployed, the list in the smx console shows:

[1233] [Active     ] [Created     ] [       ] [   80] country-route-dev.xml (0.0.0)

I would like to know if it's also possible to change the start level which is defaulted to 80.


Solution

  • I know you said ServiceMix and this only sets the version not the start-level but this works for me in karaf:

    <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
    
    <manifest xmlns="http://karaf.apache.org/xmlns/deployer/blueprint/v1.0.0">
    Bundle-SymbolicName My Cool Bundle
    Bundle-Version: 1.2.3
    </manifest>
    

    https://svn.apache.org/repos/asf/karaf/site/production/manual/latest/deployers.html#_blueprint_deployer