Iot gateway dream team - Eclipse Kura and Apache Camel
-
Upload
henryk-konsek -
Category
Technology
-
view
1.192 -
download
1
Transcript of Iot gateway dream team - Eclipse Kura and Apache Camel
![Page 1: Iot gateway dream team - Eclipse Kura and Apache Camel](https://reader031.fdocuments.us/reader031/viewer/2022013123/586fc7151a28aba24c8b5f5b/html5/thumbnails/1.jpg)
Brought to you by Henryk Konsek
IoT gateway Dream TeamEclipse Kura and Apache Camel
![Page 2: Iot gateway dream team - Eclipse Kura and Apache Camel](https://reader031.fdocuments.us/reader031/viewer/2022013123/586fc7151a28aba24c8b5f5b/html5/thumbnails/2.jpg)
Henryk Konsek@hekonsek
- engineer at Red Hat- open source
contributor- focused on the IoT- Rhiot project founder
![Page 3: Iot gateway dream team - Eclipse Kura and Apache Camel](https://reader031.fdocuments.us/reader031/viewer/2022013123/586fc7151a28aba24c8b5f5b/html5/thumbnails/3.jpg)
Running Apache Camel in the Eclipse Kura OSGi container.
This talk
![Page 4: Iot gateway dream team - Eclipse Kura and Apache Camel](https://reader031.fdocuments.us/reader031/viewer/2022013123/586fc7151a28aba24c8b5f5b/html5/thumbnails/4.jpg)
● Crash course to the IoT● Eclipse Kura● Apache Camel● Why Camel+Kura?● How Camel+Kura?● Demo
This talk
![Page 5: Iot gateway dream team - Eclipse Kura and Apache Camel](https://reader031.fdocuments.us/reader031/viewer/2022013123/586fc7151a28aba24c8b5f5b/html5/thumbnails/5.jpg)
Crash course to the IoT
![Page 6: Iot gateway dream team - Eclipse Kura and Apache Camel](https://reader031.fdocuments.us/reader031/viewer/2022013123/586fc7151a28aba24c8b5f5b/html5/thumbnails/6.jpg)
Hardware. Connected. And sensors.
The Internet Of Things
![Page 7: Iot gateway dream team - Eclipse Kura and Apache Camel](https://reader031.fdocuments.us/reader031/viewer/2022013123/586fc7151a28aba24c8b5f5b/html5/thumbnails/7.jpg)
In drones?
Where is the IoT money?
![Page 8: Iot gateway dream team - Eclipse Kura and Apache Camel](https://reader031.fdocuments.us/reader031/viewer/2022013123/586fc7151a28aba24c8b5f5b/html5/thumbnails/8.jpg)
In hipster startups?
Where is the IoT money?
![Page 9: Iot gateway dream team - Eclipse Kura and Apache Camel](https://reader031.fdocuments.us/reader031/viewer/2022013123/586fc7151a28aba24c8b5f5b/html5/thumbnails/9.jpg)
In the Raspberry Pi?
Where is the IoT money?
![Page 10: Iot gateway dream team - Eclipse Kura and Apache Camel](https://reader031.fdocuments.us/reader031/viewer/2022013123/586fc7151a28aba24c8b5f5b/html5/thumbnails/10.jpg)
Industry.
IoT money
![Page 11: Iot gateway dream team - Eclipse Kura and Apache Camel](https://reader031.fdocuments.us/reader031/viewer/2022013123/586fc7151a28aba24c8b5f5b/html5/thumbnails/11.jpg)
Automotive.
IoT money
![Page 12: Iot gateway dream team - Eclipse Kura and Apache Camel](https://reader031.fdocuments.us/reader031/viewer/2022013123/586fc7151a28aba24c8b5f5b/html5/thumbnails/12.jpg)
Assets management.
IoT money
![Page 13: Iot gateway dream team - Eclipse Kura and Apache Camel](https://reader031.fdocuments.us/reader031/viewer/2022013123/586fc7151a28aba24c8b5f5b/html5/thumbnails/13.jpg)
Smart cities.
IoT money
![Page 14: Iot gateway dream team - Eclipse Kura and Apache Camel](https://reader031.fdocuments.us/reader031/viewer/2022013123/586fc7151a28aba24c8b5f5b/html5/thumbnails/14.jpg)
Military & intelligence.
IoT money
![Page 15: Iot gateway dream team - Eclipse Kura and Apache Camel](https://reader031.fdocuments.us/reader031/viewer/2022013123/586fc7151a28aba24c8b5f5b/html5/thumbnails/15.jpg)
IoT = Data Center + Embedded
IoT consolidates data center and embedded worlds.
![Page 16: Iot gateway dream team - Eclipse Kura and Apache Camel](https://reader031.fdocuments.us/reader031/viewer/2022013123/586fc7151a28aba24c8b5f5b/html5/thumbnails/16.jpg)
The datacenter systems are located in a data center.
Datacenter systems in a nutshell
![Page 17: Iot gateway dream team - Eclipse Kura and Apache Camel](https://reader031.fdocuments.us/reader031/viewer/2022013123/586fc7151a28aba24c8b5f5b/html5/thumbnails/17.jpg)
IoT architecture is a superset of a datacenter architecture.
IoT architecture
![Page 18: Iot gateway dream team - Eclipse Kura and Apache Camel](https://reader031.fdocuments.us/reader031/viewer/2022013123/586fc7151a28aba24c8b5f5b/html5/thumbnails/18.jpg)
Synchronous communication, usually via HTTP.
Communication in the datacenter systems
![Page 19: Iot gateway dream team - Eclipse Kura and Apache Camel](https://reader031.fdocuments.us/reader031/viewer/2022013123/586fc7151a28aba24c8b5f5b/html5/thumbnails/19.jpg)
The “IoT fun” part!
Communication in the IoT systems
![Page 20: Iot gateway dream team - Eclipse Kura and Apache Camel](https://reader031.fdocuments.us/reader031/viewer/2022013123/586fc7151a28aba24c8b5f5b/html5/thumbnails/20.jpg)
Eclipse Kura
![Page 21: Iot gateway dream team - Eclipse Kura and Apache Camel](https://reader031.fdocuments.us/reader031/viewer/2022013123/586fc7151a28aba24c8b5f5b/html5/thumbnails/21.jpg)
OSGi-based IoT gateway for field devices.
What is Eclipse Kura?
![Page 22: Iot gateway dream team - Eclipse Kura and Apache Camel](https://reader031.fdocuments.us/reader031/viewer/2022013123/586fc7151a28aba24c8b5f5b/html5/thumbnails/22.jpg)
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)
![Page 23: Iot gateway dream team - Eclipse Kura and Apache Camel](https://reader031.fdocuments.us/reader031/viewer/2022013123/586fc7151a28aba24c8b5f5b/html5/thumbnails/23.jpg)
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
![Page 24: Iot gateway dream team - Eclipse Kura and Apache Camel](https://reader031.fdocuments.us/reader031/viewer/2022013123/586fc7151a28aba24c8b5f5b/html5/thumbnails/24.jpg)
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
![Page 25: Iot gateway dream team - Eclipse Kura and Apache Camel](https://reader031.fdocuments.us/reader031/viewer/2022013123/586fc7151a28aba24c8b5f5b/html5/thumbnails/25.jpg)
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
![Page 26: Iot gateway dream team - Eclipse Kura and Apache Camel](https://reader031.fdocuments.us/reader031/viewer/2022013123/586fc7151a28aba24c8b5f5b/html5/thumbnails/26.jpg)
What is Eclipse Kura?
OSGi-based IoT gateway for the field devices.
![Page 27: Iot gateway dream team - Eclipse Kura and Apache Camel](https://reader031.fdocuments.us/reader031/viewer/2022013123/586fc7151a28aba24c8b5f5b/html5/thumbnails/27.jpg)
Gateway TL;DR;
A proxy between field devices and a data center
GATEWAY
![Page 28: Iot gateway dream team - Eclipse Kura and Apache Camel](https://reader031.fdocuments.us/reader031/viewer/2022013123/586fc7151a28aba24c8b5f5b/html5/thumbnails/28.jpg)
Eclipse. Donated by Eurotech (http://eurotech.com).
Who’s behind Kura?
![Page 29: Iot gateway dream team - Eclipse Kura and Apache Camel](https://reader031.fdocuments.us/reader031/viewer/2022013123/586fc7151a28aba24c8b5f5b/html5/thumbnails/29.jpg)
Apache Camel
![Page 30: Iot gateway dream team - Eclipse Kura and Apache Camel](https://reader031.fdocuments.us/reader031/viewer/2022013123/586fc7151a28aba24c8b5f5b/html5/thumbnails/30.jpg)
The message routing framework.
What is Apache Camel?
![Page 31: Iot gateway dream team - Eclipse Kura and Apache Camel](https://reader031.fdocuments.us/reader031/viewer/2022013123/586fc7151a28aba24c8b5f5b/html5/thumbnails/31.jpg)
How to orchestrate messages flow.
What is message routing?
● Apache Camel● Spring Integration● Mule
![Page 32: Iot gateway dream team - Eclipse Kura and Apache Camel](https://reader031.fdocuments.us/reader031/viewer/2022013123/586fc7151a28aba24c8b5f5b/html5/thumbnails/32.jpg)
- 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')]
![Page 33: Iot gateway dream team - Eclipse Kura and Apache Camel](https://reader031.fdocuments.us/reader031/viewer/2022013123/586fc7151a28aba24c8b5f5b/html5/thumbnails/33.jpg)
Why Camel and Kura?
![Page 34: Iot gateway dream team - Eclipse Kura and Apache Camel](https://reader031.fdocuments.us/reader031/viewer/2022013123/586fc7151a28aba24c8b5f5b/html5/thumbnails/34.jpg)
Camel provides ~200 OSGi-ready connectors (JMS, REST, CoAP, AMQP, MQTT…)
How can Kura benefit from Camel?
![Page 35: Iot gateway dream team - Eclipse Kura and Apache Camel](https://reader031.fdocuments.us/reader031/viewer/2022013123/586fc7151a28aba24c8b5f5b/html5/thumbnails/35.jpg)
Enterprise Integration Patterns (EIP)
How can Kura benefit from Camel?
![Page 36: Iot gateway dream team - Eclipse Kura and Apache Camel](https://reader031.fdocuments.us/reader031/viewer/2022013123/586fc7151a28aba24c8b5f5b/html5/thumbnails/36.jpg)
Prevents messages overflow.
EIP - throttler
![Page 37: Iot gateway dream team - Eclipse Kura and Apache Camel](https://reader031.fdocuments.us/reader031/viewer/2022013123/586fc7151a28aba24c8b5f5b/html5/thumbnails/37.jpg)
Provides SLA for the different channels.
EIP - throttler
![Page 38: Iot gateway dream team - Eclipse Kura and Apache Camel](https://reader031.fdocuments.us/reader031/viewer/2022013123/586fc7151a28aba24c8b5f5b/html5/thumbnails/38.jpg)
Dynamically decide where to route the message.
EIP - content based router
![Page 39: Iot gateway dream team - Eclipse Kura and Apache Camel](https://reader031.fdocuments.us/reader031/viewer/2022013123/586fc7151a28aba24c8b5f5b/html5/thumbnails/39.jpg)
Client side load balancing. Useful for field devices connectivity.
EIP - load balancer
![Page 40: Iot gateway dream team - Eclipse Kura and Apache Camel](https://reader031.fdocuments.us/reader031/viewer/2022013123/586fc7151a28aba24c8b5f5b/html5/thumbnails/40.jpg)
How can gateway provide transaction-like behavior when connecting to a non-transactional service?
EIP - idempotent consumer
![Page 41: Iot gateway dream team - Eclipse Kura and Apache Camel](https://reader031.fdocuments.us/reader031/viewer/2022013123/586fc7151a28aba24c8b5f5b/html5/thumbnails/41.jpg)
How can I control which parts of the field device should be running at the given moment?
EIP - control bus
![Page 42: Iot gateway dream team - Eclipse Kura and Apache Camel](https://reader031.fdocuments.us/reader031/viewer/2022013123/586fc7151a28aba24c8b5f5b/html5/thumbnails/42.jpg)
How Camel and Kura?
![Page 43: Iot gateway dream team - Eclipse Kura and Apache Camel](https://reader031.fdocuments.us/reader031/viewer/2022013123/586fc7151a28aba24c8b5f5b/html5/thumbnails/43.jpg)
Camel OSGi bundle is started from the Kura.
Kura + Camel: architecture
![Page 44: Iot gateway dream team - Eclipse Kura and Apache Camel](https://reader031.fdocuments.us/reader031/viewer/2022013123/586fc7151a28aba24c8b5f5b/html5/thumbnails/44.jpg)
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"); } }
![Page 45: Iot gateway dream team - Eclipse Kura and Apache Camel](https://reader031.fdocuments.us/reader031/viewer/2022013123/586fc7151a28aba24c8b5f5b/html5/thumbnails/45.jpg)
Just deploy the route as the OSGi bundle and enjoy Camel running the Kura.
Concerned about the lifecycle?
![Page 46: Iot gateway dream team - Eclipse Kura and Apache Camel](https://reader031.fdocuments.us/reader031/viewer/2022013123/586fc7151a28aba24c8b5f5b/html5/thumbnails/46.jpg)
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"); } }
![Page 47: Iot gateway dream team - Eclipse Kura and Apache Camel](https://reader031.fdocuments.us/reader031/viewer/2022013123/586fc7151a28aba24c8b5f5b/html5/thumbnails/47.jpg)
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"); } }
![Page 48: Iot gateway dream team - Eclipse Kura and Apache Camel](https://reader031.fdocuments.us/reader031/viewer/2022013123/586fc7151a28aba24c8b5f5b/html5/thumbnails/48.jpg)
http://rhiot.io
Rhiot Kura gateway
![Page 49: Iot gateway dream team - Eclipse Kura and Apache Camel](https://reader031.fdocuments.us/reader031/viewer/2022013123/586fc7151a28aba24c8b5f5b/html5/thumbnails/49.jpg)
- Rhiot Kura+Camel router (EuroTech partnership)- server-side components- on-going R&D and productization efforts
Rhiot & Red Hat?