OSGi-based IoT gateway for the field devices.
OSGi● modularity system for Java● provides modules classpath separation● promotes hot runtime redeployments
What is Eclipse Kura?
OSGi Application Container (Eclipse Equinox, Concierge)
Java SE 7 / 8 (OpenJDK)
@hekonsek
What is Eclipse Kura?IoT gateway● collects messages from the edge devices (like sensors)● performs messages processing/aggregation/forwarding
OSGi-based IoT gateway for the field devices.
OSGi Application Container (Eclipse Equinox, Concierge)
Java SE 7 / 8 (OpenJDK)
Serial GPIO HID BLE I2C Field protocols
Networking Gateway Services Web UI Remote Management
Cloud Services Data Services EP
Connectivity and Delivery
@hekonsek
How to orchestrate messages flow.
What is message routing?
● Apache Camel● Spring Integration● Mule
@hekonsek
- read message from JMS queue - transform to JSON- save to FTP and MongoDB
Crash course to the Apache Camel
from('jms:invoices'). transform { new Invoice(uuid(), it.in.body) }. marshal().json(Jackson). multicast().parallelProcessing(). to('ftp:myftp.com/invoices', 'mongodb:myDb?collection=invoices&operation=save')]
@hekonsek
Camel provides ~200 OSGi-ready connectors (JMS, REST, CoAP, AMQP, MQTT…)
How can Kura benefit from Camel?@hekonsek
How can I control which parts of a field device should be running at the given moment?
EIP - control bus@hekonsek
Invoke REST method every second.
Camel route module for Kura
public class MyKuraRouter extends KuraRouter { @Override public void configure() throws Exception { from("timer:trigger"). to("netty4-http:http://app.mydatacenter.com/api"); } }
@hekonsek
Just deploy the route as the OSGi bundle and enjoy Camel running the Kura.
Concerned about the lifecycle?@hekonsek
Display WiFi networks accessible near the field device using the web browser.
Fancy example #1
public class MyKuraRouter extends KuraRouter { @Override public void configure() throws Exception { from("netty4-http:http://0.0.0.0:18080"). to("bean:org.eclipse.kura.net.NetworkService?method=getAllWifiAccessPoints"); } }
@hekonsek
Start syncing cached data only when WiFi is accessible.
Fancy example #2
public class MyKuraRouter extends KuraRouter { @Override public void configure() throws Exception { from("kura-wifi:wlan0/mySSID"). to("controlbus:route?routeId=onlineSync&action=start");
from("file:///var/sensor/temperature"). routeId("onlineSync").autoStartup(false). to("netty4-http://api.mydatacenter.com"); } }
@hekonsek
Soon to be converted to Maven archetype :) .
Rhiot Kura quickstarts@hekonsek
git clone [email protected]:rhiot/quickstarts.git
cp -r quickstarts/kura-camel kura-camel
cd kura-camel
mvn install
CloudService user doesn’t know that payload is dispatched to Camel.
Rhiot CamelCloudService@hekonsek
CloudService cloudService = new DefaultCamelCloudService();CloudClient client = cloudService.newCloudClient("appId");
// Publish message to internal in-memory Camel queuecloudClient.publish("topic", "foo".getBytes(), 0, true, 0);
// Read message from Camel routefrom("kura-cloud:appId/topic"). to("netty4-http:http://example.com");
Use CloudService to publish message to any endpoint supported by Camel.
Rhiot CamelCloudService@hekonsek
CloudService cloudService = new DefaultCamelCloudService();CloudClient client = cloudService.newCloudClient("appId");
cloudClient.publish("amqp:topic", "foo".getBytes(), 0, true, 0);
Top Related