Upload
henryk-konsek
View
1.438
Download
3
Embed Size (px)
Citation preview
OSGi-based IoT gateway for the field devices.
What is Eclipse Kura?
OSGi● modularity system for Java● provides modules classpath separation● promotes hot runtime redeployments
OSGi-based IoT gateway for the field devices.
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.
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.
What is Eclipse Kura?
IoT gateway● collects messages from the edge devices (like sensors)● performs messages
processing/aggregation/forwarding
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')]
Camel provides ~200 OSGi-ready connectors (JMS, REST, CoAP, AMQP, MQTT…)
How can Kura benefit from Camel?
How can gateway provide transaction-like behavior when connecting to the non-transactional service?
EIP - idempotent consumer
How can I control which parts of the field device should be running at the given moment?
EIP - control bus
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("netty-http:http://app.mydatacenter.com/api"); } }
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("netty-http:http://0.0.0.0:18080"). to("bean:org.eclipse.kura.net.NetworkService?method=getAllWifiAccessPoints"); } }
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"); } }
Thank you!
● Eclipse Kura - https://eclipse.org/kura● Apache Camel - http://camel.apache.org● Enterprise Integaration Patterns - http://www.
enterpriseintegrationpatterns.com● Camel Kura - http://camel.apache.org/kura● Camel IoT Labs Kura extensions - https://github.
com/camel-labs/camel-labs/tree/master/iot#camel-kura-wifi-component
● demo code - https://github.com/hekonsek/camel-kura-wifi-demo