Hi,

Most of the time, you have one bundle (blueprint, scr, ...) == one camel context. Technically speaking, you can have several camel contexts in the same bundle (for instance several blueprint XML, or service).

You can take a look on the Karaf camel examples.

Regards
JB

On 27/08/2021 16:52, Daniel Langevin wrote:
Hi,

In OSGI,
Each blueprint file equal 1 deployment.  So you can put 1 Camel Context by 
deployment file.

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

<camelContext id="Contexte-XXX-LOCAL" xmlns="http://camel.apache.org/schema/blueprint"; 
trace="false">

<reference id="artemis" interface="javax.jms.ConnectionFactory" timeout="30" />

<route id="rte.XXXL.actionsRoutes" startupOrder="000">
<description>xxxxxxxxxxxxxxxxx</description>
  <from 
uri="jms:queue:jms.LOCAL.actionsRoutes.queue?connectionFactory=artemis&amp;testConnectionOnStartup=false&amp;acceptMessagesWhileStopping=true"/>
    <setBody><constant></constant></setBody>
    <setHeader name="Exchange.HTTP_METHOD"><simple>GET</simple></setHeader>
    <setHeader 
name="Exchange.CONTENT_TYPE"><constant>text/plain</constant></setHeader>
    <setHeader name="HTTP_HOST"><simple>{{smx.hostname}}</simple></setHeader>
    <setHeader 
name="Exchange.HTTP_URI"><simple>http://{{smx.hostname}}/routes/${header.sysXXX}/${header.localRoutes}/${header.actionsRoutes}</simple></setHeader>
    <to uri="http://dummyhost"; />
    <delay asyncDelayed="true"> <constant>1000</constant> </delay>
    <to uri="mock:dummy"/>
</route>
...
...  Another routes
<route ...
</route>
</camelContext>
</blueprint>


Hope it's help

-----Message d'origine-----
De : Martin Lichtin <lich...@yahoo.com.INVALID>
Envoyé : 27 août 2021 10:37
À : users@camel.apache.org
Objet : Migration from 2.x to 3.x

Hi,

the migration says

"Support for multiple CamelContexts has been removed and only 1 CamelContext per 
deployment is supported."

The term "deployment" seem loose.
My concern here is that in OSGi each bundle has its own CamelContext (e.g. via 
blueprint configuration), how will that work?

- Martin


Reply via email to