tag:blogger.com,1999:blog-21998384498767272922024-03-12T00:49:57.102-07:00Henryk KonsekHenryk Konsekhttp://www.blogger.com/profile/09392743290349794069noreply@blogger.comBlogger139125tag:blogger.com,1999:blog-2199838449876727292.post-10844923835725189022016-01-04T03:50:00.001-08:002016-01-04T03:50:22.399-08:00Managing Camel routes with Kura web UI<i>This repost of my DZone article - <a href="https://dzone.com/articles/managing-camel-routes-with-kura-web-ui">Managing Camel Routes With Kura Web UI</a>.</i><br />
<br />
In my <a href="https://dzone.com/articles/creating-camel-routes-for-eclipse-kura">previous post about Camel and Kura integration</a> I demonstrated how to easily deploy Camel routes into <a href="http://wiki.osgi.org/wiki/Declarative_Services">Kura</a> using <a href="http://rhiot.io/">Rhiot</a>. In this article I would like to elaborate a little bit on how to manage Camel routes from the level of the Kura web UI. <br />
<div>
<br />
<h3>
Loading XML routes using SCR property</h3>
<br />
<a href="https://rhiot.gitbooks.io/rhiotdocumentation/content/gateway/camel_kura_router.html">RhiotKuraRouter</a> comes with a <b>RhiotKuraRouter#updated(Map<string object="">)</string></b> method. The primary purpose of this callback is to allow a router to be a SCR component configured using the Kura Web UI and EuroTech <a href="http://www.eurotech.com/en/products/software+services/everyware+cloud+m2m+platform/m2m+what+it+is">Everyware Cloud</a>, however you can use this callback outside the web UI and Everyware Cloud context.</div>
<div>
<br />
Whenever <b>RhiotKuraRouter#updated(Map<string object="">)</string></b> callback is executed, <b>RhiotKuraRouter</b> tries to read <b>camel.route.xml</b> property value (<b><a href="https://github.com/rhiot/rhiot/blob/e77eda6817408ad6cd006f0e21f2a0291daa61a4/components/camel-kura/src/main/java/io/rhiot/component/kura/router/RhiotKuraConstants.java#L21">RhiotKuraConstants.XML_ROUTE_PROPERTY</a></b> key constant), to parse its value and load it as an XML Camel routes. For example if the <b>camel.route.xml</b> property will be set to the following value...</div>
<div>
<br /></div>
<pre class="brush:xml"><routes xmlns="http://camel.apache.org/schema/spring">
<route id="mqttLogger">
<from uri="paho:topic?brokerUrl=tcp:brokerhost:1883"/>
<to uri="log:messages"/>
</route>
</routes>
</pre>
<br />
...new route will be automatically started (or updated if route with ID equal to <b>mqttLogger</b> already exists).<br />
<div>
<br /></div>
<div>
All the above basically mean that if you register your Kura router as <a href="http://wiki.osgi.org/wiki/Declarative_Services">OSGi declarative service</a>, you will be able to dynamically load and update XML routes using OSGi configuration admin service. </div>
<div>
<br />
<br />
<h3>
Managing XML Camel routes using web UI</h3>
<br />
All <b>RhiotKuraRouter</b> instances implements Kura's <b>ConfigurableComponent</b> interface. It means that those can be configured using Kura web UI.<br />
<br />
I highly recommend to use Rhiot <a href="https://rhiot.gitbooks.io/quickstarts/kura_camel_quickstart.md">Kura Camel quickstart</a> as a template for creating Kura Camel routers. Our quickstart is configured as SCR component, so you can just deploy it to the Kura server and see your gateway route module deployed as a configurable service. To specify the route XML that should be loaded by a Camel context running in a deployed module, edit the <b>camel.route.xml</b> service property and click <b>Apply</b> button. As soon as <b>Apply</b> button is clicked, the route will be parsed and loaded.<br />
<br />
<a href="https://rhiot.gitbooks.io/rhiotdocumentation/content/gateway/kura_camel_routes_webui.png"><img height="345" src="https://rhiot.gitbooks.io/rhiotdocumentation/content/gateway/kura_camel_routes_webui.png" width="640" /></a><br />
<br />
Our Kura Camel quickstart can be also used from the <a href="http://www.eurotech.com/en/products/software+services/everyware+cloud+m2m+platform/m2m+what+it+is">EuroTech Everyware Cloud (EC)</a>.<br />
<br />
<a href="https://rhiot.gitbooks.io/rhiotdocumentation/content/gateway/kura_camel_routes_webui.png"><img height="344" src="https://rhiot.gitbooks.io/rhiotdocumentation/content/gateway/kura_camel_routes_ec.png" width="640" /></a></div>
<div>
<br /></div>
<h3>
Maintenance of the Kura routes at runtime</h3>
<br />
<div>
The ability to maintain Camel routes from web UI without restarting a Kura server is extremely important when it comes to the long term maintenance of your IoT gateway solution. It allows to modify a flow of the existing message routes or create new rules without affecting an uptime of your production environment.</div>
<div>
<br /></div>
<div>
Production-level grade IoT gateway (Kura) and powerful messaging framework (Camel) are an example of a perfect combination of two mature technologies which used together result in a solid, but flexible Internet Of Things solution.</div>
Henryk Konsekhttp://www.blogger.com/profile/09392743290349794069noreply@blogger.com1tag:blogger.com,1999:blog-2199838449876727292.post-40884791508068646082015-11-26T06:25:00.003-08:002015-11-26T06:25:45.080-08:00Creating Camel routes for Eclipse Kura <div style="box-sizing: border-box; color: #333333; line-height: 25.6px; margin-bottom: 16px;">
<i>This is repost of my DZone article - <a href="https://dzone.com/articles/creating-camel-routes-for-eclipse-kura">Creating Camel routes for Eclipse Kura</a>.</i><br />
<br />
<span style="font-family: "helvetica neue" , "arial" , "helvetica" , sans-serif;"><a href="https://www.eclipse.org/kura/">Eclipse Kura</a> is the Open Source M2M Software Framework of choice for IoT Gateways, and it's well known for its ease of use and flexibility, and <a href="http://camel.apache.org/">Apache Camel</a> is a message routing engine providing out of the box dozens of connectors to different endpoints.</span></div>
<div style="box-sizing: border-box; color: #333333; line-height: 25.6px; margin-bottom: 16px;">
<span style="line-height: 25.6px;"><span style="font-family: "helvetica neue" , "arial" , "helvetica" , sans-serif;">Eclipse Kura and Apache Camel, when joined together, give developers the possibility to abstract their application logic from both field protocols and data delivery, thus easing and speeding up the development process.</span></span></div>
<div style="box-sizing: border-box; margin-bottom: 16px;">
<span style="font-family: "helvetica neue" , "arial" , "helvetica" , sans-serif;"><span style="color: #333333; line-height: 25.6px;"><a href="http://rhiot.io/">Rhiot</a> <a href="https://github.com/rhiot/rhiot/blob/master/docs/readme.md#kura-camel-quickstart">Kura Camel quickstart</a> can be used to create Camel router OSGi bundle project deployable into the </span><a href="https://www.eclipse.org/kura" style="box-sizing: border-box; color: #4078c0; line-height: 25.6px; text-decoration: none;">Eclipse Kura</a><span style="color: #333333; line-height: 25.6px;"> gateway. Rhiot supports Kura gateway deployments as a first class citizen and this quickstart is intended to be used as a blueprint for Camel deployments for Kura. </span><span style="color: #333333; line-height: 25.6px;">Under the hood </span><span style="color: #333333; line-height: 25.6px;">Rhiot quickstart uses </span><a href="http://camel.apache.org/kura.html" style="box-sizing: border-box; color: #4078c0; line-height: 25.6px; text-decoration: none;">Camel Kura component</a><span style="color: #333333;"><span style="line-height: 25.6px;"> to leverage an integration between Kura and Camel . </span></span></span></div>
<div style="box-sizing: border-box; margin-bottom: 16px;">
<span style="color: #333333; line-height: 25.6px;"><span style="font-family: "helvetica neue" , "arial" , "helvetica" , sans-serif;">If you are wondering where Kura Camel project fits into the Kura architecture - our quickstart is deployed into the <b><i>application</i></b> layer of Kura, with a dedicated Camel context instance per application bundle.</span></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://image.slidesharecdn.com/kuram2miotgateway-140909110119-phpapp02/95/kura-m2m-iot-gateway-28-638.jpg?cb=1410337137" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://image.slidesharecdn.com/kuram2miotgateway-140909110119-phpapp02/95/kura-m2m-iot-gateway-28-638.jpg?cb=1410337137" height="480" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<h3 style="box-sizing: border-box; color: #333333; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 1.25em; line-height: 1.4; margin-bottom: 16px; margin-top: 1em;">
Creating a Kura Camel project</h3>
<div style="box-sizing: border-box; color: #333333; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol'; line-height: 25.6px; margin-bottom: 16px;">
In order to create the Kura Camel project from Rhiot quickstart execute the following commands:</div>
<pre style="background-color: #f7f7f7; border-radius: 3px; box-sizing: border-box; color: #333333; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6px; font-stretch: normal; line-height: 1.45; margin-bottom: 16px; overflow: auto; padding: 16px; word-wrap: normal;"><code style="background: transparent; border-radius: 3px; border: 0px; box-sizing: border-box; display: inline; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6px; line-height: inherit; margin: 0px; max-width: initial; overflow: initial; padding: 0px; word-break: normal; word-wrap: normal;">git clone git@github.com:rhiot/quickstarts.git
cp -r quickstarts/kura-camel kura-camel
cd kura-camel
mvn install
</code></pre>
<h3 style="box-sizing: border-box; color: #333333; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 1.25em; line-height: 1.4; margin-bottom: 16px; margin-top: 1em;">
Prerequisites</h3>
<div style="box-sizing: border-box; color: #333333; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol'; line-height: 25.6px; margin-bottom: 16px;">
We presume that you have Eclipse Kura already installed on your target device. And that you know the IP address of that device. If you happen to deploy to a Raspbian-based device, and you would like to find the IP of that Raspberry Pi device connected to your local network, you can use the Rhiot device scanner, as demonstrated on the snippet below:</div>
<pre style="background-color: #f7f7f7; border-radius: 3px; box-sizing: border-box; color: #333333; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6px; font-stretch: normal; line-height: 1.45; margin-bottom: 16px; overflow: auto; padding: 16px; word-wrap: normal;"><code style="background: transparent; border-radius: 3px; border: 0px; box-sizing: border-box; display: inline; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6px; line-height: inherit; margin: 0px; max-width: initial; overflow: initial; padding: 0px; word-break: normal; word-wrap: normal;">docker run --net=host -it rhiot/deploy-gateway scan
</code></pre>
<div style="box-sizing: border-box; color: #333333; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol'; line-height: 25.6px; margin-bottom: 16px;">
The command above will return an output similar to the one presented below:</div>
<pre style="background-color: #f7f7f7; border-radius: 3px; box-sizing: border-box; color: #333333; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6px; font-stretch: normal; line-height: 1.45; margin-bottom: 16px; overflow: auto; padding: 16px; word-wrap: normal;"><code style="background: transparent; border-radius: 3px; border: 0px; box-sizing: border-box; display: inline; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6px; line-height: inherit; margin: 0px; max-width: initial; overflow: initial; padding: 0px; word-break: normal; word-wrap: normal;">Scanning local networks for devices...
======================================
Device type IPv4 address
--------------------------------------
RaspberryPi2 /192.168.1.100
</code></pre>
<div style="box-sizing: border-box; color: #333333; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol'; line-height: 25.6px; margin-bottom: 16px;">
Keep in mind that <code style="background-color: rgba(0, 0, 0, 0.0392157); border-radius: 3px; box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; margin: 0px; padding: 0.2em 0px;">/opt/eclipse/kura/kura/config.ini</code> file on your target device should have OSGi boot delegation enabled for packages <code style="background-color: rgba(0, 0, 0, 0.0392157); border-radius: 3px; box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; margin: 0px; padding: 0.2em 0px;">sun.*,com.sun.*</code>. Your <code style="background-color: rgba(0, 0, 0, 0.0392157); border-radius: 3px; box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; margin: 0px; padding: 0.2em 0px;">/opt/eclipse/kura/kura/config.ini</code> should contain the following line then:</div>
<pre style="background-color: #f7f7f7; border-radius: 3px; box-sizing: border-box; color: #333333; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6px; font-stretch: normal; line-height: 1.45; margin-bottom: 16px; overflow: auto; padding: 16px; word-wrap: normal;"><code style="background: transparent; border-radius: 3px; border: 0px; box-sizing: border-box; display: inline; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6px; line-height: inherit; margin: 0px; max-width: initial; overflow: initial; padding: 0px; word-break: normal; word-wrap: normal;">org.osgi.framework.bootdelegation=sun.*,com.sun.*
</code></pre>
<div style="box-sizing: border-box; color: #333333; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol'; line-height: 25.6px; margin-bottom: 16px;">
A boot delegation of <code style="background-color: rgba(0, 0, 0, 0.0392157); border-radius: 3px; box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; margin: 0px; padding: 0.2em 0px;">sun</code> packages is required to make Camel work smoothly in an Equinox.</div>
<h3 style="box-sizing: border-box; color: #333333; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 1.25em; line-height: 1.4; margin-bottom: 16px; margin-top: 1em;">
Deployment</h3>
<div style="box-sizing: border-box; color: #333333; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol'; line-height: 25.6px; margin-bottom: 16px;">
In order to deploy Camel application to a Kura server, you have to copy necessary Camel jars and a bundle containing your application. Your bundle can be deployed into the target device by executing an <code style="background-color: rgba(0, 0, 0, 0.0392157); border-radius: 3px; box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; margin: 0px; padding: 0.2em 0px;">scp</code> command. For example:</div>
<pre style="background-color: #f7f7f7; border-radius: 3px; box-sizing: border-box; color: #333333; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6px; font-stretch: normal; line-height: 1.45; margin-bottom: 16px; overflow: auto; padding: 16px; word-wrap: normal;"><code style="background: transparent; border-radius: 3px; border: 0px; box-sizing: border-box; display: inline; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6px; line-height: inherit; margin: 0px; max-width: initial; overflow: initial; padding: 0px; word-break: normal; word-wrap: normal;">scp target/rhiot-kura-camel-1.0.0-SNAPSHOT.jar pi@192.168.1.100:/tmp
</code></pre>
<div style="box-sizing: border-box; color: #333333; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol'; line-height: 25.6px; margin-bottom: 16px;">
The command above will copy your bundle to the <code style="background-color: rgba(0, 0, 0, 0.0392157); border-radius: 3px; box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; margin: 0px; padding: 0.2em 0px;">/tmp/rhiot-kura-camel-1.0.0-SNAPSHOT.jar</code> location on a target device. Use similar <code style="background-color: rgba(0, 0, 0, 0.0392157); border-radius: 3px; box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; margin: 0px; padding: 0.2em 0px;">scp</code> command to deploy Camel jars required to run your project:</div>
<pre style="background-color: #f7f7f7; border-radius: 3px; box-sizing: border-box; color: #333333; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6px; font-stretch: normal; line-height: 1.45; margin-bottom: 16px; overflow: auto; padding: 16px; word-wrap: normal;"><code style="background: transparent; border-radius: 3px; border: 0px; box-sizing: border-box; display: inline; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6px; line-height: inherit; margin: 0px; max-width: initial; overflow: initial; padding: 0px; word-break: normal; word-wrap: normal;">scp ~/.m2/repository/org/apache/camel/camel-core/2.16.0/camel-core-2.16.0.jar pi@192.168.1.100:/tmp
scp ~/.m2/repository/org/apache/camel/camel-core-osgi/2.16.0/camel-core-osgi-2.16.0.jar pi@192.168.1.100:/tmp
scp ~/.m2/repository/org/apache/camel/camel-kura/2.16.0/camel-kura-2.16.0.jar pi@192.168.1.100:/tmp
</code></pre>
<div style="box-sizing: border-box; color: #333333; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol'; line-height: 25.6px; margin-bottom: 16px;">
Now log into your target device Kura shell using telnet:</div>
<pre style="background-color: #f7f7f7; border-radius: 3px; box-sizing: border-box; color: #333333; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6px; font-stretch: normal; line-height: 1.45; margin-bottom: 16px; overflow: auto; padding: 16px; word-wrap: normal;"><code style="background: transparent; border-radius: 3px; border: 0px; box-sizing: border-box; display: inline; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6px; line-height: inherit; margin: 0px; max-width: initial; overflow: initial; padding: 0px; word-break: normal; word-wrap: normal;">telnet localhost 5002
</code></pre>
<div style="box-sizing: border-box; color: #333333; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol'; line-height: 25.6px; margin-bottom: 16px;">
And install the bundles you previously scp-ed:</div>
<pre style="background-color: #f7f7f7; border-radius: 3px; box-sizing: border-box; color: #333333; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6px; font-stretch: normal; line-height: 1.45; margin-bottom: 16px; overflow: auto; padding: 16px; word-wrap: normal;"><code style="background: transparent; border-radius: 3px; border: 0px; box-sizing: border-box; display: inline; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6px; line-height: inherit; margin: 0px; max-width: initial; overflow: initial; padding: 0px; word-break: normal; word-wrap: normal;">install file:///tmp/camel-core-2.16.0.jar
install file:///tmp/camel-core-osgi-2.16.0.jar
install file:///tmp/camel-kura-2.16.0.jar
install file:///tmp/rhiot-kura-camel-1.0.0-SNAPSHOT.jar
</code></pre>
<div style="box-sizing: border-box; color: #333333; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol'; line-height: 25.6px; margin-bottom: 16px;">
Finally start your application using the following command:</div>
<pre style="background-color: #f7f7f7; border-radius: 3px; box-sizing: border-box; color: #333333; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6px; font-stretch: normal; line-height: 1.45; margin-bottom: 16px; overflow: auto; padding: 16px; word-wrap: normal;"><code style="background: transparent; border-radius: 3px; border: 0px; box-sizing: border-box; display: inline; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6px; line-height: inherit; margin: 0px; max-width: initial; overflow: initial; padding: 0px; word-break: normal; word-wrap: normal;">start <id_of_rhiot-kura-camel-1 .0.0-snapshot_bundle="" code=""></id_of_rhiot-kura-camel-1></code></pre>
<div style="box-sizing: border-box; color: #333333; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol'; line-height: 25.6px; margin-bottom: 16px;">
Keep in mind that bundles you deployed using the recipe above are not installed permanently and will be reverted after the server restart. Please read Kura documentation for more details regarding <a href="http://eclipse.github.io/kura/doc/deploying-bundles.html#making-deployment-permanent" style="box-sizing: border-box; color: #4078c0; text-decoration: none;">permanent deployments</a>.</div>
<h3 style="box-sizing: border-box; color: #333333; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 1.25em; line-height: 1.4; margin-bottom: 16px; margin-top: 1em;">
What the quickstart is actually doing?</h3>
<div style="box-sizing: border-box; color: #333333; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol'; line-height: 25.6px; margin-bottom: 16px;">
This quickstart triggers <a href="http://camel.apache.org/timer.html" style="box-sizing: border-box; color: #4078c0; text-decoration: none;">Camel timer</a> event every second and sends it to the system logger using <a href="http://camel.apache.org/log" style="box-sizing: border-box; color: #4078c0; text-decoration: none;">Camel Log</a> component. This is fairy simple functionality, but enough to demonstrate the Camel Kura project is actually working and processing messages. </div>
<div style="box-sizing: border-box; color: #333333; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol'; line-height: 25.6px; margin-bottom: 16px;">
The snippet below demonstrates the code of the route:</div>
<pre style="background-color: white; font-family: 'DejaVu Sans Mono'; font-size: 9pt;"><span style="color: navy; font-weight: bold;">public class </span>GatewayRouter <span style="color: navy; font-weight: bold;">extends </span>KuraRouter {
<span style="color: olive;">@Override</span><span style="color: olive;"> </span><span style="color: navy; font-weight: bold;">public void </span>configure() <span style="color: navy; font-weight: bold;">throws </span>Exception {
from(<span style="color: green; font-weight: bold;">"timer://heartbeat"</span>).
to(<span style="color: green; font-weight: bold;">"log:heartbeat"</span>);
}</pre>
<pre style="background-color: white; font-family: 'DejaVu Sans Mono'; font-size: 9pt;"></pre>
<pre style="background-color: white; font-family: 'DejaVu Sans Mono'; font-size: 9pt;"> ...</pre>
<pre style="background-color: white; font-family: 'DejaVu Sans Mono'; font-size: 9pt;"></pre>
<pre style="background-color: white; font-family: 'DejaVu Sans Mono'; font-size: 9pt;">}</pre>
<pre style="background-color: white; font-family: 'DejaVu Sans Mono'; font-size: 9pt;"></pre>
<div style="box-sizing: border-box; color: #333333; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol'; line-height: 25.6px; margin-bottom: 16px;">
If you are curious how can you create more complicated routes connected to Kura internal services, you would be interested in incoming articles demonstrating those features. </div>
Henryk Konsekhttp://www.blogger.com/profile/09392743290349794069noreply@blogger.com1tag:blogger.com,1999:blog-2199838449876727292.post-64296405413876979612015-11-16T12:53:00.002-08:002015-11-16T12:53:54.118-08:00My "IoT for mere mortals" talk at Capgemini Tech event in Wrocław<div class="separator" style="clear: both; text-align: center;">
<a href="http://logodatabases.com/wp-content/uploads/2012/07/capgemini-logo.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="http://logodatabases.com/wp-content/uploads/2012/07/capgemini-logo.jpg" height="90" width="320" /></a></div>
If you happen to be in Wrocław this Wednesday, be sure to attend my "IoT for mere mortals" talk. The <a href="https://www.facebook.com/events/192652357736159/">event</a> takes place in Włodkowica 21 pub (which serves pretty decent beer by the way). I will start do the talking around ~18:00. If you wanna hear a gentle introduction to the Internet Of Things, my talk is for you.<br />
<br />
After the presentation I plan to stay for some beers at the venue, so you're more than welcome to join me :) .<br />
<br />
Many thanks for Capgemini Poland for inviting me again. I really enjoyed my last visit at Capgemini Tech event where I delivered <a href="http://www.slideshare.net/hekonsek/containerize-between-docker-and-jube">"Containerize it!"</a> talk.<br />
<br />
See you!Henryk Konsekhttp://www.blogger.com/profile/09392743290349794069noreply@blogger.com3tag:blogger.com,1999:blog-2199838449876727292.post-35012475741601783542015-11-05T13:28:00.001-08:002015-11-05T13:28:45.514-08:00IoT AMQP backend in seconds (with Rhiot)<div style="box-sizing: border-box; color: #333333; font-family: "helvetica neue" , "helvetica" , "segoe ui" , "arial" , "freesans" , sans-serif; font-size: 1.5em; line-height: 1.43; margin-bottom: 16px; margin-top: 1em;">
<span style="font-size: 16px; font-weight: normal; line-height: 25.6px;">This is repost of my DZone article - <a href="https://dzone.com/articles/iot-amqp-backend-in-seconds-with-rhiot">Building an IoT AMQP Backend in Seconds With Rhiot</a>.</span></div>
<div style="box-sizing: border-box; color: #333333; font-family: "helvetica neue" , "helvetica" , "segoe ui" , "arial" , "freesans" , sans-serif; font-size: 1.5em; line-height: 1.43; margin-bottom: 16px; margin-top: 1em;">
<span style="font-size: 16px; font-weight: normal; line-height: 25.6px;">The <a href="https://en.wikipedia.org/wiki/Advanced_Message_Queuing_Protocol">AMQP</a> is becoming widely adopted as the protocol of choice the communication between </span><span style="font-size: 16px; font-weight: normal; line-height: 25.6px;">an IoT gateway and a data center. If you would like to rapidly create the AMQP backend service that can be immediately ready for your gateways and devices, the <a href="https://github.com/rhiot/rhiot/blob/master/docs/readme.md#amqp-cloudlet-quickstart">Rhiot AMQP quickstart</a> will be more than interesting for you.</span></div>
<h3 style="box-sizing: border-box; color: #333333; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 1.5em; line-height: 1.43; margin-bottom: 16px; margin-top: 1em;">
<span style="font-size: 16px; font-weight: normal; line-height: 25.6px;">The AMQP cloudlet quickstart can be used as a base for the fat-jar AMQP microservices (aka <i>cloudlets</i>). If you wanna create a simple backend application capable of exposing AMQP-endpoint and handling the AMQP-based communication, the AMQT cloudlet quickstart is the best way to start your development efforts.</span></h3>
<h2 style="box-sizing: border-box; color: #333333; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 1.25em; line-height: 1.4; margin-bottom: 16px; margin-top: 1em;">
Creating and running the AMQP cloudlet project</h2>
<div style="box-sizing: border-box; color: #333333; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6px; margin-bottom: 16px;">
In order to create the AMQP cloudlet project execute the following commands:</div>
<pre style="background-color: #f7f7f7; border-radius: 3px; box-sizing: border-box; color: #333333; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6px; font-stretch: normal; line-height: 1.45; margin-bottom: 16px; overflow: auto; padding: 16px; word-wrap: normal;"><code style="background: transparent; border-radius: 3px; border: 0px; box-sizing: border-box; display: inline; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6px; line-height: inherit; margin: 0px; max-width: initial; overflow: initial; padding: 0px; word-break: normal; word-wrap: normal;">git clone git@github.com:rhiot/quickstarts.git
cp -r quickstarts/cloudlets/amqp amqp
cd amqp
mvn install
</code></pre>
<div style="box-sizing: border-box; color: #333333; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6px; margin-bottom: 16px;">
To start the AMQP cloudlet execute the following command:</div>
<pre style="background-color: #f7f7f7; border-radius: 3px; box-sizing: border-box; color: #333333; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6px; font-stretch: normal; line-height: 1.45; margin-bottom: 16px; overflow: auto; padding: 16px; word-wrap: normal;"><code style="background: transparent; border-radius: 3px; border: 0px; box-sizing: border-box; display: inline; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6px; line-height: inherit; margin: 0px; max-width: initial; overflow: initial; padding: 0px; word-break: normal; word-wrap: normal;">java -jar target/rhiot-cloudlets-amqp-1.0.0-SNAPSHOT.jar
</code></pre>
<div style="box-sizing: border-box; color: #333333; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6px; margin-bottom: 16px;">
That is really all you need to expose the AMQP message broker to the external devices and gateways.</div>
<div style="box-sizing: border-box; color: #333333; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6px; margin-bottom: 16px;">
You can also build and run it as a Docker image (we love Docker and highly recommend this approach):</div>
<pre style="background-color: #f7f7f7; border-radius: 3px; box-sizing: border-box; color: #333333; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6px; font-stretch: normal; line-height: 1.45; margin-bottom: 16px; overflow: auto; padding: 16px; word-wrap: normal;"><code style="background: transparent; border-radius: 3px; border: 0px; box-sizing: border-box; display: inline; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6px; line-height: inherit; margin: 0px; max-width: initial; overflow: initial; padding: 0px; word-break: normal; word-wrap: normal;">TARGET_IMAGE=yourUsername/rhiot-cloudlets-amqp
mvn install docker:build docker:push -Ddocker.image.target=${TARGET_IMAGE}
docker run -it ${TARGET_IMAGE}
</code></pre>
<h2 style="box-sizing: border-box; color: #333333; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 1.25em; line-height: 1.4; margin-bottom: 16px; margin-top: 1em;">
AMQP broker</h2>
<div style="box-sizing: border-box; color: #333333; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6px; margin-bottom: 16px;">
By default AMQP cloudlet quickstart starts embedded <a href="http://activemq.apache.org/" style="box-sizing: border-box; color: #4078c0; text-decoration: none;">ActiveMQ</a> AMQP broker on 5672 port. If you would like to connect your cloudlet application to the external ActiveMQ broker (instead of starting the embedded one), run the cloudlet with the <code style="background-color: rgba(0, 0, 0, 0.0392157); border-radius: 3px; box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6px; margin: 0px; padding: 0.2em 0px;">BROKER_URL</code> environment variable or system property, for example:</div>
<pre style="background-color: #f7f7f7; border-radius: 3px; box-sizing: border-box; color: #333333; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6px; font-stretch: normal; line-height: 1.45; margin-bottom: 16px; overflow: auto; padding: 16px; word-wrap: normal;"><code style="background: transparent; border-radius: 3px; border: 0px; box-sizing: border-box; display: inline; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6px; line-height: inherit; margin: 0px; max-width: initial; overflow: initial; padding: 0px; word-break: normal; word-wrap: normal;">java -DBROKER_URL=tcp://amqbroker.example.com:61616 -jar target/rhiot-cloudlets-amqp-1.0.0-SNAPSHOT.jar
</code></pre>
<div style="box-sizing: border-box; color: #333333; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6px; margin-bottom: 16px;">
...or...</div>
<pre style="background-color: #f7f7f7; border-radius: 3px; box-sizing: border-box; color: #333333; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6px; font-stretch: normal; line-height: 1.45; margin-bottom: 16px; overflow: auto; padding: 16px; word-wrap: normal;"><code style="background: transparent; border-radius: 3px; border: 0px; box-sizing: border-box; display: inline; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6px; line-height: inherit; margin: 0px; max-width: initial; overflow: initial; padding: 0px; word-break: normal; word-wrap: normal;">docker run -e BROKER_URL=tcp://amqbroker.example.com:61616 -it yourUsername/rhiot-cloudlets-amqp
</code></pre>
<h2 style="box-sizing: border-box; color: #333333; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 1.25em; line-height: 1.4; margin-bottom: 16px; margin-top: 1em;">
Sample chat application</h2>
<div style="box-sizing: border-box; color: #333333; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6px; margin-bottom: 16px;">
The AMQP cloudlet quickstart is in fact a simple chat application. Clients can send the messages to the chat channel by subscribing to the broker and sending the messages to the <code style="background-color: rgba(0, 0, 0, 0.0392157); border-radius: 3px; box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6px; margin: 0px; padding: 0.2em 0px;">chat</code> AMQP queue.</div>
<pre style="background-color: #f7f7f7; border-radius: 3px; box-sizing: border-box; color: #333333; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6px; font-stretch: normal; line-height: 1.45; margin-bottom: 16px; overflow: auto; padding: 16px; word-wrap: normal;"><code style="background: transparent; border-radius: 3px; border: 0px; box-sizing: border-box; display: inline; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6px; line-height: inherit; margin: 0px; max-width: initial; overflow: initial; padding: 0px; word-break: normal; word-wrap: normal;">$ amqp-client -h localhost -p 5672 --topic chat "<span style="background-color: transparent; font-size: 13.6px; line-height: inherit;">Hello, this is the IoT device!"</span></code></pre>
<div>
<code style="background: transparent; border-radius: 3px; border: 0px; box-sizing: border-box; display: inline; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6px; line-height: inherit; margin: 0px; max-width: initial; overflow: initial; padding: 0px; word-break: normal; word-wrap: normal;"><br /></code></div>
<div style="box-sizing: border-box; color: #333333; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6px; margin-bottom: 16px;">
The clients can subscribe to the chat updates by listening on the <code style="background-color: rgba(0, 0, 0, 0.0392157); border-radius: 3px; box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6px; margin: 0px; padding: 0.2em 0px;">chat-updates</code> AMQP topic - whenever the new message has been sent to the chat channel, the clients registered to the <code style="background-color: rgba(0, 0, 0, 0.0392157); border-radius: 3px; box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6px; margin: 0px; padding: 0.2em 0px;">chat-updates</code> will receive the updated chat history.</div>
<pre style="background-color: #f7f7f7; border-radius: 3px; box-sizing: border-box; color: #333333; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6px; font-stretch: normal; line-height: 1.45; margin-bottom: 16px; overflow: auto; padding: 16px; word-wrap: normal;"><code style="background: transparent; border-radius: 3px; border: 0px; box-sizing: border-box; display: inline; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6px; line-height: inherit; margin: 0px; max-width: initial; overflow: initial; padding: 0px; word-break: normal; word-wrap: normal;"><span style="font-size: 13.6px; line-height: 19.72px;">$ amqp-client -h localhost -p 5672 --subscribe --topic chat-updates</span>
Hello, this is the IoT device!
I just wanted to say hello!
Hello, IoT device. Nice to meet you!</code></pre>
<div style="box-sizing: border-box; color: #333333; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6px; margin-bottom: 16px;">
<span style="background-color: #f7f7f7; font-family: "consolas" , "liberation mono" , "menlo" , "courier" , monospace; font-size: 13.6px; line-height: 19.72px; white-space: pre;"><br /></span></div>
<div style="box-sizing: border-box; color: #333333; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6px; margin-bottom: 16px;">
The quickstart also exposes the simple REST API that can be used to read the chat history using the HTTP <code style="background-color: rgba(0, 0, 0, 0.0392157); border-radius: 3px; box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6px; margin: 0px; padding: 0.2em 0px;">GET </code>request:</div>
<pre style="background-color: #f7f7f7; border-radius: 3px; box-sizing: border-box; color: #333333; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6px; font-stretch: normal; line-height: 1.45; margin-bottom: 16px; overflow: auto; padding: 16px; word-wrap: normal;"><code style="background: transparent; border-radius: 3px; border: 0px; box-sizing: border-box; display: inline; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6px; line-height: inherit; margin: 0px; max-width: initial; overflow: initial; padding: 0px; word-break: normal; word-wrap: normal;">$ curl http://localhost:8180/chat
Hello, this is the IoT device!
I just wanted to say hello!
Hello, IoT device. Nice to meet you!
</code></pre>
<h2 style="box-sizing: border-box; color: #333333; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 1.25em; line-height: 1.4; margin-bottom: 16px; margin-top: 1em;">
Architectural overview</h2>
<div style="box-sizing: border-box; color: #333333; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6px; margin-bottom: 16px;">
When AMQP cloudlet is started with the embedded ActiveMQ broker, the architecture of the example is the following:</div>
<div style="box-sizing: border-box; color: #333333; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6px; margin-bottom: 16px;">
<a href="https://github.com/rhiot/rhiot/blob/master/docs/images/quickstarts_cloudlet_amqp_embedded.png" style="box-sizing: border-box; color: #4078c0; text-decoration: none;" target="_blank"><img height="400" hspace="30" src="https://github.com/rhiot/rhiot/raw/master/docs/images/quickstarts_cloudlet_amqp_embedded.png" style="background-color: white; border: 0px; box-sizing: border-box; max-width: 100%;" /></a></div>
<div style="box-sizing: border-box; color: #333333; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6px; margin-bottom: 16px;">
When you connect to the external ActiveMQ broker (using <code style="background-color: rgba(0, 0, 0, 0.0392157); border-radius: 3px; box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6px; margin: 0px; padding: 0.2em 0px;">BROKER_URL</code> option), the architecture of the example becomes more like the following diagram:</div>
<div style="box-sizing: border-box; color: #333333; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6px; margin-bottom: 16px;">
<a href="https://github.com/rhiot/rhiot/blob/master/docs/images/quickstarts_cloudlet_amqp_external.png" style="box-sizing: border-box; color: #4078c0; text-decoration: none;" target="_blank"><img height="800" hspace="30" src="https://github.com/rhiot/rhiot/raw/master/docs/images/quickstarts_cloudlet_amqp_external.png" style="background-color: white; border: 0px; box-sizing: border-box; max-width: 100%;" /></a></div>
<div style="box-sizing: border-box; color: #333333; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6px; margin-bottom: 16px;">
<br /></div>
<h2 style="box-sizing: border-box; color: #333333; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 1.25em; line-height: 1.4; margin-bottom: 16px; margin-top: 1em;">
The quickstart code</h2>
<div style="box-sizing: border-box; color: #333333; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6px; margin-bottom: 16px;">
You may be wondering how much code do you need in order to take the advantage of the presented AMQP functionality. Below is all code used by our quickstart to handle the AMQP connectivity: </div>
<div style="box-sizing: border-box; color: #333333; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6px; margin-bottom: 16px;">
<br /></div>
<div style="box-sizing: border-box; color: #333333; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6px; margin-bottom: 16px;">
<br /></div>
<pre class="brush:java">import io.rhiot.steroids.camel.CamelBootstrap;
import java.util.LinkedList;
import java.util.List;
import static io.rhiot.steroids.activemq.EmbeddedActiveMqBrokerBootInitializer.amqpJmsBridge;
import static org.apache.commons.lang3.StringUtils.join;
public class ChatCloudlet extends CamelBootstrap {
static final List<string> chat = new LinkedList<>();
@Override
public void configure() throws Exception {
from(amqpJmsBridge("chat")).process(
exchange -> chat.add(exchange.getIn().getBody(String.class))
).process(
exchange -> exchange.getIn().setBody(join(chat, "\n"))
).to(amqpJmsBridge("topic:chat-updates"));
}
}
</string></pre>
<br />
<span style="color: #333333; font-family: "helvetica neue" , "helvetica" , "segoe ui" , "arial" , "freesans" , sans-serif; font-size: 16px; line-height: 25.6px;">And below is the code used to start the REST API mentioned before:</span><br />
<br />
<pre class="brush:java">import io.rhiot.steroids.camel.Route;
import org.apache.camel.builder.RouteBuilder;
import static org.apache.commons.lang3.StringUtils.join;
@Route
public class ChatRestApiRoutes extends RouteBuilder {
@Override
public void configure() throws Exception {
restConfiguration().component("netty4-http").host("0.0.0.0").port(8180);
rest("/chat").get().route().process(
exchange -> exchange.getIn().setBody(join(ChatCloudlet.chat, "\n"))
);
}
}
</pre>
<br />
<span style="color: #333333; font-family: "helvetica neue" , "helvetica" , "segoe ui" , "arial" , "freesans" , sans-serif; font-size: 16px; line-height: 25.6px;">As you can see, <a href="http://camel.apache.org/">Apache Camel</a> is the first class citizen in the Rhiot world. In order to make Camel connectivity easier, Rhiot comes with the static DSL methods like </span><span style="color: #333333; font-family: "helvetica neue" , "helvetica" , "segoe ui" , "arial" , "freesans" , sans-serif;"><span style="line-height: 25.6px;"><b>EmbeddedActiveMqBrokerBootInitializer.amqpJmsBridge</b> which can be used to easily create the Camel endpoints associated with the broker used by the quickstart.</span></span>Henryk Konsekhttp://www.blogger.com/profile/09392743290349794069noreply@blogger.com3tag:blogger.com,1999:blog-2199838449876727292.post-22064510533642365162015-10-29T12:25:00.001-07:002015-10-29T12:25:37.548-07:00Socialize! (join the Rhiot community)We are getting more social :) . People interested in the <a href="http://rhiot.io/">Rhiot</a> project can now use following channels to communicate with the other members of our community:<br />
<br />
<ul>
<li><a href="https://groups.google.com/forum/#!forum/rhiot">rhiot mailing list</a></li>
<li><b>#rhiot</b> channel at Freenode</li>
<li>Twitter via <a href="http://twitter.com/rhiot_io">@rhiot_io</a></li>
<li>our GitHub <a href="https://github.com/rhiot/rhiot/issues">issue tracker</a></li>
</ul>
<div>
<br /></div>
<div>
Some of us (for example myself) travel pretty much around various JVM/Tech/IoT events. I personally try to keep my twitter followers in the loop in the regards of my travel plans. And keep in mind that I always answer "yes" for coffee/beer/chat proposals :) . </div>
<div>
<br /></div>
<div>
Have I mentioned that we love contributions? If you want to hack some cool IoT stuff and donate your code to the Rhiot, so the others can benefit from it, just issue pull request. You have some ideas but, not sure where to start? Just drop us a line - we will help you!</div>
<br />
<br />
<a class="twitter-timeline" data-widget-id="657215577891717124" href="https://twitter.com/rhiot_io">Tweets by @rhiot_io</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+"://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>Henryk Konsekhttp://www.blogger.com/profile/09392743290349794069noreply@blogger.com1tag:blogger.com,1999:blog-2199838449876727292.post-36197570475375480112015-10-26T08:46:00.000-07:002015-10-26T08:46:17.264-07:00Going to EclipseCon? Come to my Camel+Kura talk!<div class="separator" style="clear: both; text-align: center;">
<a href="https://www.eclipsecon.org/na2015/sites/all/themes/eclipsecon_base/themes/ecna2015/logo.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="82" src="https://www.eclipsecon.org/na2015/sites/all/themes/eclipsecon_base/themes/ecna2015/logo.png" width="320" /></a></div>
Next Tuesday I will be at the EclipseCon EU 2015 where I will deliver <a href="https://www.eclipsecon.org/europe2015/session/team-eclipse-kura-and-apache-camel-iot-gateways">Team up! Eclipse Kura and Apache Camel for IoT Gateways</a> talk. That will be a joint talk I'm gonna give together with the <a href="http://eurotech.com/">EuroTech</a>'s Luca Dazi.<div>
<br /></div>
<div>
If you wanna catch up with me, feel free to ping me via twitter's <a href="https://twitter.com/hekonsek">@hekonsek</a>.</div>
<div>
<br /></div>
<div>
About my talk:</div>
<div>
<br /></div>
<div>
<div style="background-color: white; box-sizing: border-box; color: #464646; direction: ltr; font-family: Arial, sans-serif; font-size: 14px; line-height: 22.4px; margin-bottom: 17px; padding: 0px;">
<i>Data gathering from the field and delivery to the Cloud is a common task in IoT solutions.</i></div>
<div style="background-color: white; box-sizing: border-box; color: #464646; direction: ltr; font-family: Arial, sans-serif; font-size: 14px; line-height: 22.4px; margin-bottom: 17px; padding: 0px;">
<i>Developers find themselves struggling with field protocols on one side, and data delivery protocols on the other.</i></div>
<div style="background-color: white; box-sizing: border-box; color: #464646; direction: ltr; font-family: Arial, sans-serif; font-size: 14px; line-height: 22.4px; margin-bottom: 17px; padding: 0px;">
<i>Eclipse Kura is the Open Source M2M Software Framework of choice for IoT Gateways, and it's well known for its ease of use and flexibility, and Apache Camel is a message routing engine providing out of the box dozens of connectors to different endpoints.</i></div>
<div style="background-color: white; box-sizing: border-box; color: #464646; direction: ltr; font-family: Arial, sans-serif; font-size: 14px; line-height: 22.4px; margin-bottom: 17px; padding: 0px;">
<i>Eclipse Kura and Apache Camel, when joined together, give developers the possibility to abstract their application logic from both field protocols and data delivery, thus easing and speeding up the development process.</i></div>
<div style="background-color: white; box-sizing: border-box; color: #464646; direction: ltr; font-family: Arial, sans-serif; font-size: 14px; line-height: 22.4px; margin-bottom: 17px; padding: 0px;">
<i>This talk will show how Kura and Camel can work together, showing several examples on how to gather data from the field using Kura APIs, and how to deliver messages to several data gathering endpoints using Camel APIs.</i></div>
</div>
<div>
<br /></div>
<div>
About EclipseCon:</div>
<div>
<br /></div>
<div>
<div style="background-color: white; box-sizing: border-box; color: #464646; direction: ltr; font-family: Arial, sans-serif; font-size: 14px; line-height: 1.6; margin-bottom: 17px; padding: 0px;">
<i>EclipseCon Europe is the <a href="http://www.eclipse.org/" style="box-sizing: border-box; color: #f2931e; line-height: inherit; text-decoration: none;">Eclipse Foundation’s</a> primary European event designed to create opportunities for the European Eclipse community to learn, explore, share and collaborate on the latest ideas and information about Eclipse and its member companies.</i></div>
<div style="background-color: white; box-sizing: border-box; color: #464646; direction: ltr; font-family: Arial, sans-serif; font-size: 14px; line-height: 1.6; margin-bottom: 17px; padding: 0px;">
<i>EclipseCon is all about community. Contributors, adopters, extenders, service providers, consumers and business and research organizations gather to share their expertise and learn from each other. EclipseCon delivers networking opportunities that lead to synergies in the community, as well as opportunities to give and receive help on specific technical issues or to generate business opportunities</i></div>
</div>
Henryk Konsekhttp://www.blogger.com/profile/09392743290349794069noreply@blogger.com0tag:blogger.com,1999:blog-2199838449876727292.post-46292158600270995002015-10-22T00:04:00.000-07:002015-10-22T02:30:43.131-07:00Rhiot 0.1.2 is out<div class="separator" style="clear: both; text-align: center;">
<a href="https://github.com/rhiot/rhiot/raw/master/rhiot.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="200" src="https://github.com/rhiot/rhiot/raw/master/rhiot.png" width="132" /></a></div>
<span style="color: #333333; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6px;"><a href="http://rhiot.io/">Rhiot</a> 0.1.2 is finally out! Many thanks for <a href="https://twitter.com/levackt">Taariq Levack</a> for the awesome job he did on the new <a href="https://github.com/rhiot/rhiot/blob/master/docs/readme.md#camel-gpsd-component">GPSD Camel component</a> and <a href="https://github.com/rhiot/rhiot/blob/master/docs/readme.md#camel-webcam-component">webcam Camel component</a>.</span><br />
<span style="color: #333333; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6px;"><br /></span>
<span style="color: #333333; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6px;"><br /></span><br />
<span style="color: #333333; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6px;"><br /></span>
<span style="color: #333333; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6px;"><br /></span>
<span style="color: #333333; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6px;">What has exactly changed between Rhiot 0.1.1 and 0.1.2? Here is the complete list:</span><br />
<span style="color: #333333; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6px;"><br /></span>
<br />
<ul style="box-sizing: border-box; color: #333333; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6px; margin-bottom: 16px; margin-top: 0px; padding: 0px 0px 0px 2em;">
<li style="box-sizing: border-box;"><span style="line-height: 25.6px;">Added <a href="https://github.com/rhiot/rhiot/blob/master/docs/readme.md#camel-webcam-component">Camel webcam component</a></span></li>
<li style="box-sizing: border-box;"><span style="line-height: 25.6px;">Deprecated BU353 component on the behalf of the GPSD component</span></li>
<li style="box-sizing: border-box;">Added GPS client coordinates type converter</li>
<li style="box-sizing: border-box;">Fixed: BU353 returns "FileNotFoundException: /dev/ttyUSB0 (Device or resource busy)" </li>
<li style="box-sizing: border-box;">Rhiot now supports reading Spring Boot application.properties file</li>
<li style="box-sizing: border-box;">Renamed com.github.camellabs.iot.vertx.camel.GroovyCamelVerticle to io.rhiot.vertx.camel.GroovyCamelVerticle</li>
<li style="box-sizing: border-box;">Moved camel-kura component from com.github.camellabs to io.rhiot package</li>
<li style="box-sizing: border-box;">Device detection is performed in parallel</li>
<li style="box-sizing: border-box;">Added "scan" command to the deployer</li>
<li style="box-sizing: border-box;">Deployer now allows to specify customized fat jar</li>
<li style="box-sizing: border-box;">Deployer now downloads the same gateway version as deployer version</li>
<li style="box-sizing: border-box;">Deployer now detects devices from multiple interfaces</li>
<li style="box-sizing: border-box;">Deployer now scans OSX network interfaces</li>
<li style="box-sizing: border-box;">Device Cloudlet MongoDB connection now timeouts faster</li>
</ul>
<div>
<span style="color: #333333; font-family: Helvetica Neue, Helvetica, Segoe UI, Arial, freesans, sans-serif;"><span style="line-height: 25.6px;"><br /></span></span></div>
<div>
<span style="background-color: white; color: #333333; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6px;">Rhiot is a messaging platform for the Internet Of Things. We are focused on an adoption of the </span><a href="http://www.redhat.com/en/technologies/jboss-middleware" style="background-color: white; box-sizing: border-box; color: #4078c0; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6px; text-decoration: none;">Red Hat JBoss middleware portfolio</a><span style="background-color: white; color: #333333; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6px;"> to provide solutions to common IoT-related challenges.</span></div>
Henryk Konsekhttp://www.blogger.com/profile/09392743290349794069noreply@blogger.com1tag:blogger.com,1999:blog-2199838449876727292.post-26890064475199511302015-10-19T11:52:00.000-07:002015-10-19T11:52:03.456-07:00Rhiot about to support all GPSD-compatible GPS units<div class="separator" style="clear: both; text-align: center;">
<a href="https://github.com/rhiot/rhiot/raw/master/docs/images/rpi2_bu353_closed.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="180" src="https://github.com/rhiot/rhiot/raw/master/docs/images/rpi2_bu353_closed.jpg" width="320" /></a></div>
The <a href="https://dzone.com/articles/where-am-i-collecting-gps-data-with-apache-camel">BU353 Camel component</a> for <a href="http://rhiot.io/">Rhiot</a> has been well received in our community. I'm pretty happy to announce then that we plan to deprecated BU353 component in order to promote new, better and awesome <a href="https://github.com/rhiot/rhiot/blob/master/docs/readme.md#camel-gpsd-component">GPSD Camel component</a>. <a href="http://www.catb.org/gpsd">GPSD</a> component is available (and highly recommended to use) starting from Rhiot 0.1.2.<br />
<br />
<h3>
Why is GPSD better than BU353?</h3>
<br />
<ul>
<li>GPSD component supports <a href="http://www.catb.org/gpsd/hardware.html">all GPSD-compatible GPS units</a>, including BU353</li>
<li>GPSD component doesn't read from devices directly, but uses GPSD client and server for this prupose (so it is more reliable for concurrent access use cases) </li>
<li>GPSD Time-Position-Velocity objects can be accessed to receive the detailed GPS information (like a current speed of the device), not only GPS location coordinates</li>
<li>you can use GPSD component to read the GPS data from the remote device running GPSD server </li>
</ul>
<br />
<br />
<h3>
BU353 to GPSD migration</h3>
<br />
GPSD component is really a drop in replacement for BU353 component. You can simply change your route from...<br />
<br />
<pre style="background-color: #f7f7f7; border-radius: 3px; box-sizing: border-box; color: #333333; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6px; font-stretch: normal; line-height: 1.45; margin-bottom: 16px; overflow: auto; padding: 16px; word-wrap: normal;"><code style="background: transparent; border-radius: 3px; border: 0px; box-sizing: border-box; display: inline; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6px; line-height: inherit; margin: 0px; max-width: initial; overflow: initial; padding: 0px; word-break: normal; word-wrap: normal;">from("<b>gps-bu353</b>:current-position").
convertBodyTo(String.class).
to("file:///var/gps-coordinates");</code></pre>
...to...<br />
<br />
<pre style="background-color: #f7f7f7; border-radius: 3px; box-sizing: border-box; color: #333333; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6px; font-stretch: normal; line-height: 1.45; margin-bottom: 16px; overflow: auto; padding: 16px; word-wrap: normal;"><code style="background: transparent; border-radius: 3px; border: 0px; box-sizing: border-box; display: inline; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6px; line-height: inherit; margin: 0px; max-width: initial; overflow: initial; padding: 0px; word-break: normal; word-wrap: normal;">from("<b>gpsd</b>:current-position").
convertBodyTo(String.class).
to("file:///var/gps-coordinates");</code></pre>
Spot the difference ;) .<br />
<br />
<h3>
Special thanks</h3>
Many thanks go to <a href="https://twitter.com/levackt">Taariq Levack</a>, our brand new Rhiot committer, who authored this new component. Taariq, you rock :) .Henryk Konsekhttp://www.blogger.com/profile/09392743290349794069noreply@blogger.com0tag:blogger.com,1999:blog-2199838449876727292.post-37140116123331434252015-09-30T13:31:00.000-07:002015-09-30T13:32:19.323-07:00Meet me at the ApacheCon Core EU 2015 <div class="separator" style="clear: both; text-align: center;">
<a href="http://www.softaculous.com/website/images/ampps/apache.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="http://www.softaculous.com/website/images/ampps/apache.png" /></a></div>
This Friday I will be speaking at the <a href="http://events.linuxfoundation.org/events/apachecon-core-europe">ApacheCon EU 2015</a>, in Budapest. The even takes place at the same venue as a year before i.e. at lovely <a href="http://www.corinthia.com/hotels/budapest/">Corinthia Hotel Budapest</a>. I will be giving two IoT related talks:<br />
<br />
<ul>
<li>"<a href="https://apacheconcore2015.sched.org/event/ff31e3180f25a8d0d2058bc53f602902#.VgxENK1StBc">Camel and the things</a>" together with <a href="https://twitter.com/geertschuring">Geert Schuring</a> at 10:00</li>
<li>"<a href="https://apacheconcore2015.sched.org/event/27b80ab17f9172cc0bac90765941ea3f#.VgxELq1StBc">The IoT Gateway Dream Team: Eclipse Kura & Apache Camel</a>" at 12:20</li>
</ul>
<div>
<br /></div>
<div>
I will be in Budapest for Thursday and Friday. If you are at the Budapest at this time, feel free to drop me a line!</div>
<div>
<br /></div>
<div>
<b>About ApacheCon Core:</b></div>
<div>
<i>Core will bring together the open source community to learn about and collaborate on the technologies and projects driving the future of open source, web technologies and cloud computing. Apache projects have and continue to be hugely influential in the innovation and development of software development across a plethora of categories from content, databases and servers, to big data, cloud, mobile and virtual machine. The developers, programmers, committers and users driving this innovation and utilizing these tools will meet in Budapest, October 1 & 2, for collaboration, education and community building.</i></div>
Henryk Konsekhttp://www.blogger.com/profile/09392743290349794069noreply@blogger.com0tag:blogger.com,1999:blog-2199838449876727292.post-66789480556541700632015-09-28T13:40:00.000-07:002015-09-28T13:40:15.556-07:00Rhiot quickstarts - getting into the IoT really fast!<div style="box-sizing: border-box; color: #333333; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6px; margin-bottom: 16px;">
<a href="https://github.com/rhiot/rhiot" style="box-sizing: border-box; color: #4078c0; text-decoration: none;"><img align="left" height="280" hspace="30" src="https://github.com/rhiot/rhiot/raw/master/rhiot.png" style="border: 0px; box-sizing: border-box; max-width: 100%;" /></a></div>
<div style="box-sizing: border-box; color: #333333; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6px; margin-bottom: 16px;">
The goal of the <a href="http://rhiot.io/">Rhiot</a> project is to allow the developers to create the Internet Of Things projects as easily as possible. We want to make the complex IoT projects simpler and bring the fun to the IoT world, while preserving all the benefits the developers can gain from the rich <a href="http://www.redhat.com/en/technologies/jboss-middleware">Red Hat JBoss Middleware portfolio</a>. </div>
<div style="box-sizing: border-box; color: #333333; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6px; margin-bottom: 16px;">
Keeping Rhiot philosophy in mind, we decided to start releasing the <b>quickstarts</b> - the set of the base projects that can be used as a building blocks for the IoT solution. <a href="https://github.com/rhiot/quickstarts"><span style="color: #4078c0;"><span style="box-sizing: border-box; line-height: 25.6px;">Rhiot</span></span><span style="line-height: 25.6px;"> </span></a><span style="line-height: 25.6px;"><a href="https://github.com/rhiot/quickstarts">quickstarts</a> can be copied and used as the template for your IoT solution.</span></div>
<div style="box-sizing: border-box; color: #333333; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6px; margin-bottom: 16px;">
The programming model we have chosen for Rhiot quickstarts revolves around <a href="http://camel.apache.org/" style="box-sizing: border-box; color: #4078c0; text-decoration: none;">Camel</a> and <a href="http://vertx.io/" style="box-sizing: border-box; color: #4078c0; text-decoration: none;">Vert.x</a>. Camel routes are our primary choice for the expression of the endpoint connectivity and message routing. So starting embedded MQTT ActiveMQ broker and connecting to it might be as simple as using the following Groovy snippet:
<pre class="brush:groovy">
class MyMqttApp extends CamelBootstrap {
void configure() {
from(mqtt('topic')).log('Received ${body}')
}
}
</pre>
Vert.x verticles and event bus are also the first class citizen in all the Rhiot applications. So Rhiot can help you with detecting Vert.x verticles or make it as easy to connect to the event bus as:
<pre class="brush:groovy">
class MyMqttApp extends CamelGroovyVerticle {
void configure() {
eventBus('temperature').to(mqtt('temperature'))
}
}
</pre>
Looks interesting? More details about Rhiot API and quickstarts soon to come!
</div>
Henryk Konsekhttp://www.blogger.com/profile/09392743290349794069noreply@blogger.com0tag:blogger.com,1999:blog-2199838449876727292.post-73528118323448770342015-09-22T09:25:00.001-07:002015-09-25T01:25:42.352-07:00IoT server platform emerging at Eclipse<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://eclipse.org/eclipse.org-common/themes/solstice/public/images/logo/eclipse-800x188.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="75" src="https://eclipse.org/eclipse.org-common/themes/solstice/public/images/logo/eclipse-800x188.png" width="320" /></a></div>
Recently at the <a href="http://iot.eclipse.org/working-group/">Eclipse IoT Working</a> group mailing lists one of our members <a href="https://dev.eclipse.org/mhonarc/lists/iot-wg/msg00519.html">raised the proposal</a> to collaborate on the server-side platform specification.<br />
<br />
Why this proposal is so important? Because it may result in the creation of the core engine for the IoT backend services that might become a kind of standard, as there are several companies interested in participating in the project.<br />
<br />
I'm definitely <a href="https://dev.eclipse.org/mhonarc/lists/iot-wg/msg00525.html">interested in getting involved</a> into that initiative. Tomorrow I will be presenting the Rhiot project to the Eclipse IoT Working Group, so the other members can see how <a href="http://rhiot.io/">Rhiot</a> and that emerging platform could overlap.<br />
<br />
I highly recommend to track the minutes published on the <a href="https://dev.eclipse.org/mhonarc/lists/iot-wg/">Eclipse IoT Working Group mailing lists</a>. The emerging Eclipse platform can be a big thing!<br />
<br />
BTW Wondering who is the part of the Eclipse IoT Working Group? EuroTech, IBM, Red Hat, Cisco, Bosch, Sierra Wireless, Canonical, Huawei, Verisign, to mention some of them.<br />
<br />
<br />
<iframe allowfullscreen="" frameborder="0" height="355" marginheight="0" marginwidth="0" scrolling="no" src="//www.slideshare.net/slideshow/embed_code/key/AAEyGiGrgucr7s" style="border-width: 1px; border: 1px solid #CCC; margin-bottom: 5px; max-width: 100%;" width="425"> </iframe> <br />
<div style="margin-bottom: 5px;">
<strong> <a href="https://www.slideshare.net/hekonsek/ultra-quick-rhiot-overview" target="_blank" title="(Ultra quick) Rhiot overview">(Ultra quick) Rhiot overview</a> </strong> from <strong><a href="https://www.slideshare.net/hekonsek" target="_blank">Henryk Konsek</a></strong> </div>
Henryk Konsekhttp://www.blogger.com/profile/09392743290349794069noreply@blogger.com2tag:blogger.com,1999:blog-2199838449876727292.post-34259309888563989132015-09-14T23:44:00.001-07:002015-09-14T23:47:11.598-07:00Rhiot 0.1.1 is out<div class="separator" style="clear: both; text-align: center;">
<a href="https://raw.githubusercontent.com/rhiot/rhiot/master/rhiot.png" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="320" src="https://raw.githubusercontent.com/rhiot/rhiot/master/rhiot.png" width="212" /></a></div>
<span style="font-family: Georgia, Times New Roman, serif;">On the behalf of Rhiot team, I'm happy to announce that <a href="https://github.com/rhiot/rhiot/blob/master/docs/release-notes.md#011">Rhiot 0.1.1</a> has been released. It's been a while since efforts related to rebranding the project from <a href="http://henryk-konsek.blogspot.com/2015/07/lets-start-rhiot.html">Camel Labs to Rhiot</a> have been holding our release train.</span><br />
<span style="font-family: Georgia, Times New Roman, serif;"><br />
What has changed in the latest Rhiot?</span><br />
<span style="font-family: Georgia, Times New Roman, serif;"><br />
</span><br />
<ul style="box-sizing: border-box; color: #333333; line-height: 25.6000003814697px; margin-bottom: 16px; margin-top: 0px; padding: 0px 0px 0px 2em;">
<li style="box-sizing: border-box;"><span style="font-family: Georgia, Times New Roman, serif;">Changed project name from <em style="box-sizing: border-box;">Camel Labs</em> to <em style="box-sizing: border-box;">Rhiot.</em></span></li>
<li style="box-sizing: border-box;"><span style="font-family: Georgia, Times New Roman, serif;">Added <a href="https://github.com/rhiot/rhiot/blob/master/docs/readme.md#dockerized-rhiot-cloud" style="box-sizing: border-box; color: #4078c0; text-decoration: none;">Dockerized Rhiot Cloud</a>.</span></li>
<li style="box-sizing: border-box;"><span style="font-family: Georgia, Times New Roman, serif;">Added <a href="https://github.com/rhiot/rhiot/blob/master/docs/readme.md#device-management-cloudlet" style="box-sizing: border-box; color: #4078c0; text-decoration: none;">device management cloudlet</a>.</span></li>
<li style="box-sizing: border-box;"><span style="font-family: Georgia, Times New Roman, serif;">Added web UI (aka <a href="https://github.com/rhiot/rhiot/blob/master/docs/readme.md#device-management-web-ui" style="box-sizing: border-box; color: #4078c0; text-decoration: none;">Cloudlet Console</a>).</span></li>
<li style="box-sizing: border-box;"><span style="font-family: Georgia, Times New Roman, serif;">Created <a href="http://rhiot.net/" style="box-sizing: border-box; color: #4078c0; text-decoration: none;">Rhiot Cloud demo site</a>.</span></li>
<li style="box-sizing: border-box;"><span style="font-family: Georgia, Times New Roman, serif;">Added <a href="https://github.com/rhiot/rhiot/blob/master/docs/readme.md#camel-gps-bu353-component" style="box-sizing: border-box; color: #4078c0; text-decoration: none;">camel-gps-bu353</a> component.</span></li>
<li style="box-sizing: border-box;"><span style="font-family: Georgia, Times New Roman, serif;">Migrated <a href="https://github.com/rhiot/rhiot/blob/master/docs/readme.md#camel-iot-gateway" style="box-sizing: border-box; color: #4078c0; text-decoration: none;">Gateway</a> core from Spring Boot to Vert.x.</span></li>
<li style="box-sizing: border-box;"><span style="font-family: Georgia, Times New Roman, serif;"><a href="https://github.com/rhiot/rhiot/blob/master/docs/readme.md#monitoring-gateway-with-jolokia" style="box-sizing: border-box; color: #4078c0; text-decoration: none;">Gateway should start Jolokia REST API on port 8778, not 8080</a>.</span></li>
<li style="box-sizing: border-box;"><span style="font-family: Georgia, Times New Roman, serif;">Releasing <a href="https://github.com/rhiot/rhiot/blob/master/docs/readme.md#camel-iot-gateway" style="box-sizing: border-box; color: #4078c0; text-decoration: none;">Gateway</a> core and application artifacts separately.</span></li>
<li style="box-sizing: border-box;"><span style="font-family: Georgia, Times New Roman, serif;">Renamed <code style="background-color: rgba(0, 0, 0, 0.0392157); border-radius: 3px; box-sizing: border-box; font-size: 13.6000003814697px; margin: 0px; padding: 0.2em 0px;">camellabs.iot.gateway.heartbeat.rate property</code> to <code style="background-color: rgba(0, 0, 0, 0.0392157); border-radius: 3px; box-sizing: border-box; font-size: 13.6000003814697px; margin: 0px; padding: 0.2em 0px;">camellabs_iot_gateway_heartbeat_rate</code>.</span></li>
<li style="box-sizing: border-box;"><span style="font-family: Georgia, Times New Roman, serif;">Gateway <a href="https://github.com/rhiot/rhiot/blob/master/docs/readme.md#gateway-logger-configuration" style="box-sizing: border-box; color: #4078c0; text-decoration: none;">deletes logs after N megabytes limit is exceeded</a>.</span></li>
<li style="box-sizing: border-box;"><span style="font-family: Georgia, Times New Roman, serif;">Gateway <a href="https://github.com/rhiot/rhiot/blob/master/docs/readme.md#configuration-of-the-gateway" style="box-sizing: border-box; color: #4078c0; text-decoration: none;">reads properties from the <code style="background-color: rgba(0, 0, 0, 0.0392157); border-radius: 3px; box-sizing: border-box; font-size: 13.6000003814697px; margin: 0px; padding: 0.2em 0px;">/etc/default/camel-labs-iot-gateway</code></a>.</span></li>
</ul>
<div>
<br /></div>
Henryk Konsekhttp://www.blogger.com/profile/09392743290349794069noreply@blogger.com2tag:blogger.com,1999:blog-2199838449876727292.post-2093744041749003762015-07-30T07:57:00.003-07:002015-07-30T12:45:28.703-07:00Let's start the rhiot!As many of you probably already know, in the recent months I've been hooked on the Internet Of Thing in general, and creating the rocking Internet Of Things messaging platform in particular. My R&D activities have been revolving around the adoption of the awesome <a href="http://www.redhat.com/en/technologies/jboss-middleware">Red Hat JBoss middleware portfolio</a> to the IoT needs. Me, and the other folks interested in the adoption of the projects like Apache Camel or ActiveMQ to the IoT challanges, joined our forces to create the <a href="http://henryk-konsek.blogspot.com/2015/04/camel-iot-labs-project-arrived.html">Camel IoT Labs project</a>.<br />
<br />
As the Camel IoT Labs project scope is really wider than the scope of the Camel itself, we decided to give up the old project name. Instead we would like to come up with something that would reflect the fact that we are working on the project with the bigger IoT messaging platform picture in mind.<br />
<br />
We decided to go with renaming the project to <b>rhiot</b> (pronounced like <i>riot</i>). Our new name hides the <i>Red Hat</i> and <i>IoT</i> in it - which is fine, because we want to stress that our IoT project relies on the rock solid Red Hat software portfolio as its foundation. Starting from today we will be gradually migrating our Camel Labs to new Rhiot name. That will include moving our GitHub project to the new <a href="https://github.com/rhiot">rhiot organization</a> and changing our Maven coordinates from <i>com.github.camellabs</i> to <i>io.rhiot</i>.<br />
<br />
I'm also thrilled to say that Red Hat decided to sponsor some R&D activities around the new Rhiot project. So stay tuned and expect amazing IoT stuff coming from the Rhiot team. Also keep in mind that we have really open policy regarding accepting new contributors for our project - if you want to help us to create <i style="font-weight: bold;">the</i> IoT messaging platform, you know where to find me :) .Henryk Konsekhttp://www.blogger.com/profile/09392743290349794069noreply@blogger.com0tag:blogger.com,1999:blog-2199838449876727292.post-77612562492882555112015-07-29T08:02:00.002-07:002015-07-29T08:02:32.101-07:00Where am I? Collecting GPS data with Apache Camel<i>This is the re-post of my article <a href="https://dzone.com/articles/where-am-i-collecting-gps-data-with-apache-camel">Where Am I? Collecting GPS Data With Apache Camel</a> originally posted at the DZone.</i><br />
<br />
One of the most popular requirement for the field devices used in the IoT systems is to provide the current GPS location of that device and send this information to the data center. In hereby article I will tell you how <a href="http://camel.apache.org/">Apache Camel</a> can turn full-stack Linux microcomputer (like Raspberry Pi) into the device collecting the GPS coordinates.
<br />
<br />
<h2>
Which GPS unit should I choose?</h2>
There is a myriad of the GPS receivers available in the market. <a href="http://usglobalsat.com/p-688-bu-353-s4.aspx#images/product/large/688_2.jpg">BU353</a> is one of the most popular and the
cheapest GPS units. It can be connected to the computer device via the USB port. If you are looking for good and cheap
GPS receiver for your IoT solution, you should definitely consider purchasing this unit.
<br />
<br />
The picture below presents the BU353 connected to the Raspberry Pi device via the USB port.
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj7FD9c6LksVn7zbXZQjI2IyOAq9T_YcUtVqhrrE0B4pwqYswAXd6LqNcWn1lHoSBsf1FbZU00M4tu6C5CmiD7CpWmGd9oao4RSZoNTTBcaj02kuLzo-NTOuO_IPeeUiIthZG3SnBt2OcL6/s1600/20150706_191705.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj7FD9c6LksVn7zbXZQjI2IyOAq9T_YcUtVqhrrE0B4pwqYswAXd6LqNcWn1lHoSBsf1FbZU00M4tu6C5CmiD7CpWmGd9oao4RSZoNTTBcaj02kuLzo-NTOuO_IPeeUiIthZG3SnBt2OcL6/s640/20150706_191705.jpg" /></a></div>
You can optionally equip your Pi into the external mobile battery, like <a href="http://www.goodram.com/product/accessories/goodram-power-bank-p661/">GOODRAM Power Bank P661</a>. Equipped with the external power supply you can take your mobile GPS system to the car or into the outdoors. Battery significantly simplifies testing "in the field" part of your solution.
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjvMLm-BfUua5q24a0Hm-XkG4X982ZdqzcnPcn2Z_SS4x6U8hxA6Y1y6PfmW8I88kG2MwTjhfq9XoF-cEmdGKEnHAVo1A7U-9mpEECT0Ce8O91x2z8KSVRCbOO7SBXABR0LMvoSGZu6U0gj/s1600/20150706_191801.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjvMLm-BfUua5q24a0Hm-XkG4X982ZdqzcnPcn2Z_SS4x6U8hxA6Y1y6PfmW8I88kG2MwTjhfq9XoF-cEmdGKEnHAVo1A7U-9mpEECT0Ce8O91x2z8KSVRCbOO7SBXABR0LMvoSGZu6U0gj/s640/20150706_191801.jpg" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmihNTalBEjxB3hxUYe9latT8qJY7QmAGZtOtZ47HS9Suv-qaYTVEr-lzWl-9jfA10hgAAX5pufB8eZklbLW8Vend-koJp9O0V9u1_4wH0sXyVuTeCuv-GTHtr_KfNvyqLAK5NH77Nbyg3/s1600/20150706_191818.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmihNTalBEjxB3hxUYe9latT8qJY7QmAGZtOtZ47HS9Suv-qaYTVEr-lzWl-9jfA10hgAAX5pufB8eZklbLW8Vend-koJp9O0V9u1_4wH0sXyVuTeCuv-GTHtr_KfNvyqLAK5NH77Nbyg3/s640/20150706_191818.jpg" /></a></div>
<br />
<br />
<h2>
How can Camel help me?</h2>
<a href="https://github.com/camel-labs/camel-labs/tree/master/iot#camel-gps-bu353-component">Camel GPS BU353 component</a> can be used to read the current GPS information from that device. With Camel GPS BU353 you can
just connect the receiver to your computer's USB port and read the GPS data - the component
will make sure that GPS daemon is up, running and
switched to the <a href="http://www.gpsinformation.org/dale/nmea.htm">NMEA mode</a>. The component also takes care of parsing the
NMEA data read from the serial port, so you can enjoy the GPS data wrapped into the <i>com.github.camellabs.iot.component.gps.bu353.ClientGpsCoordinates</i> POJO
objects (which in turn are forwarded to your Camel routes).
<br />
<br />
<h2>
Show me the code</h2>
In order to take advantage of the Camel GPS BU353 you have to add the following dependency to your Maven project:<br />
<pre class="brush:xml"> <dependency>
<groupId>com.github.camel-labs</groupId>
<artifactId>camel-gps-bu353</artifactId>
<version>0.1.1</version>
</dependency>
</pre>
BU353 component supports only consumer endpoints - it makes sense as GPS component is used to read, not write, GPS data. The BU353 consumer is the polling one, i.e. it periodically asks the GPS device for the
current coordinates. The Camel endpoint URI format for the BU353 consumer is as follows:
<br />
<pre> gps-bu353:label
</pre>
Where <b>label</b> can be replaced with any text label:
<br />
<pre class="brush:java"> from("gps-bu353:current-position").
to("file:///var/gps-coordinates");
</pre>
The Camel route presented above reads the current GPS coordinates every 5 seconds and saves these into the <b>/var/gps-coordinates</b> directory. Each GPS coordinates pair is saved into the dedicated file. The complete runnable example of the route above is presented in the code snippet below. I use <a href="http://camel.apache.org/spring-boot.html">Camel Spring Boot support</a> to start the Camel context and load the route definition:
<br />
<pre class="brush:java">@SpringBootApplication
public class GpsReader extends FatJarRouter {
public void configure() throws Exception {
from("gps-bu353:current-position").
to("file:///var/gps-coordinates");
}
}
</pre>
BU353 consumer receives the <i>com.github.camellabs.iot.component.gps.bu353.ClientGpsCoordinates</i> instances. <i>ClientGpsCoordinates</i> class is a convenient POJO wrapper around the GPS data:
<br />
<pre class="brush:java"> ConsumerTemplate consumerTemplate = camelContext.createConsumerTemplate();
ClientGpsCoordinates currentPosition =
consumerTemplate.receiveBody("gps-bu353:current-position", ClientGpsCoordinates.class);
String deviceId = currentPosition.clientId();
Date taken = currentPosition.timestamp();
double latitude = currentPosition.lat();
double longitude = currentPosition.lng();
</pre>
<i>ClientGpsCoordinates</i> class name is prefixed with the <b>Client</b> keyword to indicate that these coordinates have been created on the device,
not on the server side of the IoT solution.
<br />
<br />
<h2>
Process manager</h2>
Process manager is used by the BU353 component to execute Linux commands responsible for starting GPSD daemon and
configuring the GPS receiver to provide GPS coordinates in the NMEA mode. If for some reason you would like to change
the default implementation of the process manager used by Camel (i.e. <i>com.github.camellabs.iot.utils.process.DefaultProcessManager</i>),
you can set it on the component level:
<br />
<pre class="brush:java"> GpsBu353Component bu353 = new GpsBu353Component();
bu353.setProcessManager(new CustomProcessManager());
camelContext.addComponent("gps-bu353", bu353);
</pre>
If the custom process manager is not set on the component, Camel will try to find the manager instance in the
<a href="http://camel.apache.org/registry.html">registry</a>. So for example for the Spring application, you can just configure
the manager as the bean:
<br />
<pre class="brush:java"> @Bean
ProcessManager myProcessManager() {
new CustomProcessManager();
}
</pre>
The custom process manager may be useful if for some reasons your Linux distribution requires executing some unusual commands
in order to make the GPSD up and running.
<br />
<br />
<h2>
What's next?</h2>
Do geographical capabilities of the Camel seem compelling to you? Then you should also <a href="http://camel.apache.org/geocoder.html">Camel Geocoder component</a> which can be used to easily convert GPS coordinates collected via Camel into the human readable street address. Also stay tuned for the geofencing features coming soon to the <a href="https://github.com/camel-labs/camel-labs">Camel IoT Labs project</a>.Henryk Konsekhttp://www.blogger.com/profile/09392743290349794069noreply@blogger.com6tag:blogger.com,1999:blog-2199838449876727292.post-59470137671231184442015-07-23T23:13:00.001-07:002015-07-31T09:55:03.044-07:00Measuring the throughput of the IoT gateways The key part of the process of tailoring the perfect IoT solution is choosing the proper hardware for the gateway device.
In general the more expensive gateway hardware is, the more messages per second you can process. However the more
expensive the gateway device is, the less affordable your IoT solution becomes for the end client. That is the main
reason why would you like to have a proper tool for measuring the given IoT messages flow scenario in the unified way,
on multiple devices.<br />
<br />
<br />
<h3>
Camel Labs Performance Testing Framework</h3>
<a href="https://github.com/camel-labs/camel-labs">Camel IoT Labs</a> comes with the <a href="https://github.com/camel-labs/camel-labs/tree/master/iot#performance-testing-framework">Performance Testing Framework</a> that can be used to define the hardware profiles and
test scenarios. Performance framework takes care of detecting the devices connected to your local network, deploying the
test application into these, executing the actual tests and generating the results as the human-readable chart. For example the sample output for the MQTT QOS testing could generate the following diagram:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjU0P8rC3t4q7Lws1wyMnffFSqwDflaj6h9coXQ4Wj9lNJaXqhkjl5j8exBBg0wXAIYbvgTyiXfXS3zVbfJ4sZs233s14Y_CUghZmkjuWO-YEKF0XxwtyxzRVPQ7LXK189VpsH5QaYq8FeY/s1600/RPI2+Mock+sensor+to+external+MQTT+broker.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="480" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjU0P8rC3t4q7Lws1wyMnffFSqwDflaj6h9coXQ4Wj9lNJaXqhkjl5j8exBBg0wXAIYbvgTyiXfXS3zVbfJ4sZs233s14Y_CUghZmkjuWO-YEKF0XxwtyxzRVPQ7LXK189VpsH5QaYq8FeY/s640/RPI2+Mock+sensor+to+external+MQTT+broker.png" width="640" /></a></div>
<br />
<br />
<h3>
When to use Performance Testing Framework</h3>
Performance Testing Framework excels when you would like to answer the following question - <i>how the different field hardware setups
perform against the given task</i>. And to answer that question just connect your devices to the local network, execute the performance testing application
and compare the generated diagrams.<br />
<br />
Here is the 30 seconds video guide demonstrating how easy it is to perform the test:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen="" class="YOUTUBE-iframe-video" data-thumbnail-src="https://i.ytimg.com/vi/ZJZiP0X6TgM/0.jpg" frameborder="0" height="266" src="https://www.youtube.com/embed/ZJZiP0X6TgM?feature=player_embedded" width="320"></iframe></div>
<br />
<br />
<br />
<h3>
Hardware profiles</h3>
This section covers the <i>hardware profiles</i> for the performance tests. Profiles are used to describe the particular
hardware configuration that can be used as a target device for the performance benchmark. Every performance test definition can be executed on the particular hardware profiles.<br />
<br />
The example of the hardware profile can be <b>Raspberry PI 2 B+</b> (aka <b>RPI2</b>). The <b>RPI2</b> hardware profile is just the <a href="https://www.raspberrypi.org/blog/raspberry-pi-2-on-sale/">Raspberry Pi 2 B+</a> model equipped with the network connector (WiFi adapter or
the ethernet cable). Currently we assume that the device is running <a href="https://www.raspbian.org/">Raspbian</a> operating
system (version 2015-05-05).<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhhC_rIOaFUdnpXirLsIkZHH6qJ8DZYvVkpd6Msl_XB0r4B3mp7V-QpERoipamW2fY6Hl88WHfdYo2O-iHlq2JdkxEJl3J-BpOfakDIQWWqxGrRq5NCV3mM6y_lpvUvegBeN1OJzOJMJGHd/s1600/rpi2_closed.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="640" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhhC_rIOaFUdnpXirLsIkZHH6qJ8DZYvVkpd6Msl_XB0r4B3mp7V-QpERoipamW2fY6Hl88WHfdYo2O-iHlq2JdkxEJl3J-BpOfakDIQWWqxGrRq5NCV3mM6y_lpvUvegBeN1OJzOJMJGHd/s640/rpi2_closed.jpg" width="360" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhVx-SApcXvF31KK5lEEbJ6b03f5JV2PJ9EQu5d8VX_MEm-G6TXhPZjTFfTPX8RBwtmMfNEI3kLc-AVanv2yuXsHGd-4c8Ni_vWb3XKieybfzacver-uFL4sN8KkPIjp0IO2UPFBFh9hcUq/s1600/rpi2_open.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="640" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhVx-SApcXvF31KK5lEEbJ6b03f5JV2PJ9EQu5d8VX_MEm-G6TXhPZjTFfTPX8RBwtmMfNEI3kLc-AVanv2yuXsHGd-4c8Ni_vWb3XKieybfzacver-uFL4sN8KkPIjp0IO2UPFBFh9hcUq/s640/rpi2_open.jpg" width="360" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<br />
<br />
<br />
The other profile we defined for the Camel Labs is the Raspberry is the PI 2 B+ with BU353 (aka <b>RPI2_BU353</b>)
The <b>RPI2_BU353</b> hardware profile is the same as <b>RPI2</b> profile, but additionally equipped with the <a href="http://usglobalsat.com/p-688-bu-353-s4.aspx#images/product/large/688_2.jpg">BU353 GPS receiver</a> plugged into the USB port.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEihZEwCfhbnNuHebLRblAk7EaX7Lxgk85HogRgi3VjomppzoWfzRpbcPWHruHpjGCSc4HLoGHrUL-W_G44a3Ba__Zh7GEf7VmArMvfPf2tNojjzKhTsSZjdJEtzvd2H_lTh77V2sXjbWRYU/s1600/rpi2_bu353_closed.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="360" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEihZEwCfhbnNuHebLRblAk7EaX7Lxgk85HogRgi3VjomppzoWfzRpbcPWHruHpjGCSc4HLoGHrUL-W_G44a3Ba__Zh7GEf7VmArMvfPf2tNojjzKhTsSZjdJEtzvd2H_lTh77V2sXjbWRYU/s640/rpi2_bu353_closed.jpg" width="640" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj833rMsly0VF9jYqHl40vTMysMqBPCLjC73hGcWgJ6955dSxnIpZtyzRIQw0pXAtE9pGsj0c3GGTuhRoxvqsBZglKoxwATpi4AE0K7Tc0jKsfrNHF0RbBVLVrsEKnsrEp4MXU-DEKHyi_M/s1600/rpi2_bu353_open.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="360" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj833rMsly0VF9jYqHl40vTMysMqBPCLjC73hGcWgJ6955dSxnIpZtyzRIQw0pXAtE9pGsj0c3GGTuhRoxvqsBZglKoxwATpi4AE0K7Tc0jKsfrNHF0RbBVLVrsEKnsrEp4MXU-DEKHyi_M/s640/rpi2_bu353_open.jpg" width="640" /></a></div>
<br />
<br />
<h3>
Running the performance tester </h3>
The easiest way to run the performance benchmark is to connect the target device (for example Rapsberry Pi) into your local network (for example via the WiFi or the Ethernet cable) and start the tester as a Docker container, using the following command:<br />
<br />
<pre class="brush:bash">docker run -v=/tmp/gateway-performance:/tmp/gateway-performance --net=host camellabs/performance-of RPI2
</pre>
<br />
Keep in mind that <b>RPI2</b> can be replaced with the other supported hardware profile (like <b>RPI2_BU353</b>). The performance
tester detects the tests that can be executed for the given hardware profile, deploys the gateway software to the target
device, executes the tests and collects the results.
When the execution
of the benchmark ends, the result diagrams will be located in the <b>/tmp/gateway-performance</b> directory (or any other
directory you specified when executing the command above). The sample diagram may look as follows:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhbm9i2gYgYFWTZp8-7d1h-aMjSSXvbDvo6vLUpjUs4Es_g7pN25HisitfvSADaaPizBP4FsKEbPLPlfH4r0aZFMJXojmEM706uui7BeSKHETVxSn97BGV5QHTu-Swk6HeTEtPs4EFEDK7L/s1600/Mock+sensor+to+external+MQTT+broker.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="480" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhbm9i2gYgYFWTZp8-7d1h-aMjSSXvbDvo6vLUpjUs4Es_g7pN25HisitfvSADaaPizBP4FsKEbPLPlfH4r0aZFMJXojmEM706uui7BeSKHETVxSn97BGV5QHTu-Swk6HeTEtPs4EFEDK7L/s640/Mock+sensor+to+external+MQTT+broker.png" width="640" /></a></div>
<br />
<br />
<br />
Keep in mind that currently we assume that your Raspberry Pi has default Raspbian SSH account available (username: <i>pi</i> / password: <i>raspberry</i>).<br />
<br />
<h3>
Future of the framework</h3>
I plan to develop the gateway Performance Testing Framework to make it <i>the</i> tool for the sizing of the IoT gateways. In particular I plan do add more benchmarks and supported hardware profiles. The performance framework is also a great tool to perform the fully automated end-to-end integration tests on the real hardware - I would definitely like to see the PTF as the tool for running Jenkins-based integration tests executed on the real devices.<br />
<br />Henryk Konsekhttp://www.blogger.com/profile/09392743290349794069noreply@blogger.com0tag:blogger.com,1999:blog-2199838449876727292.post-57045089550850353872015-07-23T00:36:00.004-07:002015-07-23T00:36:51.823-07:00Over-the-air runtime updates of the IoT gateways<i>This is the repost of my article originally published at the DZone - <a href="https://dzone.com/articles/over-air-runtime-updates-iot">Over-the-Air Runtime Updates of the IoT Gateways</a>.</i><br />
<br />
The Internet Of Things gateways are usually installed on the devices designed to run for a longer periods of time without the downtime. The is common requirement for the gateway to keep the uninterrupted processing of the messages collected from the field, even when configuration changes have to be applied to the device. While in the Java world the OSGi technology has been commonly identified with the hot redeploy features, I would like to tell you more about the possibilities that <a href="http://camel.apache.org/">Apache Camel</a> running outside the OSGi environment can bring into this topic.<br />
<br />
<br />
<h3>
Adding new components at runtime</h3>
<br />
Apache Camel relies on the <a href="http://camel.apache.org/components.html">components</a> to provide the connectors which can be used to consume messages from the various endpoints (as well as send the messages to the endpoints). For example the gateway based on the Apache Camel could use <a href="http://camel.apache.org/paho.html">Paho MQTT component</a> to consume the control commands from the data center and at the same time use the <a href="http://camel.apache.org/netty-http.html">Netty component</a> to communicate with the backed REST services.<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmM8jmCBypFmvHuG1BHweyshwz1sHK9Yi1B8w8bLS_xnGVG8IlrjRWOjGL2y1fznbIwbEy-5bpV5GAC33OIO4FftH1vPqtz4S5nOYQcs0IHfn7cMLEmuGX9MeYMQI0xBkRWaShT47Ztnuq/s1600/fabric_docker.png" imageanchor="1"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmM8jmCBypFmvHuG1BHweyshwz1sHK9Yi1B8w8bLS_xnGVG8IlrjRWOjGL2y1fznbIwbEy-5bpV5GAC33OIO4FftH1vPqtz4S5nOYQcs0IHfn7cMLEmuGX9MeYMQI0xBkRWaShT47Ztnuq/s700/fabric_docker.png" /></a><br />
<br />
Now imagine that at some point we decided to add Salesforce component to our Gateway, so the copy of the message we sent to the backend REST service can be also sent directly to our Salesforce account.<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZNLzYwiPqdQU4c6DKchm1hO39eI_1l7zM7xzHaELvFwd4HlAwg0iSL73heUfzMnV56bfjD5w83rvrADvClwrnUSg3RSBfmuRj8Etp-eWozbywyHisiBsW8XxYBaBUhTdwTetQExfhRdyx/s1600/fabric_docker+%25281%2529.png" imageanchor="1"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZNLzYwiPqdQU4c6DKchm1hO39eI_1l7zM7xzHaELvFwd4HlAwg0iSL73heUfzMnV56bfjD5w83rvrADvClwrnUSg3RSBfmuRj8Etp-eWozbywyHisiBsW8XxYBaBUhTdwTetQExfhRdyx/s700/fabric_docker+%25281%2529.png" /></a><br />
<br />
Can we somehow dynamically add the jar containing the Salesforce component to all our production gateway devices deployed into the field? Since the gateways are constantly processing the messages from the sensors, we would like to avoid any restarts of the devices.<br />
<br />
<br />
<br />
<h2>
Dynamic updates using Camel Grape endpoints</h2>
<br />
Camel 2.16 comes with new Groovy-based Grape component. <a href="http://docs.groovy-lang.org/latest/html/documentation/grape.html">Grape</a> is the part of the <a href="http://www.groovy-lang.org/">Groovy language</a> - it is the library that can download the other libraries and add them to the classpath of the current JVM. Grape component downloads jar libraries from the file repositories (including Maven repos) and add these jars dynamically to the application classpath. As soon as the library is downloaded, the Camel can take advantage of new components and data formats provided by these jar files. For example the following Camel route will download and install Camel Saleforce component:
<br />
<pre class="brush:java">from("direct:start").
to("grape:org.apache.camel/camel-salesforce/2.15.2");
</pre>
<br />
After the Saleforce jar has been loaded, you can use it in the Camel routes. All that without the restart of the gateway application:<br />
<br />
<pre class="brush:java">ProducerTemplate template = camelContext.createProducerTemplate();
template.sendBody("direct:dynamicEndpoint", "salesforce:createSObject");
...
from("direct:dynamicEndpoint").
recipientList().body();
</pre>
<br />
<br />
<br />
<h2>
Over-the-air updates</h2>
<br />
How can we dynamically update many gateways at once using over-the-air technology? As gateways usually run in the environment with the unreliable network connection, I recommend that gateway should listen to the MQTT messages sent from the data center. MQTT client is capable of handling the unstable network connectivity. MQTT client installed on the gateway should connect to the given "update" topic (let's refer to it as <b>over-the-air</b> topic). Whenever we would like to load the component dynamically, we can simply use MQTT <b>over-the-air</b> topic and send the Maven coordinates of the artifact we want to be downloaded to the devices. We can use Camel Paho component for that purpose:
<br />
<pre class="brush:java">// This code is executed on the data center side.
ProducerTemplate template = camelContext.createProducerTemplate();
// Tell all our devices connected to the over-the-air MQTT topic
// to download Camel Salesforce connector.
template.sendBody("paho:over-the-air", "org.apache.camel/camel-salesforce/2.15.2");
</pre>
<br />
The following Camel route deployed on the gateway field devices can be used to receive the update requests from the MQTT broker and send them to the Grape component:
<br />
<pre class="brush:java">from("paho:over-the-air").
to("grape:over-the-air");
</pre>
<br />
That's all what you need to fetch and load the new library into all of your gateway devices.
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiP5R37zbMS0s-FB_FV1YnM3GyvL8QtWhvIAmiYg0sP8rIFoSMu0GbZzPI2sRtub5NwLmtTDXi9yTt-jj4joNMtzgJVr37AjlqzHECnFicV77BHsOb11Upqwygs2WkYKeI3OppB8Ii1t0C8/s1600/fabric_docker+%25282%2529.png" imageanchor="1"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiP5R37zbMS0s-FB_FV1YnM3GyvL8QtWhvIAmiYg0sP8rIFoSMu0GbZzPI2sRtub5NwLmtTDXi9yTt-jj4joNMtzgJVr37AjlqzHECnFicV77BHsOb11Upqwygs2WkYKeI3OppB8Ii1t0C8/s700/fabric_docker+%25282%2529.png" /></a>
<br />
<br />
<br />
<h2>
Dealing with the download failures</h2>
<br />
You may be wondering what happens when the Grape component can't download the requested artifact, for example because of the network problems, so common the field environments. The is the moment when Camel and its <a href="http://camel.apache.org/redeliverypolicy.html">Camel error handler redelivery policy</a> jumps in. You can easily tell Camel what retry strategy should be used to eventually fetch and load the required dependency. All you have to do is to use a bit of the Camel DSL:
<br />
<pre class="brush:java">errorHandler(defaultErrorHandler().maximumRedeliveries(10).useExponentialBackOff());
</pre>
<br />
Using this approach you can be sure that Camel will be keep trying to download the requested library. Usually after certain number of attempts to download the artifact, you would like to send back the error MQTT message back to the data center, so your operations team can be notified about the upgrade problems at the given device.
<br />
<br />
<br />
<h2>
Loading patches on the gateway restart</h2>
<br />
The another natural question is if the patches loaded by the Grape component will be persisted after the gateway restart. Yes, Camel Grape component keeps track of the patches it loaded (by default the list of the deployed patches is stored in the device file system using plain text file). If you would like to tell Camel to load the installed patches, add the <b>GrapeEndpoint.loadPatches</b> method call into your route definition:
<br />
<pre class="brush:java">import static org.apache.camel.component.grape.GrapeEndpoint.loadPatches;
...
camelContext.addRoutes(new RouteBuilder() {
@Override
public void configure() throws Exception {
loadPatches(camelContext);
}
});
</pre>
<br />
<br />
<h2>
Listing patches installed on the gateway</h2>
<br />
You might be also interested in listing the patches installed on the particular gateway device. The following route demonstrates how to connect embedded HTTP server based on the Netty with the Grape component...
<br />
<br />
<pre class="brush:java">import static org.apache.camel.component.grape.GrapeEndpoint.loadPatches;
...
camelContext.addRoutes(new RouteBuilder() {
@Override
public void configure() throws Exception {
loadPatches(camelContext);
from("netty4-http:http://0.0.0.0:80/patches").
setHeader(GrapeConstants.GRAPE_COMMAND, GrapeCommand.listPatches).
to("grape:listPatches");
}
});
</pre>
<br />
<br />
...so you can open the following URL in the web browser and see the list of the installed artifacts:
<br />
<br />
<pre class="brush:bash">$ curl http://your.gateway.com/patches
org.apache.camel/camel-salesforce/2.15.2
org.apache.camel/camel-ftp/2.15.2
</pre>
<br />
<br />
<h2>
Summary</h2>
<br />
As you can see, Camel in the conjunction with Groovy class loading capabilities provides hot updates features extremely useful for the IoT systems. Camel ability to provide runtime updates over-the-air is an interesting alternative for the OSGi deployments. With the Camel Grape component you can take advantage of the dynamic class loading while keeping all the benefits of the flat classpath.Henryk Konsekhttp://www.blogger.com/profile/09392743290349794069noreply@blogger.com7tag:blogger.com,1999:blog-2199838449876727292.post-58691542549814402372015-05-18T12:16:00.002-07:002015-05-18T12:16:39.680-07:00Make your IoT gateway WiFi-aware using Camel and Kura<i>This is re-post of my DZone article<a href="http://java.dzone.com/articles/make-your-iot-gateway-wifi"> - Make Your IoT Gateway WiFi-Aware Using Camel and Kura</a>. The original DZone article has been published last week.</i><br />
<br />
The common scenario for the mobile IoT Gateways, for example those mounted on the trucks or the other vehicles, is to cache collected data locally on the device storage and synchronizing the data with the data center only when trusted WiFi access point is available near the gateway. Such trusted WiFi network could be localized near the truck fleet parking.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiBi0oW0lzIuOjFz_-kdEIPTHSiCPMv1DhwDfyaEpbqBzVTj6Xgha9aQyWnRZp-W8ek8wJH9abn1-9k1Dt8v4xfj1qTiQNXH_HbX_dpKq8PBeQx2vZ6Ht4mCsUstOXUh_KXDuTjqef_Y-ff/s1600/wifi_truck_1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="368" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiBi0oW0lzIuOjFz_-kdEIPTHSiCPMv1DhwDfyaEpbqBzVTj6Xgha9aQyWnRZp-W8ek8wJH9abn1-9k1Dt8v4xfj1qTiQNXH_HbX_dpKq8PBeQx2vZ6Ht4mCsUstOXUh_KXDuTjqef_Y-ff/s640/wifi_truck_1.png" width="640" /></a></div>
<br />
Using this approach, less urgent data (like GPS coordinates stored for the further offline analysis) can be delivered to the data center without the additional cost related to the GPS transmission fees.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4RbXc3dB6tCiGbpDYPT1OUesrgestA2ReOGUkUTHSXLyJvrJMeGw-cNICkstC_kwU_-UMw4kW7CzeQDcHvlkCCr-NARD-dhdAPkb10XP5KGvXaxdLTDxgiHSveoRjCGOL7W9ZjKNX9GxF/s1600/wifi_truck_2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="368" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4RbXc3dB6tCiGbpDYPT1OUesrgestA2ReOGUkUTHSXLyJvrJMeGw-cNICkstC_kwU_-UMw4kW7CzeQDcHvlkCCr-NARD-dhdAPkb10XP5KGvXaxdLTDxgiHSveoRjCGOL7W9ZjKNX9GxF/s640/wifi_truck_2.png" width="640" /></a></div>
<br />
<br />
<a href="https://github.com/camel-labs/camel-labs/tree/master/iot#camel-kura-wifi-component">Camel Kura WiFi component</a> from the <a href="https://github.com/camel-labs/camel-labs">Camel IoT Labs</a> can be used to retrieve the information about the WiFi access points available within the device range. Under the hood Kura Wifi component uses <a href="http://eclipse.org/kura/">Kura</a> <b>org.eclipse.kura.net.NetworkService</b>.<br />
<br />
<h3>
</h3>
<h3>
Setting up of the Maven project</h3>
<br />
In order to take advantage of the Camel Kura WiFi component, Maven users should add the following dependency to their POM file:<br />
<br />
<pre class="brush:xml"><dependency>
<groupId>com.github.camel-labs</groupId>
<artifactId>camel-kura</artifactId>
<version>0.0.0</version>
</dependency>
</pre>
<br />
All the other dependencies will be pulled by the Maven transitive resolver.<br />
<br />
<h3>
</h3>
<h3>
Creating Camel route scanning the WiFi networks</h3>
<br />
Kura WiFi component supports both the consumer and producer endpoints. In practice it means that you can either periodically scan for the WiFi networks (consumer mode) or explicitly request the single scan (producer mode).<br />
<br />
The following Apache Camel route will use the <b>wlan0</b> interface to scan for the <b>mySsid</b> network. If the <b>mySsid</b> WiFi network will be found, Camel will automatically start the route responsible for the synchronization of the offline data stored on the device local storage with the data center:<br />
<br />
<pre class="brush:java"> from("kura:wlan0/mySsid").
to("controlbus:route?routeId=onlineSync&action=start");
from("file:///var/sensor/temperature").
routeId("onlineSync").autoStartup(false).
to("netty4-http://api.mydatacenter.com");
</pre>
Keep in mind that both network interface and SSID can be replaced with the <b>*</b> wildcards matching respectively all the network interfaces and SSIDs.<br />
<br />
For example to read all the SSID available near the device, the following route can be used:<br />
<br />
<pre class="brush:java"> from("kura:*/*").to(...);
</pre>
<br />
<br />
<h3>
Data returned by the WiFi endpoints</h3>
<br />
The Kura WiFi consumer returns the list of the <b>org.eclipse.kura.net.wifi.WifiAccessPoint</b> classes returned as a result of the WiFi scan:<br />
<pre class="brush:java"> ConsumerTemplate consumerTemplate = camelContext.createConsumerTemplate();
WifiAccessPoint[] accessPoints = consumerTemplate.receiveBody("kura:wlan0/*", WifiAccessPoint[].class);
</pre>
You can also request the WiFi scanning using the producer endpoint:<br />
<pre class="brush:java"> from("direct:WifiScan").to("kura-wifi:*/*").to("mock:accessPoints");
</pre>
<br />
Or using the producer template directly:<br />
<br />
<pre class="brush:java"> ProducerTemplate template = camelContext.createProducerTemplate();
WifiAccessPoint[] accessPoints = template.requestBody("kura-wifi:*/*", null, WifiAccessPoint[].class);
</pre>
<br />
<br />
<h3>
Deployment options</h3>
<br />
Camel Kura WiFi component can be deployed either as the OSGi bundle, directly into the Kura container:<br />
<br />
<pre class="brush:java"> public class WifiKuraRouter extends KuraRouter {
@Override
public void configure() throws Exception {
from("kura-wifi:*/*").to("log:availableWifiNetworks");
}
}
</pre>
<br />
...where KuraRouter is the <a href="http://camel.apache.org/kura.html">base OSGi bundle activator</a> for Camel routes deployable into Kura.<br />
<br />
The other option of deployment is to use <a href="http://camel.apache.org/spring-boot.html">Spring Boot based fat jar</a>:<br />
<br />
<pre class="brush:java"> @SpringBootApplication
public class WifiKuraRouter extends FatJar {
@Override
public void configure() throws Exception {
from("kura-wifi:*/*").to("log:availableWifiNetworks");
}
}
</pre>
<br />
In the first place Kura Wifi component tries to locate the <b>org.eclipse.kura.net.NetworkService</b> instance in the Camel registry. If exactly one instance of the <b>NetworkService</b> is found (this is usually the case when if you deploy the route into the Kura container), that instance will be used by the Kura component. Otherwise new instance of the <b>org.eclipse.kura.linux.net.NetworkServiceImpl</b> will be created and cached by the <b>KuraAccessPointsProvider</b>.<br />
<br />
<br />
<h3>
Summary</h3>
<br />
Smart WiFi connectivity is fundamental for every mobile IoT gateway solution. Camel Kura WiFi integration makes WiFi scanning process as easy as adding a few lines of the DSL. Your gateway application should try to cache the data collected from the sensors and avoid using the expensive mobile connectivity whenever possible. The efficient IoT gateway should synchronize the stored offline data when the trusted WiFi network is available.Henryk Konsekhttp://www.blogger.com/profile/09392743290349794069noreply@blogger.com0tag:blogger.com,1999:blog-2199838449876727292.post-9351407867654891352015-04-24T13:03:00.000-07:002015-10-14T23:54:04.557-07:00Camel IoT Labs project arrived<div class="separator" style="clear: both; text-align: center;">
</div>
As some of you already know, I've been pretty interested in the Internet Of Things topic. The IoT is actually a natural extension of my existing interests - M2M communication relies on the messaging and integration technologies heavily, so Camel, ActiveMQ and Fabric8 excel in this area.<br />
<br />
Together with some friends of mine from Red Hat (hello <a href="https://twitter.com/davsclaus">Claus</a>, <a href="https://twitter.com/rajdavies">Rob</a> and <a href="https://twitter.com/gautric_io">Greg</a>!) we started the new umbrella project for the contributions related to the Camel/ActiveMQ and the Internet Of Things. The project is called <a href="https://github.com/camel-labs/camel-labs">Camel IoT Labs</a>.<br />
<br />
<h3>
</h3>
<h3>
</h3>
<h3>
</h3>
<h3>
</h3>
<h3>
What to expect</h3>
In the first release of the project we plan to deliver the following new components for Camel:<br />
<ul>
<li>Raspberry Pi GPIO</li>
<li>Raspberry Pi I2C</li>
<li>Device IO</li>
<li>Tinkerforge</li>
<li><a href="https://eclipse.org/kura/">Eclipse Kura</a> WiFi</li>
</ul>
<h3>
Startup hardware setup</h3>
<div>
We also plan to create, document and promote something called <a href="https://github.com/camel-labs/camel-labs/issues/12">Camel IoT devKit</a> - the opinionated Raspberry Pi based setup of the hardware that you could use to immediately take advantage of the Camel components deployed into it.</div>
<div>
<br /></div>
<h3>
Backend in the cloud</h3>
<div>
Serious IoT solutions can't exist without the proper data center backend. That's why we also plan to create <a href="https://github.com/camel-labs/camel-labs/issues/26">Cloudlets</a> - customizable microservices based on the Apache Camel providing common backend functionaries required by the IoT systems. Our primary target platform at the moment will be Fabric8 with Openshift 3.</div>
<div>
<br /></div>
<h3>
Wanna join us?</h3>
<div>
That sounds interesting? Then join our efforts! Take a look at <a href="https://github.com/camel-labs/camel-labs/issues">our issue tracker</a> - we are open for new ideas. And pull request are always more then welcome :) .</div>
Henryk Konsekhttp://www.blogger.com/profile/09392743290349794069noreply@blogger.com1tag:blogger.com,1999:blog-2199838449876727292.post-77670712800241830072015-03-19T14:28:00.000-07:002015-03-19T14:28:37.820-07:00Camel Paho connector<div class="separator" style="clear: both; text-align: center;">
<a href="http://mqtt.org/new/wp-content/uploads/2011/08/mqttorg-glow.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="http://mqtt.org/new/wp-content/uploads/2011/08/mqttorg-glow.png" /></a></div>
The incoming version of the <a href="http://camel.apache.org/">Apache Camel</a> (2.16) will bring Paho component which provides connector for the MQTT messaging protocol using the <a href="https://eclipse.org/paho/">Eclipse Paho</a> library. Paho is one of the most popular MQTT libraries, so if you would like to integrate it with your Java project - <a href="http://camel.apache.org/paho">Camel Paho connector</a> is a way to go.
<br><br />
<h2>
How can I use Paho connector?</h2>
The basic URI format for the Paho connector is as follows:
<br />
<pre class="brush:bash">paho:queueName[?options]
</pre>
To me a little more concrete, the following snippet reads messages from the MQTT broker installed on the same host as the Camel router:
<br />
<pre class="brush:java">from("paho:some/queue").
to("mock:test");
</pre>
This one reads messages from the remote MQTT broker:
<br />
<pre class="brush:java">from("paho:some/queue?brokerUrl=tcp://iot.eclipse.org:1883").
to("mock:test");
</pre>
While this sends messages to the MQTT broker:
<br />
<pre class="brush:java">from("direct:test").
to("paho:some/target/queue");
</pre>
The complete <a href="http://camel.apache.org/spring-boot.html">Spring Boot</a> based application sending message to the MQTT broker every second, is as simple as:
<br />
<pre class="brush:groovy">@SpringBootApplication
class MqttRouter extends FatJarRouter {
@Override
void configure() {
from("timer://trigger").
setBody().expression { randomUUID().toString() }.
to("paho:topic?brokerUrl={{broker.url}}")
}
}
</pre>
<h2>
Adding Paho connector to your Maven project</h2>
Paho connector is shipped in the dedicated jar which Maven users should add to their <b>pom.xml</b> file:
<br />
<pre class="brush:xml"><dependency>
<groupid>org.apache.camel</groupid>
<artifactid>camel-paho</artifactid>
<version>2.16.0</version>
</dependency>
</pre>
Keep in mind that Paho artifacts are not hosted in the Maven Central, so you need to add Eclipse Paho repository to your POM xml file as well:
<br />
<pre class="brush:xml"><repositories>
<repository>
<id>eclipse-paho</id>
<url>https://repo.eclipse.org/content/repositories/paho-releases</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
</pre>
<h2>
Default payload type</h2>
By default Camel Paho component operates on the binary payloads extracted out of (or put into) the MQTT message:
<br />
<pre class="brush:java">// Receive payload
byte[] payload = (byte[]) consumerTemplate.receiveBody("paho:topic");
// Send payload
byte[] payload = "message".getBytes();
producerTemplate.sendBody("paho:topic", payload);
</pre>
But of course Camel build-in <a href="http://camel.apache.org/type-converter.html">type conversion API</a> can perform the automatic data type transformations for you. In the example below Camel automatically converts binary payload into String (and conversely):
<br />
<pre class="brush:java">// Receive payload
String payload = consumerTemplate.receiveBody("paho:topic", String.class);
// Send payload
String payload = "message";
producerTemplate.sendBody("paho:topic", payload);
</pre>
<h2>
Connection options</h2>
The convention-over-configuration approach used in Camel is really handy for the most of the situations, but sometimes you would like to have more fine-grained control over the MQTT client connection. To cover such situations just add the bean of type <b>org.eclipse.paho.client.mqttv3.MqttConnectOptions</b> to your <a href="http://camel.apache.org/registry.html">Camel registry</a>. For Spring applications that would mean adding bean to your application context. The snippet below uses password-based authentication to connect to the MQTT broker:
<br />
<pre class="brush:java">@Bean
MqttConnectOptions connectOptions() {
MqttConnectOptions connectOptions = new MqttConnectOptions();
connectOptions.setUserName("henry");
connectOptions.setPassword("secret".toCharArray());
return connectOptions;
}
</pre>
That's it. Camel automatically picks up this <b>MqttConnectOptions</b> bean from the registry and use it to establish connection with the MQTT broker.
<br />
<h2>
What's next?</h2>
If you are interested in all the available options of the Camel Paho connector, visit the <a href="https://www.blogger.com/camel.apache.org/paho">component page</a>. If you are looking for complete example of the project that can be easily deployed into the micro-computers like Raspberry Pi check out <a href="https://github.com/hekonsek/camel-m2m-gateway/blob/master/docs/reference.md#mqtt-connector">CamelM2M MQTT quickstart</a>. If you are wondering how fast MQTT connector can be - check out my previous blog post related to the <a href="http://henryk-konsek.blogspot.com/2015/03/raspberry-pi-2-and-camel-mqtt-client.html">MQTT performance on Raspberry Pi</a>.Henryk Konsekhttp://www.blogger.com/profile/09392743290349794069noreply@blogger.com3tag:blogger.com,1999:blog-2199838449876727292.post-6721979801752980982015-03-13T09:50:00.000-07:002015-03-13T09:50:20.556-07:00Raspberry Pi 2 and Camel: The MQTT client performance<a href="http://www.raspberrypi.org/products/raspberry-pi-2-model-b/">Raspberry Pi 2</a> comes armed with the 900 MHz quad-core ARM Cortex-A7 and 1 GB of memory. This is a pretty powerful hardware considering the hobbyist Internet Of Things applications, but it's still relatively slow comparing to the industrial-grade microcomputers. As soon as my very own Raspberry Pi 2 has been shipped to me, I started to wonder how fast this car key size computer can be.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEilrQzTaXu3yyUGc5GFjtdEOy5lRkQGpOajkcQv8DrvjH3RB_hVnM6hGRkXQRsQAN4k625BXLUi1KDvvsEU4-pV_rg1vVTt5yItoZOlCwlQ8gzze3UTwuIeVJCcwM9TeDQtntOcrFj6ED1W/s1600/20150312_165357.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEilrQzTaXu3yyUGc5GFjtdEOy5lRkQGpOajkcQv8DrvjH3RB_hVnM6hGRkXQRsQAN4k625BXLUi1KDvvsEU4-pV_rg1vVTt5yItoZOlCwlQ8gzze3UTwuIeVJCcwM9TeDQtntOcrFj6ED1W/s1600/20150312_165357.jpg" height="360" width="640" /></a></div>
<br />
<h3>
Let's test MQTT client</h3>
<div>
Together with the <a href="https://twitter.com/arekjurasz">friend of mine</a> we decided to create a simple proof of concept demonstrating how fast Raspberry Pi 2 can be in the typical field device or the gateway scenario. The field device scenario is the Raspberry Pi acting as the edge node collecting the information from the sensors...</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiyDoXsbBLJwA_QyjVy-R_FMY0yyyCxI53Ph3TpOYFeM8U-eWDqvv7rfQqSXxXuPopEJnyY2sgK6oEwztv1v9QXdYkP2zZx4AbsPdUjL3n2T90uPieN1ovYEemgVeIRwK035DUblEmtUAaT/s1600/fabric_docker.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiyDoXsbBLJwA_QyjVy-R_FMY0yyyCxI53Ph3TpOYFeM8U-eWDqvv7rfQqSXxXuPopEJnyY2sgK6oEwztv1v9QXdYkP2zZx4AbsPdUjL3n2T90uPieN1ovYEemgVeIRwK035DUblEmtUAaT/s1600/fabric_docker.png" height="182" width="640" /></a></div>
<div>
<br />
The gateway scenario is when Raspberry Pi is collecting the messages from the other microcomputers, controllers or sensors...<br />
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhz2xpEipAYYS_m3NBCOPTpnh5YgnmT5p1-vfU3mr9rr4okkcRM8iyzJ6SQFadrYRaOrlxWrA8IEPw8CRssbn3x8AszoP5vsWD0AjYKCDcBwRe_pM__Do3mVjQV8K1F83VR2MJ_szmFUpVa/s1600/fabric_docker+(1).png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhz2xpEipAYYS_m3NBCOPTpnh5YgnmT5p1-vfU3mr9rr4okkcRM8iyzJ6SQFadrYRaOrlxWrA8IEPw8CRssbn3x8AszoP5vsWD0AjYKCDcBwRe_pM__Do3mVjQV8K1F83VR2MJ_szmFUpVa/s1600/fabric_docker+(1).png" height="384" width="640" /></a></div>
<div>
<br /></div>
<div>
In both cases RPi is very likely to send the messages to the external MQTT message broker for the further analysis.<br />
<br />
<h3>
Testing conditions</h3>
</div>
<div>
For the purpose of our tests we decided to stick to the first scenario i.e. Raspberry Pi collecting the events and sending them directly to the MQTT broker. We used SSH protocol to put a small <a href="http://camel.apache.org/">Apache Camel</a> application bootstrapped using the <a href="http://camel.apache.org/spring-boot.html">Spring Boot</a> to the Pi device. In the Camel router we generated test events using internal <a href="http://camel.apache.org/timer.html">Camel timer</a> (emulating the sensor read) and for each event collected we sent a message to the external <a href="http://activemq.apache.org/mqtt.html">ActiveMQ MQTT</a> broker. <a href="http://camel.apache.org/paho">Camel Paho component</a> has been chosen as the MQTT client. In order to decouple events collection from the MQTT sending process, we used <a href="http://camel.apache.org/seda.html">in-memory SEDA queue</a>.</div>
<div>
<br /></div>
<div>
What is important, we decided the test the performance of the MQTT at the level 2 of the QOS. Level 2 of <a href="http://www.eclipse.org/paho/files/mqttdoc/Cclient/qos.html">MQTT QOS</a> comes with the guaranteed exactly-once message delivery pattern. It provides the highest level of the client reliability, but consumes more client resources (Raspberry Pi processing power and memory in this particular case). </div>
<div>
<br /></div>
<div>
The broker itself didn't perform any action against the messages it receives. There was no subscriber registered to the MQTT topic we sent messages to. We started dockerized ActiveMQ 5.11 as a message broker (the mentioned Docker image is a part of the <a href="http://fabric8.io/">Fabric8</a> project):<br />
<br /></div>
<pre class="brush:bash">docker run -p 1883:1883 -e AMQ_MQTT_PORT=1883 -it fabric8/fabric8-mq:2.0.29
</pre>
<div>
<br /></div>
<div>
We took the advantage of the Java UUID API to create test messages. Each message was 36-byte long random UUID. Such message size may seem to be small, but events generated by the field sensors are usually not much larger - the majority of the IoT solutions generate the huge number of the small messages.<br />
<br />
<h3>
The application code </h3>
<div>
Apache Camel in the conjunction with the Spring Boot creates pretty powerful tool for the <a href="https://github.com/hekonsek/camel-m2m-gateway">M2M solutions</a>. For example to create the application for the purposes of our tests, all the Groovy code we had to write is the snippet presented below:</div>
<br /></div>
<pre class="brush:groovy">@SpringBootApplication
class MqttProducerGateway extends FatJarRouter {
@Override
void configure() {
// Read events from the sensors
from("timer://mockSensor").
setBody().expression { randomUUID().toString() }.
to("seda://events") // Enqueue the events in the in-memory queue
from("seda://events?concurrentConsumers={{broker.consumers:15}}").
to("paho:topic?brokerUrl={{broker.url}}")
}
}</pre>
<br />
That's it! We packaged that code as a fat jar to make deployment via SSH easier. The application is configured from the command line just before the execution of the tests:<br />
<br />
<pre class="brush:java">java -Dbroker.url=tcp://192.168.1.6 -jar camel-mqtt-benchmark.jar </pre>
<h3>
First run: 3 consumers sending messages to the MQTT broker</h3>
In the first benchmark we used <b>3</b> concurrent consumers threads, reading messages from the in-memory SEDA queue and sending those messages to the MQTT broker. Application performs pretty well (up to ~315 messages per second) until Paho client got overwhelmed with the messages produced by the timer. When the number of the messages to be processed became too large, the performance of the gateway started to decrease. The interesting point here is that many messages are produced, while not so many are consumed - that's why we considered increasing the number of the concurrent consumers in the next benchmarking session.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjS2HqW6Mc-eIe6I4Ag1rDn4CJgWZsVQSlOkNRwIeYOtkkTPRMADHmOIPEZXow7z5QhJBpqINm9tTIq5n2NW9XWfFUBbvWS0SySD4dcEtdLVA0YzR8fnCSH-PAD_eJEKh63g0KeTRV_PZHr/s1600/benchmark1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjS2HqW6Mc-eIe6I4Ag1rDn4CJgWZsVQSlOkNRwIeYOtkkTPRMADHmOIPEZXow7z5QhJBpqINm9tTIq5n2NW9XWfFUBbvWS0SySD4dcEtdLVA0YzR8fnCSH-PAD_eJEKh63g0KeTRV_PZHr/s1600/benchmark1.png" height="630" width="640" /></a></div>
<br />
<h3>
Second run: 15 consumers sending messages to the MQTT broker</h3>
<div>
We decided to increase the number of the consumers reading messages from the in-memory SEDA queue to <b>15</b>. After that change route performed really well (up to ~580 messages per second) until Paho client got overwhelmed with the messages produced by the timer. Once again, when the number of the messages to be processed started to be too large, the performance of the gateway started to decrease.</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiFHC2vJLDJv82Hv92Jr2vbvy7pMaaeWJKyoB2svja-axwltPCuDx3CCWCy0W8CW3dekIC9YCGRcfRXR5uvKsiK8bdYeGWGZk1fqL-LMxF9CWFopcUwsPfGMqdiTxWj1UNZ94Hxc-vhySHi/s1600/benchmark2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiFHC2vJLDJv82Hv92Jr2vbvy7pMaaeWJKyoB2svja-axwltPCuDx3CCWCy0W8CW3dekIC9YCGRcfRXR5uvKsiK8bdYeGWGZk1fqL-LMxF9CWFopcUwsPfGMqdiTxWj1UNZ94Hxc-vhySHi/s1600/benchmark2.png" height="632" width="640" /></a></div>
<h3>
Can we do better?</h3>
<div>
The biggest problem so far seems to be the fact the Paho slows down when we generate too much messages comparing to the consumption rate. By adding the <a href="http://camel.apache.org/throttler.html">throttler</a> to the test running 15 consumers, we managed to keep the processing rate on the level of the <b>700 messages per second</b>. By tuning the consumers settings and reducing the QOS we might increase the number of the messages processed by the Raspberry Pi even more. I will describe how we used Camel throttler to get the stable 700 messages per second in the separated article in the future, as this awesome <a href="http://camel.apache.org/throttler.html">Camel feature</a> deserves more attention. </div>
<div>
<br /></div>
<div>
<h3>
Raspberry Pi 2 results TL;DR;</h3>
<div>
Raspberry Pi 2 is really fast! As for such small and cheap (35$) device, the performance of the unit is really impressive. You can send almost 700 small QOS 2 messages (36 bytes each) per second from Raspbberry Pi 2 gateway to the MQTT server.</div>
<div>
<br /></div>
<div>
If you plan to run the Paho MQTT client on the RPi 2 remember to:</div>
<div>
<ul>
<li>enqueue messages in the internal in-memory queue and use at least 15 concurrent threads to process these messages (as Paho or sensors IO operations may become a bottleneck otherwise)</li>
<li>do not let sensors to put too many messages into the queue, otherwise the overall performance of the gateway is decreased significantly. Consider using <a href="http://camel.apache.org/throttler.html">Camel throttler</a> to limit the number of the messages sent to the queue.</li>
</ul>
</div>
</div>
Henryk Konsekhttp://www.blogger.com/profile/09392743290349794069noreply@blogger.com0tag:blogger.com,1999:blog-2199838449876727292.post-7122458581730103182015-02-28T11:12:00.004-08:002015-02-28T11:12:37.110-08:00Apache Camel in the IoT world: Eclipse Kura component<div style="background-color: white; color: #333333; font-family: Arial, sans-serif; line-height: 20px; margin-top: 10px;">
<span style="line-height: 1.5625;"><a href="https://eclipse.org/kura/">Eclipse Kura</a> is an OSGi based framework dedicated for the <a href="http://en.wikipedia.org/wiki/Machine_to_machine">M2M</a> gateways based on the small computing platforms like <a href="http://www.raspberrypi.org/">Raspberry Pi</a> or <a href="http://beagleboard.org/BLACK">BeagleBoard Black</a>. If you consider using Kura in your M2M gateway and and the same time you would like to take advantage of the rich set of <a href="http://camel.apache.org/components.html">Apache Camel components</a> and its <a href="http://camel.apache.org/eip.html">EIP capabilities</a>, then <a href="http://camel.apache.org/kura">Camel Kura component</a> is something for you. Camel Kura component will be available starting from the Camel 2.15.0.</span><br />
<div style="font-size: 14px;">
<span style="font-size: 16px; line-height: 1.5625;"><br /></span></div>
<h3 style="font-size: 14px;">
<span style="font-size: 16px; line-height: 1.5625;">Camel Kura architecture</span></h3>
<span style="line-height: 1.5625;">The common reason to deploy Camel routes into the Eclipse Kura is to provide enterprise integration patterns and Camel components to the messaging M2M gateway. For example you might want to install Kura on Raspberry PI, then read temperature from the sensor attached to that Raspberry PI using Kura services and finally forward the current temperature value to your data center service using Camel EIP and components. The diagram below demonstrates the architecture of the Camel solution deployed into the Eclipse Kura: </span></div>
<div style="background-color: white; color: #333333; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; margin-top: 10px;">
<span style="font-size: 16px; line-height: 1.5625;"><img class="confluence-embedded-image image-center" data-image-src="/confluence/download/attachments/51811447/fabric_docker%20%282%29.png?version=1&modificationDate=1425039313911&api=v2" height="180" src="https://cwiki.apache.org/confluence/download/attachments/51811447/fabric_docker%20%282%29.png?version=1&modificationDate=1425039313911&api=v2" style="border: 1px solid transparent; display: block; margin-left: auto; margin-right: auto;" width="640" /></span></div>
<h3 id="Kura-KuraRouteractivator" style="background-color: white; color: #333333; font-family: Arial, sans-serif; font-size: 16px; line-height: 1.5625; margin: 30px 0px 0px;">
<span style="line-height: 1.5625;">How can I activate my route?</span></h3>
<div style="background-color: white; color: #333333; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; margin-top: 10px;">
Bundles deployed to the Eclipse Kura are usually <a class="external-link" href="http://eclipse.github.io/kura/doc/hello-example.html#create-java-class" rel="nofollow" style="color: #3b73af; text-decoration: none;">developed as bundle activators</a>. So the easiest way to deploy Apache Camel routes into the Kura is to create an OSGi bundle containing the class extending <code>org.apache.camel.kura.KuraRouter</code>class:</div>
<div class="code panel pdl" style="background-color: white; border-radius: 3px; border: 1px solid rgb(204, 204, 204); color: #333333; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; margin: 10px 0px; overflow: auto; padding: 0px;">
<div class="codeContent panelContent pdl" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; margin: 0px; overflow: hidden; padding: 0px;">
<div class="syntaxhighlighter nogutter java" id="highlighter_890315" style="font-size: 1em !important; margin: 0px !important; overflow: auto !important; position: relative !important; width: 1578px;">
<table border="0" cellpadding="0" cellspacing="0" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 14px !important; height: auto !important; left: auto !important; line-height: 20px !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: 1578px;"><tbody style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="code" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px 0px 0px 15px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: 1563px;"><div class="container" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; height: auto !important; left: auto !important; margin: 15px 0px 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px 0px 15px !important; position: relative !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: pre-wrap !important; width: auto !important;" title="Hint: double-click to select code">
<div class="line number1 index0 alt2" style="background-attachment: initial !important; background-clip: initial !important; background-image: none !important; background-origin: initial !important; background-position: initial !important; background-repeat: initial !important; background-size: initial !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em 0px 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: nowrap !important; width: auto !important;">
<code class="java keyword" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 102, 153) !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: bold !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><br /></code>
<code class="java keyword" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 102, 153) !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: bold !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><br /></code>
<code class="java keyword" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 102, 153) !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: bold !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">public</code> <code class="java keyword" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 102, 153) !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: bold !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">class</code> <code class="java plain" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">MyKuraRouter </code><code class="java keyword" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 102, 153) !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: bold !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">extends</code> <code class="java plain" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">KuraRouter {</code></div>
<div class="line number2 index1 alt1" style="background-attachment: initial !important; background-clip: initial !important; background-image: none !important; background-origin: initial !important; background-position: initial !important; background-repeat: initial !important; background-size: initial !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em 0px 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: nowrap !important; width: auto !important;">
</div>
<div class="line number3 index2 alt2" style="background-attachment: initial !important; background-clip: initial !important; background-image: none !important; background-origin: initial !important; background-position: initial !important; background-repeat: initial !important; background-size: initial !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em 0px 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: nowrap !important; width: auto !important;">
<code class="java spaces" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"> </code><code class="java color1" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: gray !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">@Override</code></div>
<div class="line number4 index3 alt1" style="background-attachment: initial !important; background-clip: initial !important; background-image: none !important; background-origin: initial !important; background-position: initial !important; background-repeat: initial !important; background-size: initial !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em 0px 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: nowrap !important; width: auto !important;">
<code class="java spaces" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"> </code><code class="java keyword" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 102, 153) !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: bold !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">public</code> <code class="java keyword" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 102, 153) !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: bold !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">void</code> <code class="java plain" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">configure() </code><code class="java keyword" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 102, 153) !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: bold !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">throws</code> <code class="java plain" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">Exception {</code></div>
<div class="line number5 index4 alt2" style="background-attachment: initial !important; background-clip: initial !important; background-image: none !important; background-origin: initial !important; background-position: initial !important; background-repeat: initial !important; background-size: initial !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em 0px 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: nowrap !important; width: auto !important;">
<code class="java spaces" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"> </code><code class="java plain" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">from(</code><code class="java string" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: blue !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">"timer:trigger"</code><code class="java plain" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">).</code></div>
<div class="line number6 index5 alt1" style="background-attachment: initial !important; background-clip: initial !important; background-image: none !important; background-origin: initial !important; background-position: initial !important; background-repeat: initial !important; background-size: initial !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em 0px 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: nowrap !important; width: auto !important;">
<code class="java spaces" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"> </code><code class="java plain" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">to(</code><code class="java string" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: blue !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">"netty-http:<a href="http://app.mydatacenter.com/api" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: #3b73af; float: none !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; text-decoration: none; top: auto !important; vertical-align: baseline !important; width: auto !important;">http://app.mydatacenter.com/api"</a></code><code class="java plain" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">);</code></div>
<div class="line number7 index6 alt2" style="background-attachment: initial !important; background-clip: initial !important; background-image: none !important; background-origin: initial !important; background-position: initial !important; background-repeat: initial !important; background-size: initial !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em 0px 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: nowrap !important; width: auto !important;">
<code class="java spaces" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"> </code><code class="java plain" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">}</code></div>
<div class="line number8 index7 alt1" style="background-attachment: initial !important; background-clip: initial !important; background-image: none !important; background-origin: initial !important; background-position: initial !important; background-repeat: initial !important; background-size: initial !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em 0px 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: nowrap !important; width: auto !important;">
</div>
<div class="line number9 index8 alt2" style="background-attachment: initial !important; background-clip: initial !important; background-image: none !important; background-origin: initial !important; background-position: initial !important; background-repeat: initial !important; background-size: initial !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em 0px 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: nowrap !important; width: auto !important;">
<code class="java plain" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">}</code><br />
<code class="java plain" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><br /></code></div>
</div>
</td></tr>
</tbody></table>
</div>
</div>
</div>
<div style="background-color: white; color: #333333; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; margin-top: 10px;">
Keep in mind that <code>KuraRouter</code> implements the <code>org.osgi.framework.BundleActivator</code> interface, so you need to register its <code>start</code> and <code>stop</code> lifecycle methods while <a class="external-link" href="http://eclipse.github.io/kura/doc/hello-example.html#create-component-class" rel="nofollow" style="color: #3b73af; text-decoration: none;">creating Kura bundle component class</a>.</div>
<div style="background-color: white; color: #333333; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; margin-top: 10px;">
Kura router starts its own OSGi-aware <code>CamelContext</code>. It means that for every class extending <code>KuraRouter</code>, there will be a dedicated <code>CamelContext</code> instance. Ideally we recommend to deploy one <code>KuraRouter</code> per OSGi bundle.</div>
<h3 id="Kura-DeployingKuraRouter" style="background-color: white; color: #333333; font-family: Arial, sans-serif; font-size: 16px; line-height: 1.5625; margin: 30px 0px 0px;">
How can I deploy my KuraRouter</h3>
<div style="background-color: white; color: #333333; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; margin-top: 10px;">
Bundle containing your Kura router class should import the following packages in the OSGi manifest:</div>
<div class="code panel pdl" style="background-color: white; border-radius: 3px; border: 1px solid rgb(204, 204, 204); color: #333333; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; margin: 10px 0px; overflow: auto; padding: 0px;">
<div class="codeContent panelContent pdl" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; margin: 0px; overflow: hidden; padding: 0px;">
<div class="syntaxhighlighter nogutter xml" id="highlighter_404395" style="font-size: 1em !important; margin: 0px !important; overflow: auto !important; position: relative !important; width: 1578px;">
<table border="0" cellpadding="0" cellspacing="0" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 14px !important; height: auto !important; left: auto !important; line-height: 20px !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: 1578px;"><tbody style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="code" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px 0px 0px 15px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: 1563px;"><div class="container" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; height: auto !important; left: auto !important; margin: 15px 0px 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px 0px 15px !important; position: relative !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: pre-wrap !important; width: auto !important;" title="Hint: double-click to select code">
<div class="line number1 index0 alt2" style="background-attachment: initial !important; background-clip: initial !important; background-image: none !important; background-origin: initial !important; background-position: initial !important; background-repeat: initial !important; background-size: initial !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em 0px 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: nowrap !important; width: auto !important;">
<code class="xml plain" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><br /></code>
<code class="xml plain" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">Import-Package: org.osgi.framework;version="1.3.0",</code></div>
<div class="line number2 index1 alt1" style="background-attachment: initial !important; background-clip: initial !important; background-image: none !important; background-origin: initial !important; background-position: initial !important; background-repeat: initial !important; background-size: initial !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em 0px 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: nowrap !important; width: auto !important;">
<code class="xml spaces" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"> </code><code class="xml plain" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">org.slf4j;version="1.6.4",</code></div>
<div class="line number3 index2 alt2" style="background-attachment: initial !important; background-clip: initial !important; background-image: none !important; background-origin: initial !important; background-position: initial !important; background-repeat: initial !important; background-size: initial !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em 0px 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: nowrap !important; width: auto !important;">
<code class="xml spaces" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"> </code><code class="xml plain" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">org.apache.camel,org.apache.camel.impl,org.apache.camel.core.osgi,org.apache.camel.builder,org.apache.camel.model,</code></div>
<div class="line number4 index3 alt1" style="background-attachment: initial !important; background-clip: initial !important; background-image: none !important; background-origin: initial !important; background-position: initial !important; background-repeat: initial !important; background-size: initial !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em 0px 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: nowrap !important; width: auto !important;">
<code class="xml spaces" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"> </code><code class="xml plain" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">org.apache.camel.component.kura</code></div>
</div>
</td></tr>
</tbody></table>
</div>
</div>
</div>
<div style="background-color: white; color: #333333; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; margin-top: 10px;">
<br />
Keep in mind that you don't have to import every Camel component bundle you plan to use in your routes, as Camel components are resolved as the services on the runtime level.</div>
<div style="background-color: white; color: #333333; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; margin-top: 10px;">
Before you deploy your router bundle, be sure that you have deployed (and started) the following Camel core bundles (using Kura GoGo shell)...</div>
<div class="code panel pdl" style="background-color: white; border-radius: 3px; border: 1px solid rgb(204, 204, 204); color: #333333; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; margin: 10px 0px; overflow: auto; padding: 0px;">
<div class="codeContent panelContent pdl" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; margin: 0px; overflow: hidden; padding: 0px;">
<div class="syntaxhighlighter nogutter xml" id="highlighter_368287" style="font-size: 1em !important; margin: 0px !important; overflow: auto !important; position: relative !important; width: 1578px;">
<table border="0" cellpadding="0" cellspacing="0" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 14px !important; height: auto !important; left: auto !important; line-height: 20px !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: 1578px;"><tbody style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="code" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px 0px 0px 15px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: 1563px;"><div class="container" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; height: auto !important; left: auto !important; margin: 15px 0px 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px 0px 15px !important; position: relative !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: pre-wrap !important; width: auto !important;" title="Hint: double-click to select code">
<div class="line number1 index0 alt2" style="background-attachment: initial !important; background-clip: initial !important; background-image: none !important; background-origin: initial !important; background-position: initial !important; background-repeat: initial !important; background-size: initial !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em 0px 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: nowrap !important; width: auto !important;">
<code class="xml plain" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><br /></code>
<code class="xml plain" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">install file:///home/user/.m2/repository/org/apache/camel/camel-core/2.15.0/camel-core-2.15.0.jar</code></div>
<div class="line number2 index1 alt1" style="background-attachment: initial !important; background-clip: initial !important; background-image: none !important; background-origin: initial !important; background-position: initial !important; background-repeat: initial !important; background-size: initial !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em 0px 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: nowrap !important; width: auto !important;">
<code class="xml plain" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">start <</code><code class="xml keyword" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 102, 153) !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: bold !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">camel-core-bundle-id</code><code class="xml plain" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">></code></div>
<div class="line number3 index2 alt2" style="background-attachment: initial !important; background-clip: initial !important; background-image: none !important; background-origin: initial !important; background-position: initial !important; background-repeat: initial !important; background-size: initial !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em 0px 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: nowrap !important; width: auto !important;">
<code class="xml plain" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">install file:///home/user/.m2/repository/org/apache/camel/camel-core-osgi/2.15.0/camel-core-osgi-2.15.0.jar</code></div>
<div class="line number4 index3 alt1" style="background-attachment: initial !important; background-clip: initial !important; background-image: none !important; background-origin: initial !important; background-position: initial !important; background-repeat: initial !important; background-size: initial !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em 0px 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: nowrap !important; width: auto !important;">
<code class="xml plain" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">start <</code><code class="xml keyword" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 102, 153) !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: bold !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">camel-core-osgi-bundle-id</code><code class="xml plain" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">></code></div>
<div class="line number5 index4 alt2" style="background-attachment: initial !important; background-clip: initial !important; background-image: none !important; background-origin: initial !important; background-position: initial !important; background-repeat: initial !important; background-size: initial !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em 0px 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: nowrap !important; width: auto !important;">
<code class="xml plain" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">install file:///home/user/.m2/repository/org/apache/camel/camel-kura/2.15.0/camel-kura-2.15.0.jar</code></div>
<div class="line number6 index5 alt1" style="background-attachment: initial !important; background-clip: initial !important; background-image: none !important; background-origin: initial !important; background-position: initial !important; background-repeat: initial !important; background-size: initial !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em 0px 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: nowrap !important; width: auto !important;">
<code class="xml plain" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">start <</code><code class="xml keyword" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 102, 153) !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: bold !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">camel-kura-bundle-id</code><code class="xml plain" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">></code></div>
</div>
</td></tr>
</tbody></table>
</div>
</div>
</div>
<div style="background-color: white; color: #333333; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; margin-top: 10px;">
<br />
...and all the components you plan to use in your routes:</div>
<div class="code panel pdl" style="background-color: white; border-radius: 3px; border: 1px solid rgb(204, 204, 204); color: #333333; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; margin: 10px 0px; overflow: auto; padding: 0px;">
<div class="codeContent panelContent pdl" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; margin: 0px; overflow: hidden; padding: 0px;">
<div class="syntaxhighlighter nogutter xml" id="highlighter_310227" style="font-size: 1em !important; margin: 0px !important; overflow: auto !important; position: relative !important; width: 1578px;">
<table border="0" cellpadding="0" cellspacing="0" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 14px !important; height: auto !important; left: auto !important; line-height: 20px !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: 1578px;"><tbody style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="code" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px 0px 0px 15px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: 1563px;"><div class="container" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; height: auto !important; left: auto !important; margin: 15px 0px 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px 0px 15px !important; position: relative !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: pre-wrap !important; width: auto !important;" title="Hint: double-click to select code">
<div class="line number1 index0 alt2" style="background-attachment: initial !important; background-clip: initial !important; background-image: none !important; background-origin: initial !important; background-position: initial !important; background-repeat: initial !important; background-size: initial !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em 0px 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: nowrap !important; width: auto !important;">
<code class="xml plain" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><br /></code>
<code class="xml plain" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">install file:///home/user/.m2/repository/org/apache/camel/camel-stream/2.15.0/camel-stream-2.15.0.jar</code></div>
<div class="line number2 index1 alt1" style="background-attachment: initial !important; background-clip: initial !important; background-image: none !important; background-origin: initial !important; background-position: initial !important; background-repeat: initial !important; background-size: initial !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em 0px 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: nowrap !important; width: auto !important;">
<code class="xml plain" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">start <</code><code class="xml keyword" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 102, 153) !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: bold !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">camel-stream-bundle-id</code><code class="xml plain" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">></code></div>
</div>
</td></tr>
</tbody></table>
</div>
</div>
</div>
<div style="background-color: white; color: #333333; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; margin-top: 10px;">
<br />
Then finally deploy your router bundle:</div>
<div class="code panel pdl" style="background-color: white; border-radius: 3px; border: 1px solid rgb(204, 204, 204); color: #333333; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; margin: 10px 0px; overflow: auto; padding: 0px;">
<div class="codeContent panelContent pdl" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; margin: 0px; overflow: hidden; padding: 0px;">
<div class="syntaxhighlighter nogutter xml" id="highlighter_484045" style="font-size: 1em !important; margin: 0px !important; overflow: auto !important; position: relative !important; width: 1578px;">
<table border="0" cellpadding="0" cellspacing="0" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 14px !important; height: auto !important; left: auto !important; line-height: 20px !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: 1578px;"><tbody style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="code" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px 0px 0px 15px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: 1563px;"><div class="container" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; height: auto !important; left: auto !important; margin: 15px 0px 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px 0px 15px !important; position: relative !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: pre-wrap !important; width: auto !important;" title="Hint: double-click to select code">
<div class="line number1 index0 alt2" style="background-attachment: initial !important; background-clip: initial !important; background-image: none !important; background-origin: initial !important; background-position: initial !important; background-repeat: initial !important; background-size: initial !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em 0px 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: nowrap !important; width: auto !important;">
<code class="xml plain" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><br /></code>
<code class="xml plain" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">install file:///home/user/.m2/repository/com/example/myrouter/1.0/myrouter-1.0.jar</code></div>
<div class="line number2 index1 alt1" style="background-attachment: initial !important; background-clip: initial !important; background-image: none !important; background-origin: initial !important; background-position: initial !important; background-repeat: initial !important; background-size: initial !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em 0px 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: nowrap !important; width: auto !important;">
<code class="xml plain" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">start <</code><code class="xml keyword" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 102, 153) !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: bold !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">your-bundle-id</code><code class="xml plain" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">></code></div>
</div>
</td></tr>
</tbody></table>
</div>
</div>
</div>
<h3 id="Kura-KuraRouterutilities" style="background-color: white; color: #333333; font-family: Arial, sans-serif; font-size: 16px; line-height: 1.5625; margin: 30px 0px 0px;">
Some KuraRouter utilities to make your life easier<span style="font-size: 14px; line-height: 1.4285715;"> </span></h3>
<div style="background-color: white; color: #333333; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; margin-top: 10px;">
<span style="line-height: 1.4285715;"> </span><span style="line-height: 1.5625;">Kura router base class provides many useful utilities. Let 's explore some of them.</span></div>
<h4 id="Kura-SLF4Jlogger" style="background-color: white; color: #333333; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; margin: 20px 0px 0px;">
<span style="line-height: 1.5625;"><br /></span></h4>
<div style="background-color: white; color: #333333; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; margin: 20px 0px 0px;">
<span style="line-height: 1.5625;"><b>SLF4J logger</b></span></div>
<div style="background-color: white; color: #333333; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; margin-top: 10px;">
<span style="line-height: 1.5625;">Kura uses SLF4J facade for logging purposes. Protected member <code>log</code> returns SLF4J logger instance associated with the given Kura router.</span><br />
<span style="line-height: 1.5625;"><br /></span></div>
<div class="code panel pdl" style="background-color: white; border-radius: 3px; border: 1px solid rgb(204, 204, 204); color: #333333; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; margin: 10px 0px; overflow: auto; padding: 0px;">
<div class="codeContent panelContent pdl" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; margin: 0px; overflow: hidden; padding: 0px;">
<div class="syntaxhighlighter nogutter java" id="highlighter_314051" style="font-size: 1em !important; margin: 0px !important; overflow: auto !important; position: relative !important; width: 1578px;">
<table border="0" cellpadding="0" cellspacing="0" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 14px !important; height: auto !important; left: auto !important; line-height: 20px !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: 1578px;"><tbody style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="code" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px 0px 0px 15px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: 1563px;"><div class="container" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; height: auto !important; left: auto !important; margin: 15px 0px 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px 0px 15px !important; position: relative !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: pre-wrap !important; width: auto !important;" title="Hint: double-click to select code">
<div class="line number1 index0 alt2" style="background-attachment: initial !important; background-clip: initial !important; background-image: none !important; background-origin: initial !important; background-position: initial !important; background-repeat: initial !important; background-size: initial !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em 0px 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: nowrap !important; width: auto !important;">
<code class="java keyword" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 102, 153) !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: bold !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">public</code> <code class="java keyword" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 102, 153) !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: bold !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">class</code> <code class="java plain" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">MyKuraRouter </code><code class="java keyword" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 102, 153) !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: bold !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">extends</code> <code class="java plain" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">KuraRouter {</code></div>
<div class="line number2 index1 alt1" style="background-attachment: initial !important; background-clip: initial !important; background-image: none !important; background-origin: initial !important; background-position: initial !important; background-repeat: initial !important; background-size: initial !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em 0px 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: nowrap !important; width: auto !important;">
</div>
<div class="line number3 index2 alt2" style="background-attachment: initial !important; background-clip: initial !important; background-image: none !important; background-origin: initial !important; background-position: initial !important; background-repeat: initial !important; background-size: initial !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em 0px 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: nowrap !important; width: auto !important;">
<code class="java spaces" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"> </code><code class="java color1" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: gray !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">@Override</code></div>
<div class="line number4 index3 alt1" style="background-attachment: initial !important; background-clip: initial !important; background-image: none !important; background-origin: initial !important; background-position: initial !important; background-repeat: initial !important; background-size: initial !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em 0px 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: nowrap !important; width: auto !important;">
<code class="java spaces" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"> </code><code class="java keyword" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 102, 153) !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: bold !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">public</code> <code class="java keyword" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 102, 153) !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: bold !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">void</code> <code class="java plain" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">configure() </code><code class="java keyword" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 102, 153) !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: bold !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">throws</code> <code class="java plain" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">Exception {</code></div>
<div class="line number5 index4 alt2" style="background-attachment: initial !important; background-clip: initial !important; background-image: none !important; background-origin: initial !important; background-position: initial !important; background-repeat: initial !important; background-size: initial !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em 0px 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: nowrap !important; width: auto !important;">
<code class="java spaces" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"> </code><code class="java plain" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">log.info(</code><code class="java string" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: blue !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">"Configuring Camel routes!"</code><code class="java plain" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">);</code></div>
<div class="line number6 index5 alt1" style="background-attachment: initial !important; background-clip: initial !important; background-image: none !important; background-origin: initial !important; background-position: initial !important; background-repeat: initial !important; background-size: initial !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em 0px 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: nowrap !important; width: auto !important;">
<code class="java spaces" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"> </code><code class="java plain" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">...</code></div>
<div class="line number7 index6 alt2" style="background-attachment: initial !important; background-clip: initial !important; background-image: none !important; background-origin: initial !important; background-position: initial !important; background-repeat: initial !important; background-size: initial !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em 0px 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: nowrap !important; width: auto !important;">
<code class="java spaces" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"> </code><code class="java plain" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">}</code></div>
<div class="line number8 index7 alt1" style="background-attachment: initial !important; background-clip: initial !important; background-image: none !important; background-origin: initial !important; background-position: initial !important; background-repeat: initial !important; background-size: initial !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em 0px 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: nowrap !important; width: auto !important;">
</div>
<div class="line number9 index8 alt2" style="background-attachment: initial !important; background-clip: initial !important; background-image: none !important; background-origin: initial !important; background-position: initial !important; background-repeat: initial !important; background-size: initial !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em 0px 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: nowrap !important; width: auto !important;">
<code class="java plain" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">}</code></div>
</div>
</td></tr>
</tbody></table>
</div>
</div>
</div>
<h4 id="Kura-BundleContext" style="background-color: white; color: #333333; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; margin: 20px 0px 0px;">
</h4>
<div style="background-color: white; color: #333333; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; margin: 20px 0px 0px;">
<b>
BundleContext</b></div>
<div style="background-color: white; color: #333333; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; margin-top: 10px;">
Protected member <code>bundleContext</code> returns bundle context associated with the given Kura router.<br />
<br /></div>
<div class="code panel pdl" style="background-color: white; border-radius: 3px; border: 1px solid rgb(204, 204, 204); color: #333333; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; margin: 10px 0px; overflow: auto; padding: 0px;">
<div class="codeContent panelContent pdl" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; margin: 0px; overflow: hidden; padding: 0px;">
<div class="syntaxhighlighter nogutter java" id="highlighter_294881" style="font-size: 1em !important; margin: 0px !important; overflow: auto !important; position: relative !important; width: 1578px;">
<table border="0" cellpadding="0" cellspacing="0" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 14px !important; height: auto !important; left: auto !important; line-height: 20px !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: 1578px;"><tbody style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="code" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px 0px 0px 15px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: 1563px;"><div class="container" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; height: auto !important; left: auto !important; margin: 15px 0px 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px 0px 15px !important; position: relative !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: pre-wrap !important; width: auto !important;" title="Hint: double-click to select code">
<div class="line number1 index0 alt2" style="background-attachment: initial !important; background-clip: initial !important; background-image: none !important; background-origin: initial !important; background-position: initial !important; background-repeat: initial !important; background-size: initial !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em 0px 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: nowrap !important; width: auto !important;">
<code class="java keyword" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 102, 153) !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: bold !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">public</code> <code class="java keyword" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 102, 153) !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: bold !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">class</code> <code class="java plain" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">MyKuraRouter </code><code class="java keyword" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 102, 153) !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: bold !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">extends</code> <code class="java plain" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">KuraRouter {</code></div>
<div class="line number2 index1 alt1" style="background-attachment: initial !important; background-clip: initial !important; background-image: none !important; background-origin: initial !important; background-position: initial !important; background-repeat: initial !important; background-size: initial !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em 0px 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: nowrap !important; width: auto !important;">
</div>
<div class="line number3 index2 alt2" style="background-attachment: initial !important; background-clip: initial !important; background-image: none !important; background-origin: initial !important; background-position: initial !important; background-repeat: initial !important; background-size: initial !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em 0px 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: nowrap !important; width: auto !important;">
<code class="java spaces" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"> </code><code class="java color1" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: gray !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">@Override</code></div>
<div class="line number4 index3 alt1" style="background-attachment: initial !important; background-clip: initial !important; background-image: none !important; background-origin: initial !important; background-position: initial !important; background-repeat: initial !important; background-size: initial !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em 0px 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: nowrap !important; width: auto !important;">
<code class="java spaces" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"> </code><code class="java keyword" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 102, 153) !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: bold !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">public</code> <code class="java keyword" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 102, 153) !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: bold !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">void</code> <code class="java plain" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">configure() </code><code class="java keyword" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 102, 153) !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: bold !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">throws</code> <code class="java plain" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">Exception {</code></div>
<div class="line number5 index4 alt2" style="background-attachment: initial !important; background-clip: initial !important; background-image: none !important; background-origin: initial !important; background-position: initial !important; background-repeat: initial !important; background-size: initial !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em 0px 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: nowrap !important; width: auto !important;">
<code class="java spaces" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"> </code><code class="java plain" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">ServiceReference<myservice> serviceRef = bundleContext.getServiceReference(LogService.</myservice></code><code class="java keyword" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 102, 153) !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: bold !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">class</code><code class="java plain" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">.getName());</code></div>
<div class="line number6 index5 alt1" style="background-attachment: initial !important; background-clip: initial !important; background-image: none !important; background-origin: initial !important; background-position: initial !important; background-repeat: initial !important; background-size: initial !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em 0px 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: nowrap !important; width: auto !important;">
<code class="java spaces" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"> </code><code class="java plain" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">MyService myService = content.getService(serviceRef);</code></div>
<div class="line number7 index6 alt2" style="background-attachment: initial !important; background-clip: initial !important; background-image: none !important; background-origin: initial !important; background-position: initial !important; background-repeat: initial !important; background-size: initial !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em 0px 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: nowrap !important; width: auto !important;">
<code class="java spaces" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"> </code><code class="java plain" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">...</code></div>
<div class="line number8 index7 alt1" style="background-attachment: initial !important; background-clip: initial !important; background-image: none !important; background-origin: initial !important; background-position: initial !important; background-repeat: initial !important; background-size: initial !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em 0px 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: nowrap !important; width: auto !important;">
<code class="java spaces" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"> </code><code class="java plain" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">}</code></div>
<div class="line number9 index8 alt2" style="background-attachment: initial !important; background-clip: initial !important; background-image: none !important; background-origin: initial !important; background-position: initial !important; background-repeat: initial !important; background-size: initial !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em 0px 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: nowrap !important; width: auto !important;">
</div>
<div class="line number10 index9 alt1" style="background-attachment: initial !important; background-clip: initial !important; background-image: none !important; background-origin: initial !important; background-position: initial !important; background-repeat: initial !important; background-size: initial !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em 0px 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: nowrap !important; width: auto !important;">
<code class="java plain" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">}</code></div>
</div>
</td></tr>
</tbody></table>
</div>
</div>
</div>
<h4 id="Kura-CamelContext" style="background-color: white; color: #333333; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; margin: 20px 0px 0px;">
</h4>
<div style="background-color: white; color: #333333; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; margin: 20px 0px 0px;">
<b>
CamelContext</b></div>
<div style="background-color: white; color: #333333; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; margin-top: 10px;">
Protected member <code>camelContext</code> is the <code>CamelContext</code> associated with the given Kura router.</div>
<div class="code panel pdl" style="background-color: white; border-radius: 3px; border: 1px solid rgb(204, 204, 204); color: #333333; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; margin: 10px 0px; overflow: auto; padding: 0px;">
<div class="codeContent panelContent pdl" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; margin: 0px; overflow: hidden; padding: 0px;">
<div class="syntaxhighlighter nogutter java" id="highlighter_702468" style="font-size: 1em !important; margin: 0px !important; overflow: auto !important; position: relative !important; width: 1578px;">
<table border="0" cellpadding="0" cellspacing="0" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 14px !important; height: auto !important; left: auto !important; line-height: 20px !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: 1578px;"><tbody style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="code" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px 0px 0px 15px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: 1563px;"><div class="container" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; height: auto !important; left: auto !important; margin: 15px 0px 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px 0px 15px !important; position: relative !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: pre-wrap !important; width: auto !important;" title="Hint: double-click to select code">
<div class="line number1 index0 alt2" style="background-attachment: initial !important; background-clip: initial !important; background-image: none !important; background-origin: initial !important; background-position: initial !important; background-repeat: initial !important; background-size: initial !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em 0px 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: nowrap !important; width: auto !important;">
<code class="java keyword" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 102, 153) !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: bold !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><br /></code>
<code class="java keyword" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 102, 153) !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: bold !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">public</code> <code class="java keyword" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 102, 153) !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: bold !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">class</code> <code class="java plain" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">MyKuraRouter </code><code class="java keyword" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 102, 153) !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: bold !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">extends</code> <code class="java plain" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">KuraRouter {</code></div>
<div class="line number2 index1 alt1" style="background-attachment: initial !important; background-clip: initial !important; background-image: none !important; background-origin: initial !important; background-position: initial !important; background-repeat: initial !important; background-size: initial !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em 0px 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: nowrap !important; width: auto !important;">
</div>
<div class="line number3 index2 alt2" style="background-attachment: initial !important; background-clip: initial !important; background-image: none !important; background-origin: initial !important; background-position: initial !important; background-repeat: initial !important; background-size: initial !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em 0px 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: nowrap !important; width: auto !important;">
<code class="java spaces" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"> </code><code class="java color1" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: gray !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">@Override</code></div>
<div class="line number4 index3 alt1" style="background-attachment: initial !important; background-clip: initial !important; background-image: none !important; background-origin: initial !important; background-position: initial !important; background-repeat: initial !important; background-size: initial !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em 0px 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: nowrap !important; width: auto !important;">
<code class="java spaces" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"> </code><code class="java keyword" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 102, 153) !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: bold !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">public</code> <code class="java keyword" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 102, 153) !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: bold !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">void</code> <code class="java plain" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">configure() </code><code class="java keyword" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 102, 153) !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: bold !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">throws</code> <code class="java plain" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">Exception {</code></div>
<div class="line number5 index4 alt2" style="background-attachment: initial !important; background-clip: initial !important; background-image: none !important; background-origin: initial !important; background-position: initial !important; background-repeat: initial !important; background-size: initial !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em 0px 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: nowrap !important; width: auto !important;">
<code class="java spaces" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"> </code><code class="java plain" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">camelContext.getStatus();</code></div>
<div class="line number6 index5 alt1" style="background-attachment: initial !important; background-clip: initial !important; background-image: none !important; background-origin: initial !important; background-position: initial !important; background-repeat: initial !important; background-size: initial !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em 0px 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: nowrap !important; width: auto !important;">
<code class="java spaces" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"> </code><code class="java plain" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">...</code></div>
<div class="line number7 index6 alt2" style="background-attachment: initial !important; background-clip: initial !important; background-image: none !important; background-origin: initial !important; background-position: initial !important; background-repeat: initial !important; background-size: initial !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em 0px 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: nowrap !important; width: auto !important;">
<code class="java spaces" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"> </code><code class="java plain" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">}</code></div>
<div class="line number8 index7 alt1" style="background-attachment: initial !important; background-clip: initial !important; background-image: none !important; background-origin: initial !important; background-position: initial !important; background-repeat: initial !important; background-size: initial !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em 0px 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: nowrap !important; width: auto !important;">
</div>
<div class="line number9 index8 alt2" style="background-attachment: initial !important; background-clip: initial !important; background-image: none !important; background-origin: initial !important; background-position: initial !important; background-repeat: initial !important; background-size: initial !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em 0px 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: nowrap !important; width: auto !important;">
<code class="java plain" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">}</code></div>
</div>
</td></tr>
</tbody></table>
</div>
</div>
</div>
<h4 id="Kura-OSGiserviceresolver" style="background-color: white; color: #333333; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; margin: 20px 0px 0px;">
</h4>
<h2 style="background-color: white; color: #333333; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; margin: 20px 0px 0px;">
OSGi service resolver</h2>
<div style="background-color: white; color: #333333; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; margin-top: 10px;">
OSGi service resolver (<code>service(Class<t> serviceType)</t></code>) can be used to easily retrieve service by type from the OSGi bundle context.</div>
<div class="code panel pdl" style="background-color: white; border-radius: 3px; border: 1px solid rgb(204, 204, 204); color: #333333; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; margin: 10px 0px; overflow: auto; padding: 0px;">
<div class="codeContent panelContent pdl" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; margin: 0px; overflow: hidden; padding: 0px;">
<div class="syntaxhighlighter nogutter java" id="highlighter_319771" style="font-size: 1em !important; margin: 0px !important; overflow: auto !important; position: relative !important; width: 1578px;">
<table border="0" cellpadding="0" cellspacing="0" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 14px !important; height: auto !important; left: auto !important; line-height: 20px !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: 1578px;"><tbody style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="code" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px 0px 0px 15px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: 1563px;"><div class="container" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; height: auto !important; left: auto !important; margin: 15px 0px 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px 0px 15px !important; position: relative !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: pre-wrap !important; width: auto !important;" title="Hint: double-click to select code">
<div class="line number1 index0 alt2" style="background-attachment: initial !important; background-clip: initial !important; background-image: none !important; background-origin: initial !important; background-position: initial !important; background-repeat: initial !important; background-size: initial !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em 0px 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: nowrap !important; width: auto !important;">
<code class="java keyword" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 102, 153) !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: bold !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><br /></code>
<code class="java keyword" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 102, 153) !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: bold !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">public</code> <code class="java keyword" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 102, 153) !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: bold !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">class</code> <code class="java plain" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">MyKuraRouter </code><code class="java keyword" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 102, 153) !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: bold !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">extends</code> <code class="java plain" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">KuraRouter {</code></div>
<div class="line number2 index1 alt1" style="background-attachment: initial !important; background-clip: initial !important; background-image: none !important; background-origin: initial !important; background-position: initial !important; background-repeat: initial !important; background-size: initial !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em 0px 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: nowrap !important; width: auto !important;">
</div>
<div class="line number3 index2 alt2" style="background-attachment: initial !important; background-clip: initial !important; background-image: none !important; background-origin: initial !important; background-position: initial !important; background-repeat: initial !important; background-size: initial !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em 0px 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: nowrap !important; width: auto !important;">
<code class="java spaces" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"> </code><code class="java color1" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: gray !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">@Override</code></div>
<div class="line number4 index3 alt1" style="background-attachment: initial !important; background-clip: initial !important; background-image: none !important; background-origin: initial !important; background-position: initial !important; background-repeat: initial !important; background-size: initial !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em 0px 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: nowrap !important; width: auto !important;">
<code class="java spaces" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"> </code><code class="java keyword" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 102, 153) !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: bold !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">public</code> <code class="java keyword" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 102, 153) !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: bold !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">void</code> <code class="java plain" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">configure() </code><code class="java keyword" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 102, 153) !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: bold !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">throws</code> <code class="java plain" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">Exception {</code></div>
<div class="line number5 index4 alt2" style="background-attachment: initial !important; background-clip: initial !important; background-image: none !important; background-origin: initial !important; background-position: initial !important; background-repeat: initial !important; background-size: initial !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em 0px 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: nowrap !important; width: auto !important;">
<code class="java spaces" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"> </code><code class="java plain" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">MyService myService = service(MyService.</code><code class="java keyword" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 102, 153) !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: bold !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">class</code><code class="java plain" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">);</code></div>
<div class="line number6 index5 alt1" style="background-attachment: initial !important; background-clip: initial !important; background-image: none !important; background-origin: initial !important; background-position: initial !important; background-repeat: initial !important; background-size: initial !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em 0px 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: nowrap !important; width: auto !important;">
<code class="java spaces" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"> </code><code class="java plain" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">...</code></div>
<div class="line number7 index6 alt2" style="background-attachment: initial !important; background-clip: initial !important; background-image: none !important; background-origin: initial !important; background-position: initial !important; background-repeat: initial !important; background-size: initial !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em 0px 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: nowrap !important; width: auto !important;">
<code class="java spaces" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"> </code><code class="java plain" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">}</code></div>
<div class="line number8 index7 alt1" style="background-attachment: initial !important; background-clip: initial !important; background-image: none !important; background-origin: initial !important; background-position: initial !important; background-repeat: initial !important; background-size: initial !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em 0px 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: nowrap !important; width: auto !important;">
</div>
<div class="line number9 index8 alt2" style="background-attachment: initial !important; background-clip: initial !important; background-image: none !important; background-origin: initial !important; background-position: initial !important; background-repeat: initial !important; background-size: initial !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em 0px 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: nowrap !important; width: auto !important;">
<code class="java plain" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">}</code></div>
</div>
</td></tr>
</tbody></table>
</div>
</div>
</div>
<h3 id="Kura-KuraRouteractivatorcallbacks" style="background-color: white; color: #333333; font-family: Arial, sans-serif; font-size: 16px; line-height: 1.5625; margin: 30px 0px 0px;">
</h3>
<h3 id="Kura-KuraRouteractivatorcallbacks" style="background-color: white; color: #333333; font-family: Arial, sans-serif; font-size: 16px; line-height: 1.5625; margin: 30px 0px 0px;">
How can I configure CamelContext used by KuraRouter?</h3>
<div style="background-color: white; color: #333333; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; margin-top: 10px;">
Kura router comes with the lifecycle callbacks that can be used to customize the way the Camel router works. For example to configure the <code>CamelContext</code> instance associated with the router just before the former is started, override <code>beforeStart</code>method of the <code>KuraRouter</code> class:</div>
<div class="code panel pdl" style="background-color: white; border-radius: 3px; border: 1px solid rgb(204, 204, 204); color: #333333; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; margin: 10px 0px; overflow: auto; padding: 0px;">
<div class="codeContent panelContent pdl" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; margin: 0px; overflow: hidden; padding: 0px;">
<div class="syntaxhighlighter nogutter java" id="highlighter_523463" style="font-size: 1em !important; margin: 0px !important; overflow: auto !important; position: relative !important; width: 1578px;">
<br />
<table border="0" cellpadding="0" cellspacing="0" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 14px !important; height: auto !important; left: auto !important; line-height: 20px !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: 1578px;"><tbody style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="code" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px 0px 0px 15px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: 1563px;"><div class="container" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; height: auto !important; left: auto !important; margin: 15px 0px 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px 0px 15px !important; position: relative !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: pre-wrap !important; width: auto !important;" title="Hint: double-click to select code">
<div class="line number1 index0 alt2" style="background-attachment: initial !important; background-clip: initial !important; background-image: none !important; background-origin: initial !important; background-position: initial !important; background-repeat: initial !important; background-size: initial !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em 0px 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: nowrap !important; width: auto !important;">
<code class="java keyword" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 102, 153) !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: bold !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">public</code> <code class="java keyword" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 102, 153) !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: bold !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">class</code> <code class="java plain" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">MyKuraRouter </code><code class="java keyword" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 102, 153) !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: bold !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">extends</code> <code class="java plain" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">KuraRouter {</code></div>
<div class="line number2 index1 alt1" style="background-attachment: initial !important; background-clip: initial !important; background-image: none !important; background-origin: initial !important; background-position: initial !important; background-repeat: initial !important; background-size: initial !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em 0px 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: nowrap !important; width: auto !important;">
</div>
<div class="line number3 index2 alt2" style="background-attachment: initial !important; background-clip: initial !important; background-image: none !important; background-origin: initial !important; background-position: initial !important; background-repeat: initial !important; background-size: initial !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em 0px 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: nowrap !important; width: auto !important;">
<code class="java spaces" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"> </code><code class="java plain" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">...</code></div>
<div class="line number4 index3 alt1" style="background-attachment: initial !important; background-clip: initial !important; background-image: none !important; background-origin: initial !important; background-position: initial !important; background-repeat: initial !important; background-size: initial !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em 0px 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: nowrap !important; width: auto !important;">
</div>
<div class="line number5 index4 alt2" style="background-attachment: initial !important; background-clip: initial !important; background-image: none !important; background-origin: initial !important; background-position: initial !important; background-repeat: initial !important; background-size: initial !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em 0px 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: nowrap !important; width: auto !important;">
<code class="java spaces" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"> </code><code class="java keyword" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 102, 153) !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: bold !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">protected</code> <code class="java keyword" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 102, 153) !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: bold !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">void</code> <code class="java plain" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">beforeStart(CamelContext camelContext) {</code></div>
<div class="line number6 index5 alt1" style="background-attachment: initial !important; background-clip: initial !important; background-image: none !important; background-origin: initial !important; background-position: initial !important; background-repeat: initial !important; background-size: initial !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em 0px 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: nowrap !important; width: auto !important;">
<code class="java spaces" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"> </code><code class="java plain" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">OsgiDefaultCamelContext osgiContext = (OsgiCamelContext) camelContext;</code></div>
<div class="line number7 index6 alt2" style="background-attachment: initial !important; background-clip: initial !important; background-image: none !important; background-origin: initial !important; background-position: initial !important; background-repeat: initial !important; background-size: initial !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em 0px 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: nowrap !important; width: auto !important;">
<code class="java spaces" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"> </code><code class="java plain" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">osgiContext.setName(</code><code class="java string" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: blue !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">"NameOfTheRouter"</code><code class="java plain" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">);</code></div>
<div class="line number8 index7 alt1" style="background-attachment: initial !important; background-clip: initial !important; background-image: none !important; background-origin: initial !important; background-position: initial !important; background-repeat: initial !important; background-size: initial !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em 0px 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: nowrap !important; width: auto !important;">
<code class="java spaces" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"> </code><code class="java plain" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">}</code></div>
<div class="line number9 index8 alt2" style="background-attachment: initial !important; background-clip: initial !important; background-image: none !important; background-origin: initial !important; background-position: initial !important; background-repeat: initial !important; background-size: initial !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em 0px 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: nowrap !important; width: auto !important;">
</div>
<div class="line number10 index9 alt1" style="background-attachment: initial !important; background-clip: initial !important; background-image: none !important; background-origin: initial !important; background-position: initial !important; background-repeat: initial !important; background-size: initial !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em 0px 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: nowrap !important; width: auto !important;">
<code class="java plain" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">}</code></div>
</div>
</td></tr>
</tbody></table>
</div>
<div class="syntaxhighlighter nogutter java" id="highlighter_523463" style="font-size: 1em !important; margin: 0px !important; overflow: auto !important; position: relative !important; width: 1578px;">
<br /></div>
<h3 id="Kura-KuraRouteractivatorcallbacks" style="background-color: white; color: #333333; font-family: Arial, sans-serif; font-size: 16px; line-height: 1.5625; margin: 30px 0px 0px;">
What's next?</h3>
<h3>
<div style="background-color: white; color: #333333; font-family: Arial, sans-serif; font-size: 14px; font-weight: normal; line-height: 20px; margin-top: 10px;">
The current version of the Camel Kura component provides some useful utilities and simplifies Camel deployments into Kura by providing the opinionated Camel router. However there is still a space for the improvements in the regards of Camel Kura functionality. For example I can imagine predefined Camel components providing consumers/producers for the device services provided by the Kura. Or predefined Camel expressions that could be used to perform the <a href="http://camel.apache.org/content-based-router.html">content based routing</a> based on the data read from the Raspberry Pi sensors. I plan to add more features to the Camel Kura in the next releases of Camel. Keep also in mind that we do <a href="http://camel.apache.org/contributing.html">love contributors</a> in the Apache Camel community - if you think you got something that could be added to the Camel Kura, just drop me a line! </div>
</h3>
</div>
</div>
Henryk Konsekhttp://www.blogger.com/profile/09392743290349794069noreply@blogger.com0tag:blogger.com,1999:blog-2199838449876727292.post-8549835855713522402015-01-04T12:54:00.000-08:002015-01-04T12:54:13.846-08:00MongoDB references worth your timeHere are some MongoDB references "certified by Henry" :) Wanna work with MongoDB? Give'em a shot!<br />
<br />
<ul>
<li>Manning's <a href="http://www.manning.com/banker">MongoDB in Action</a> by Kyle Banker - 312 pages of the perfect introduction to the MongoDB.</li>
<li><a href="http://docs.mongodb.org/ecosystem/drivers/java/">MongoDB Java driver</a> - basic Java client API.</li>
<li><a href="http://camel.apache.org/mongodb.html">Camel MongoDB component</a> - if you would like to orchestrate some message sources (like REST facade) with highly-scalable MongoDB document store, Camel MongoDB is a way to go.</li>
<li><a href="http://projects.spring.io/spring-data-mongodb/">Spring Data MongoDB</a> - Spring Data DAO for MongoDB is very handly if you can predict what documents will be used against MongoDB.</li>
<li><a href="http://docs.spring.io/spring-data/mongodb/docs/current/reference/html/#mongo-template">Spring Mongo template</a> - nice layer of abstraction over the <a href="http://docs.mongodb.org/ecosystem/tutorial/getting-started-with-java-driver/#getting-started-with-java-driver">MongoDB Java driver</a>.</li>
</ul>
Henryk Konsekhttp://www.blogger.com/profile/09392743290349794069noreply@blogger.com0tag:blogger.com,1999:blog-2199838449876727292.post-62365119916433897242015-01-02T17:02:00.000-08:002015-01-02T17:02:12.015-08:00Camel Spring Boot and type conversion API bridgeSpring comes with the powerful <a href="http://docs.spring.io/spring/docs/current/spring-framework-reference/html/validation.html#core-convert">type conversion API</a>. Spring API happens not to be much different from the <a href="https://cwiki.apache.org/confluence/display/CAMEL/Type+Converter">Camel type converter API</a>. As those APIs are so similar, <a href="camel.apache.org/spring-boot.html">Camel Spring Boot</a> automatically registers bridge converter (SpringTypeConverter) that delegates to the Spring conversion API.
<br><br>
It basically means that out-of-the-box Camel will threat Spring Converters as Camel ones. With this approach you can enjoy both Camel and Spring converters accessed via Camel TypeConverter API:
<br>
<pre class="brush:java">
@Component
public class InvoiceProcessor {
@Autowired
private TypeConverter typeConverter;
public UUID parseInvoiceId(Invoice invoice) {
// Using Spring's StringToUUIDConverter
UUID id = invoice.typeConverter.convertTo(UUID.class, invoice.getId());
}
}
</pre>
<br>
Under the hood Camel Spring Boot delegates conversion to the Spring's <b><a href="http://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/core/convert/ConversionService.html">ConversionService</a></b>. If no <b>ConversionService</b> instance is available, Camel Spring Boot auto-configuration will create one for you.
Henryk Konsekhttp://www.blogger.com/profile/09392743290349794069noreply@blogger.com0tag:blogger.com,1999:blog-2199838449876727292.post-15168014938558501972014-10-29T12:58:00.000-07:002014-10-29T12:58:09.373-07:00Using Apache Camel with Spring BootSome time ago I created a <a href="http://projects.spring.io/spring-boot/">Spring Boot</a> auto-configuration module for the <a href="camel.apache.org">Apache Camel</a>. Initially it was a part of the <a href="http://fabric8.io/gitbook/springBootContainer.html">Fabric8 Spring Boot support</a>, but I decided that the module deserves its own life under the Apache Camel umbrella, so I've just moved it there. <a href="http://camel.apache.org/spring-boot.html">Spring Boot module</a> will be available starting from Camel 2.15.0.<br />
<br />
<hr>
<h3>
What is Camel auto-configuration for Spring Boot?</h3>
<br>
Spring Boot Camel component provides auto-configuration for the Apache Camel. Our opinionated auto-configuration of the Camel context auto-detects Camel routes available in the Spring context and registers the key Camel utilities (like producer template, consumer template and the type converter) as beans.<br />
<br />
<hr>
<h3>
How to enable Camel auto-configuration in my Spring Boot application?</h3>
<br>
Just drop <b>camel-spring-boot</b> jar into your classpath:<br />
<br />
<pre class="brush:xml">
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-spring-boot</artifactId>
<version>${camel.version}</version> <!-- use the same version as your Camel core version -->
</dependency>
</pre>
<br>
<b>camel-spring-boot</b> jar comes with the <b>spring.factories</b> file, so as soon as you add that dependency into your classpath, Spring Boot will automatically auto-configure the Camel for you. Yay! That was fast ;) .
<br>
<br>
<br>
<hr>
<h3>Auto-configured Camel context</h3>
<br>
The most important piece of functionality provided by the Camel auto-configuration is the <b>CamelContext</b> instance. Camel auto-configuration creates <a href="http://camel.apache.org/maven/current/camel-spring/apidocs/org/apache/camel/spring/SpringCamelContext.html">SpringCamelContext</a> for your and take care of the proper initialization and shutdown of that context. Created Camel context is also registered in the Spring application context (under <b>camelContext</b> bean name), so you can access it just as the any other Spring bean.
<pre class="brush:java">
@Configuration
public class MyAppConfig {
@Autowired
CamelContext camelContext;
@Bean
MyService myService() {
return new DefaultMyService(camelContext);
}
}
</pre>
Keep in mind however that usually you don't really have to inject <b>CamelContext</b> directly into your application, as you can use the feature called...
<br><br><br>
<hr>
<h3>
Auto-detecting Camel routes
</h3>
<br>
Camel auto-configuration collects all the <a href="https://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/RoutesBuilder.html">RoutesBuilder</a> instances from the Spring context and automatically injects them into the provided <b>CamelContext</b>. It means that creating new Camel route with the Spring Boot starter is as simple as adding the <b>@Component</b> annotated class into your classpath...
<pre class="brush:java">
@Component
public class MyRouter extends RouteBuilder {
@Override
public void configure() throws Exception {
from("jms:invoices").to("file:/invoices");
}
}
</pre>
...or creating a new route <b>RoutesBuilder</b> bean in your <b>@Configuration</b> class:
<pre class="brush:java">
@Configuration
public class MyRouterConfiguration {
@Bean
RoutesBuilder myRouter() {
return new RouteBuilder() {
@Override
public void configure() throws Exception {
from("jms:invoices").to("file:/invoices");
}
};
}
}
</pre>
<br>
Ideally, you should not wire routes into the <b>CamelContext</b> by yourself. It is simpler just to add them to the classpath and let the Spring Boot to wire them for you.
<br>
<hr>
<h3>
Camel properties
</h3><br>
Spring Boot auto-configuration automatically connect <a href="http://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-external-config.html">Spring Boot external configuration</a> (like properties placeholders, OS environment variables or system properties) with the <a href="http://camel.apache.org/properties.html">Camel properties</a> support. It basically means that any property defined in <b>application.properties</b> file...
<pre class="brush:java">
route.from = jms:invoices
</pre>
...or set via the system property...
<pre class="brush:bash">
java -Droute.to=jms:processed.invoices -jar mySpringApp.jar
</pre>
...can be used as the placeholder in the Camel route:
<pre class="brush:java">
@Component
public class MyRouter extends RouteBuilder {
@Override
public void configure() throws Exception {
from("{{route.from}}").to("{{route.to}}");
}
}
</pre>
<br>
Basically any property available for the Spring property resolver can be resolved by the Camel properties component as well.
<br>
<hr>
<h3>
Customizing Camel context configuration
</h3><br>
If you would like to perform some operations on CamelContext bean created by Camel auto-configuration, register <b>CamelContextConfiguration</b> instance in your Spring context:
<pre class="brush:java">
@Configuration
public class MyAppConfig {
...
@Bean
CamelContextConfiguration contextConfiguration() {
return new CamelContextConfiguration() {
@Override
void beforeStart(CamelContext context) {
// your custom configuration goes here
}
};
}
}
</pre>
Method <b>CamelContextConfiguration#beforeStart(CamelContext)</b> will be call just before the Spring starts the auto-configured <b>CamelContext</b>.
<br>
<hr>
<h3>
Auto-configured consumer and producer templates
</h3><br>
Camel auto-configuration provides a pre-configured <a href="http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/ConsumerTemplate.html">ConsumerTemplate</a> and <a href="http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/ProducerTemplate.html">ProducerTemplate</a> instances. You can simply inject them into your Spring-managed beans:
<pre class="brush:java">
@Component
public class InvoiceProcessor {
@Autowired
private ProducerTemplate producerTemplate;
@Autowired
private ConsumerTemplate consumerTemplate;
public void processNextInvoice() {
Invoice invoice = consumerTemplate.receiveBody("jms:invoices", Invoice.class);
...
producerTemplate.sendBody("netty-http:http://invoicing.com/received/" + invoice.id());
}
}
</pre>
In the example above I read a message from the JMS queue, convert it into the domain class called <b>Invoice</b> and finally use HTTP call to send confirmation to some external system that I processed the invoice. No Camel routes here, only consumer/producer templates.
<br><br>
By default consumer and producer templates come with the endpoint cache sizes equal to 1000. You can change that values via the following Spring properties:
<pre class="brush:java">
camel.springboot.consumerTemplateCacheSize = 100
camel.springboot.producerTemplateCacheSize = 200
</pre>
<br>
<hr>
<h3>
Auto-configured TypeConverter
</h3><br>
Camel auto-configuration registers <a href="http://camel.apache.org/type-converter.html">TypeConverter</a> instance named <b>typeConverter</b> in the Spring context.
<pre class="brush:java">
@Component
public class InvoiceProcessor {
@Autowired
private TypeConverter typeConverter;
public long parseInvoiceValue(Invoice invoice) {
String invoiceValue = invoice.grossValue();
return typeConverter.convertTo(Long.class, invoiceValue);
}
}
</pre>
As you can see the type converter is pretty handy when performing conversions between two data types, so it is very useful to have it available in your Spring components.
<br>
<hr>
<h3>
What's next?
</h3><br>
There are still many features I'd like to see in Camel Spring Boot. Just to mention some of them:
<ul>
<li><b>Test helpers API</b>. We don't really need a full-blown testing API, like for the old <a href="http://camel.apache.org/testing.html">Camel</a> or <a href="http://camel.apache.org/spring-testing.html">Camel Spring</a>. Spring Boot testing API enhanced by the Camel auto-configuration is flexible enough to handle all the most important testing scenarios (like loading routes, overriding the configuration and so forth) without any additional Camel-specific testing utilities. However having a base class with some extra helper methods to avoid testing-code boilerplate will be always appreciated.
<li><b>Registering custom converters</b>. I'd like to make it really easy to register new Camel type converters. As simple as adding new converter bean to the Spring context.
<li><b>Bridge between Spring and Camel converters</b>. Spring comes with its own types converter API. I will be nice to bridge Spring converters to Camel (and reversely) so end-users could benefit from the maximum number of converters available for them.
<li><b>Making sure that Camel components work nicely with Spring Boot</b>. That would require creating some pull requests to Spring Boot upstream and changes in the code of some components to be sure that those can properly pick up the beans pre-configured by Spring Boot. For example I would like to be sure that <a href="http://camel.apache.org/jpa.html">camel-jpa component</a> plays nicely with the default Hibernate configuration provided by the Spring Boot JPA auto-configuration.
</ul>
<br>
<hr>
<h3>
Give it a shot!
</h3><br>
Just try to use the new Spring Boot support for Camel and let me know what do you think of it. Do you feel it lacks some functionality? Something is not working as it should? Our documentation sucks? Feel free to <a href="https://twitter.com/hekonsek">ping me</a>.Henryk Konsekhttp://www.blogger.com/profile/09392743290349794069noreply@blogger.com29tag:blogger.com,1999:blog-2199838449876727292.post-7107645323592203292014-10-17T13:08:00.000-07:002014-10-17T13:12:41.719-07:00Six major changes in the Fabric8 V2<div class="separator" style="clear: both; text-align: center;">
<a href="http://fabric8.io/images/fabric8_logo_stacked.svg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="http://fabric8.io/images/fabric8_logo_stacked.svg" height="154" width="200" /></a></div>
<br />
As some of you may know from my <a href="https://twitter.com/hekonsek">tweets</a>, the <a href="http://fabric8.io/">Fabric8</a> team started to work on the v2 branch of the project. You may also already know that this version of Fabric8 will bring some <a href="http://fabric8.io/v2/faqGeneral.html">major architectural changes</a>. All of those are for better in my humble opinion, even if you may find them a bit aggressive ;) .<br />
<br />
<h3>
Change #1: Docker and Kubernetes will be required to run Fabric8</h3>
Yes. Containers are the big thing. They will change the way we deploy and manage our software. The new version of Fabric8 fully embraces the containerization trend. It means that Fabric8 is designed to work on top of <a href="https://github.com/GoogleCloudPlatform/kubernetes">Kubernetes</a> and <a href="https://www.docker.com/">Docker</a>. Fabric8 will work in any environment providing the Kubernetes platform such as <a href="http://www.projectatomic.io/">RHEL Atomic</a>, <a href="https://www.openshift.com/">OpenShift</a>, <a href="https://cloud.google.com/compute/">Google Compute Engine</a>, <a href="http://azure.microsoft.com/">Azure</a> and so forth.<br />
<br />
For platforms not supporting Docker, there will be a Kubernetes <a href="http://fabric8.io/v2/emulation.html">emulator layer</a>. But come on, don't resist the changes in the industry - just invest into the Docker and Kubernetes. If <a href="https://blog.docker.com/2014/10/docker-microsoft-partner-distributed-applications/">Microsoft did it</a>, you can do it as well :) .<br />
<br />
<h3>
Change #2: No ZooKeeper runtime registry</h3>
There will be no <a href="http://zookeeper.apache.org/">ZooKeeper</a> ensemble in the Fabric8 anymore. Fabric8 1.x used ZooKeeper to share the runtime information between applications and to discover services. Kubernetes comes with the <a href="https://github.com/coreos/etcd">etcd</a> internally which serves much of the same purpose and has support for the services binding, so Fabric8 v2 doesn't need ZooKeeper registry anymore for general purpose provisioning of containers and services.<br />
<br />
However certain services will still require master slave election and partitioning functionality (such as running clusters of ActiveMQ); where either etcd or Apache ZooKeeper is required. If a Kubernetes environment allows it, then Fabric8 could reuse the underlying etcd cluster; otherwise an etcd or ZooKeeper clusters is required for things like ActiveMQ clustering.<br />
<br />
<h3>
Change #3: No profiles to configure application deployment</h3>
There will be no profiles in Fabric8 anymore. Starting from v2 Fabric8 uses <a href="http://fabric8.io/v2/apps.html">app</a> JSON files (i.e. Kubernetes extension proposed by OpenShift 3) to configure deployment of the managed application. More detailed configuration (like properties or YAML files) can be added to the file system of the deployed application's Docker image.<br />
<br />
<h3>
Change #4: Git repository isn't mandatory</h3>
Applications' configuration isn't stored in Git repository as it used to be in Fabric8 v1. As Fabric8 v2 doesn't use profiles (but app templates instead), the Git repository is not needed anymore. You can just store application's configuration (app file) in the Maven project and use the <a href="http://fabric8.io/v2/mavenPlugin.html#running">Fabric8 Maven plugin to start</a> the application in the Kubernetes without keeping the configuration in any central repository (like Git).<br />
<br />
However keeping app files in Git for easier configuration management can be useful. That's why Hawt.io provides this functionality for you. You can push your configuration to the Hawt.io Git repository via <a href="http://fabric8.io/v2/mavenPlugin.html#deploying">fabric8:deploy</a> Maven goal. Fabric8 uses <a href="http://fabric8.io/v2/appzip.html">App Zip</a> packaging format to distribute the configuration between the various environments.<br />
<br />
<h3>
Change #5: There is not Fabric8 "server" anymore</h3>
Starting from Fabric8 v2 Kubernetes is responsible for providing the runtime registry for the managed applications. It means that you don't have to start any dedicated Fabric8 deamon. Tools like <a href="http://fabric8.io/v2/mavenPlugin.html">Fabric8 Maven plugin</a> or <a href="http://hawt.io/">Hawt.io</a> can connect directly to the Kubernetes and deploy into it or manage the applications.<br />
<br />
<h3>
Change #6: No Fabric8 server == no (Karaf) Fabric8 shell</h3>
If you are the shell kind of person (like me!), you probably enjoy Karaf-based Fabric8 shell very much. As there is no "Fabric8 server" anymore, Karaf won't provide the default shell any longer. For the Fabric8 v2 development activities, the recommended tool is <a href="http://forge.jboss.org/">JBoss Forge</a> with the <a href="https://github.com/fabric8io/fabric8/tree/2.0/forge-addons">Fabric8 add-on</a>. For provisioning purposes (like creating containers/services or changing the replica sizes) the default shell is OpenShift/Kube. Kube will be included in <a href="http://www.redhat.com/en/technologies/linux-platforms/enterprise-linux">Red Hat Enterprise Linux</a> and OpenShift V3 and is the standard shell for provisioning any kind of the container.<br />
<br />
Technically, you can install Karaf server into the Kubernetes and enjoy the part of the old Fabric8 shell commands, but keep in mind that main development efforts will be focused on Kube and Forge commands.<br />
<br />
<h3>
Give it a shot</h3>
Wanna try new Fabric8 V2? <a href="http://fabric8.io/v2/getStarted.html">Here</a> is the detailed guide how to install it locally and deploy a sample application into it. Got problems with installation? Ping us on <a href="https://groups.google.com/forum/#!forum/fabric8">Fabric8 forum</a> - we'd love to help you.Henryk Konsekhttp://www.blogger.com/profile/09392743290349794069noreply@blogger.com9