Apache Camel is a powerful open source integration framework based on known Enterprise Integration Patterns with powerful Bean Integration.
||Gets the Camel context currently started within Platform 6.|
||Direct access to an endpoint within the context given it’s name.|
||Synchronous call to given endpoint. Exchange In message returned as Map|
||Synchronous exchange with given endpoint. Exchange In message given as Map, Exchange In message returned as Map|
||Synchronous exchange with given endpoint. Exchange In message given as Map, Exchange Out message returned as Map|
||Synchronous exchange with given endpoint. Exchange In message given as Map, Exchange In and Out message returned as Map|
||Registers a named bean in the Spring application context.|
||Removes a named bean from the Spring application context.|
||Removes the route from the current camel context.|
||Removes all route from the current camel context.|
An Exchange represents an abstraction for an exchange of messages which involves a request message and its corresponding response or an exception message. This can be expressed as a map for use with this DSL:
// Example exchange map def exchange = [ body: "<xml>hello</xml>", headers: [hello : "world" ], attachments: [ myfile: "file:///Users/simont/Documents/temp/b2box-5.2.6-SNAPSHOT/b2run.sh"], properties: [ one : "one", two : "two" ] ]
When Platform 6 starts, a camel context is started via Spring using the file:
It is possible to extend the context bean definition using this file; adding routes for example.
Because Spring starts the camel context, the bean registry used by this context will be Springs.
Therefore adding additional beans via the Spring context is also a possibility.
To do this the
p6context.xml file should be moved from
Alternatively, creating routes and registering beans can be performed in the scripts and routes services using this DSL.
The following Camel JAR files ship with Platform 6:
The version of Camel shipped with Platform 6 is 2.18.1 which is compatible with the version of Spring used by the product: 4.3.4.RELEASE. Please do not attempt to update or use services and/or components that are not version compatible.
Camel has many other components and services that are distributed in other JAR files.
If a developer wishes to use other components and services the JARs (and dependencies) should be downloaded and placed in
We have encountered issues when using @Grab to download JAR dependencies at runtime. These issues can arise when multiple users run multiple scripts concurrently. Use of @Grab on production system is therefore not recommended however its use during development and prototyping is possible.
Platform 6 has an embedded JMS provider called HornetQ.
Camel will therefore use this provider by default.
In order to create named queues for use with Camel the file
$B2BOX_HOME/conf/hornetq-jms.xml should be moved to
$B2BOX_DATA/conf/hornetq-jms.xml and edited to add the required queues:
<configuration xmlns="urn:hornetq" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:hornetq /schema/hornetq-jms.xsd"> <connection-factory name="ConnectionFactory"> <connectors> <connector-ref connector-name="in-vm"/> </connectors> <entries> <entry name="ConnectionFactory"/> </entries> <use-global-pools>false</use-global-pools> <scheduled-thread-pool-max-size>10</scheduled-thread-pool-max-size> <thread-pool-max-size>-1</thread-pool-max-size> <client-failure-check-period>2147483646</client-failure-check-period> <connection-ttl>-1</connection-ttl> <reconnect-attempts>-1</reconnect-attempts> </connection-factory> <queue name="myQueue"> <entry name="/queue/cameltest"/> </queue> </configuration>
Please see http://docs.jboss.org/hornetq/2.4.0.Final/docs/user-manual/html/index.html for more information.
JMX is activated within Platform 6 Camel by default allowing you to monitor and control the Camel managed objects with a JMX client.
Please see: http://camel.apache.org/camel-jmx.html for more information
This is an example of using one of the many components available to Camel.
For a full list see: https://github.com/apache/camel/tree/master/components#components
The following JARs were downloaded and copied to
I then created a free account with: http://openweathermap.org/ to obtain an appid.
println "WEATHER INFO> " + p6.camel.endpointCallWaitInput("weather:foo?appid=3cacd3cba74f4288ec0d8c1396513824")