Brought to you by Henryk
Konsek
IoT gateway Dream Team
Eclipse Kura and Apache Camel
Henryk Konsek
@hekonsek
- engineer at Red Hat
- open source
contributor
- focused on the IoT
- Rhiot project founder
Running Apache Camel in the Eclipse Kura OSGi container.
This talk
● Crash course to the IoT
● Eclipse Kura
● Apache Camel
● Why Camel+Kura?
● How Camel+Kura?
● Demo
This talk
Crash course to the IoT
Hardware. Connected. And sensors.
The Internet Of Things
In drones?
Where is the IoT money?
In hipster startups?
Where is the IoT money?
In the Raspberry Pi?
Where is the IoT money?
Industry.
IoT money
Automotive.
IoT money
Assets management.
IoT money
Smart cities.
IoT money
Military & intelligence.
IoT money
IoT = Data Center + Embedded
IoT consolidates data center and embedded worlds.
The datacenter systems are located in a data center.
Datacenter systems in a nutshell
IoT architecture is a superset of a datacenter architecture.
IoT architecture
Synchronous communication, usually via HTTP.
Communication in the datacenter systems
The “IoT fun” part!
Communication in the IoT systems
Eclipse Kura
OSGi-based IoT gateway for field devices.
What is Eclipse Kura?
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)
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)
Networking Gateway Services Web UI Remote Management
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
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
What is Eclipse Kura?
OSGi-based IoT gateway for the field devices.
Gateway TL;DR;
A proxy between field devices and a data center
GATEWAY
Eclipse. Donated by Eurotech (http://eurotech.com).
Who’s behind Kura?
Apache Camel
The message routing framework.
What is Apache Camel?
How to orchestrate messages flow.
What is message routing?
● Apache Camel
● Spring Integration
● Mule
- 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')
]
Why Camel and Kura?
Camel provides ~200 OSGi-ready connectors (JMS, REST, CoAP, AMQP,
MQTT…)
How can Kura benefit from Camel?
Enterprise Integration Patterns (EIP)
How can Kura benefit from Camel?
Prevents messages overflow.
EIP - throttler
Provides SLA for the different channels.
EIP - throttler
Dynamically decide where to route the message.
EIP - content based router
Client side load balancing. Useful for field devices connectivity.
EIP - load balancer
How can gateway provide transaction-like behavior
when connecting to a 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
How Camel and Kura?
Camel OSGi bundle is started from the Kura.
Kura + Camel: architecture
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");
}
}
Just deploy the route as the OSGi bundle and enjoy Camel running the Kura.
Concerned about the lifecycle?
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");
}
}
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");
}
}
http://rhiot.io
Rhiot Kura gateway
- Rhiot Kura+Camel router (EuroTech partnership)
- server-side components
- on-going R&D and productization efforts
Rhiot & Red Hat?
Thank you!
Henryk Konsek
@hekonsek
hekonsek@gmail.com

Iot gateway dream team - Eclipse Kura and Apache Camel

  • 1.
    Brought to youby Henryk Konsek IoT gateway Dream Team Eclipse Kura and Apache Camel
  • 2.
    Henryk Konsek @hekonsek - engineerat Red Hat - open source contributor - focused on the IoT - Rhiot project founder
  • 3.
    Running Apache Camelin the Eclipse Kura OSGi container. This talk
  • 4.
    ● Crash courseto the IoT ● Eclipse Kura ● Apache Camel ● Why Camel+Kura? ● How Camel+Kura? ● Demo This talk
  • 5.
  • 6.
    Hardware. Connected. Andsensors. The Internet Of Things
  • 7.
    In drones? Where isthe IoT money?
  • 8.
    In hipster startups? Whereis the IoT money?
  • 9.
    In the RaspberryPi? Where is the IoT money?
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
    IoT = DataCenter + Embedded IoT consolidates data center and embedded worlds.
  • 16.
    The datacenter systemsare located in a data center. Datacenter systems in a nutshell
  • 17.
    IoT architecture isa superset of a datacenter architecture. IoT architecture
  • 18.
    Synchronous communication, usuallyvia HTTP. Communication in the datacenter systems
  • 19.
    The “IoT fun”part! Communication in the IoT systems
  • 20.
  • 21.
    OSGi-based IoT gatewayfor field devices. What is Eclipse Kura?
  • 22.
    OSGi-based IoT gatewayfor 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)
  • 23.
    What is EclipseKura? 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) Networking Gateway Services Web UI Remote Management
  • 24.
    What is EclipseKura? 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
  • 25.
    What is EclipseKura? 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
  • 26.
    What is EclipseKura? OSGi-based IoT gateway for the field devices.
  • 27.
    Gateway TL;DR; A proxybetween field devices and a data center GATEWAY
  • 28.
    Eclipse. Donated byEurotech (http://eurotech.com). Who’s behind Kura?
  • 29.
  • 30.
    The message routingframework. What is Apache Camel?
  • 31.
    How to orchestratemessages flow. What is message routing? ● Apache Camel ● Spring Integration ● Mule
  • 32.
    - read messagefrom 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') ]
  • 33.
  • 34.
    Camel provides ~200OSGi-ready connectors (JMS, REST, CoAP, AMQP, MQTT…) How can Kura benefit from Camel?
  • 35.
    Enterprise Integration Patterns(EIP) How can Kura benefit from Camel?
  • 36.
  • 37.
    Provides SLA forthe different channels. EIP - throttler
  • 38.
    Dynamically decide whereto route the message. EIP - content based router
  • 39.
    Client side loadbalancing. Useful for field devices connectivity. EIP - load balancer
  • 40.
    How can gatewayprovide transaction-like behavior when connecting to a non-transactional service? EIP - idempotent consumer
  • 41.
    How can Icontrol which parts of the field device should be running at the given moment? EIP - control bus
  • 42.
  • 43.
    Camel OSGi bundleis started from the Kura. Kura + Camel: architecture
  • 44.
    Invoke REST methodevery 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"); } }
  • 45.
    Just deploy theroute as the OSGi bundle and enjoy Camel running the Kura. Concerned about the lifecycle?
  • 46.
    Display WiFi networksaccessible 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"); } }
  • 47.
    Start syncing cacheddata 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"); } }
  • 48.
  • 49.
    - Rhiot Kura+Camelrouter (EuroTech partnership) - server-side components - on-going R&D and productization efforts Rhiot & Red Hat?
  • 50.