Tried to expose activemq as OSGI service in activemq.xml and tried to
reference it in blueprint. But I am getting the waiting for namespace
issue. Have the spring-osgi.* jars in maven dependencies already.

blueprint.xml:

<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0";
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
       xmlns:camel="http://camel.apache.org/schema/blueprint";
       xmlns:cxf="http://camel.apache.org/schema/blueprint/cxf";
   xmlns:osgi="http://www.springframework.org/schema/osgi";
       xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0
"
       xsi:schemaLocation="
       http://www.osgi.org/xmlns/blueprint/v1.0.0
http://www.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://camel.apache.org/schema/blueprint/cxf
http://camel.apache.org/schema/blueprint/cxf/camel-cxf.xsd
        http://www.springframework.org/schema/osgi
        http://www.springframework.org/schema/osgi/spring-osgi.xsd
        http://www.springframework.org/schema/osgi
        http://www.springframework.org/schema/osgi/spring-osgi.xsd";>

<osgi:reference id="activemq" interface="org.apache.camel.Component"
filter="(component=activemq)"/>

  <camelContext trace="false" id="blueprintContext" xmlns="
http://camel.apache.org/schema/blueprint";>

    <route>
        <from uri="file:camel/input"/>
        <log message="Moving ${file:name} to the output directory"/>
        <to uri="file:camel/output"/>
    </route>

</camelContext>
</blueprint>

activemq.xml:

<bean id="activemq"
class="org.apache.activemq.camel.component.ActiveMQComponent" >
        <property name="connectionFactory">
          <bean class="org.apache.activemq.ActiveMQConnectionFactory">
            <property name="brokerURL"
value="vm://localhost?create=false&amp;waitForStart=10000" />
            <property name="userName" value="system"/>
            <property name="password" value="manager"/>
          </bean>
        </property>
    </bean>
 <service ref="activemq" interface="org.apache.camel.Component"/>

pom.xml:

 <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <version>2.3.4</version>
                <extensions>true</extensions>
                <configuration>
                    <manifestLocation>META-INF</manifestLocation>
                    <instructions>

<Bundle-SymbolicName>${pom.artifactId}</Bundle-SymbolicName>
                        <Import-Package>
                            org.apache.activemq.camel.component,
                            org.apache.camel,
                            *</Import-Package>

<Include-Resource>src/main/resources</Include-Resource>

<Spring-Context>*;publish-context:=false;create-asynchronously:=true</Spring-Context>
                        <Private-Package></Private-Package>
                    </instructions>
                </configuration>
  </plugin>

-Thanks

Reply via email to