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&testConnectionOnStartup=false&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 <[email protected]>
Envoyé : 27 août 2021 10:37
À : [email protected]
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