M2M for Java Developers - MQTT with Eclipse Paho
-
Upload
dominik-obermaier -
Category
Technology
-
view
2.985 -
download
4
description
Transcript of M2M for Java Developers - MQTT with Eclipse Paho
![Page 1: M2M for Java Developers - MQTT with Eclipse Paho](https://reader033.fdocuments.in/reader033/viewer/2022052821/554a36f5b4c905293a8b463d/html5/thumbnails/1.jpg)
M2M for Java DevelopersMQTT with Eclipse Paho
17-07-2013 -- #democampstuttgartDominik Obermaier -- dc-square GmbH
![Page 2: M2M for Java Developers - MQTT with Eclipse Paho](https://reader033.fdocuments.in/reader033/viewer/2022052821/554a36f5b4c905293a8b463d/html5/thumbnails/2.jpg)
Dominik Obermaier@dobermai
MQTT Enthusiastloves OSS
passionateArchitect & Maker Co-Founder dc-square
likes Open Source Hardware
![Page 3: M2M for Java Developers - MQTT with Eclipse Paho](https://reader033.fdocuments.in/reader033/viewer/2022052821/554a36f5b4c905293a8b463d/html5/thumbnails/3.jpg)
Dominik Obermaier@dobermai
MQTT Enthusiastloves OSS
passionateArchitect & Maker Co-Founder dc-square
likes Open Source HardwareK Who not?!?
![Page 4: M2M for Java Developers - MQTT with Eclipse Paho](https://reader033.fdocuments.in/reader033/viewer/2022052821/554a36f5b4c905293a8b463d/html5/thumbnails/4.jpg)
M2M?
![Page 5: M2M for Java Developers - MQTT with Eclipse Paho](https://reader033.fdocuments.in/reader033/viewer/2022052821/554a36f5b4c905293a8b463d/html5/thumbnails/5.jpg)
TECHNOLOGY THAT SUPPORTS WIRED
OR WIRELESS COMMUNICATION
BETWEEN DEVICES
![Page 6: M2M for Java Developers - MQTT with Eclipse Paho](https://reader033.fdocuments.in/reader033/viewer/2022052821/554a36f5b4c905293a8b463d/html5/thumbnails/6.jpg)
Why should
we care?
![Page 7: M2M for Java Developers - MQTT with Eclipse Paho](https://reader033.fdocuments.in/reader033/viewer/2022052821/554a36f5b4c905293a8b463d/html5/thumbnails/7.jpg)
2010 2015 2020
~6.909.000.000 ~7.302.000.000 ~7.675.000.000
~12.500.000.000 ~25.000.000.000 ~50.000.000.000
[1]Source: http://www.un.org/esa/population/publications/wpp2008/wpp2008_highlights.pdf
[1]
[2]Source: http://share.cisco.com/internet-of-things.html
[2]
“Things” in the Internet
![Page 8: M2M for Java Developers - MQTT with Eclipse Paho](https://reader033.fdocuments.in/reader033/viewer/2022052821/554a36f5b4c905293a8b463d/html5/thumbnails/8.jpg)
Things?
![Page 9: M2M for Java Developers - MQTT with Eclipse Paho](https://reader033.fdocuments.in/reader033/viewer/2022052821/554a36f5b4c905293a8b463d/html5/thumbnails/9.jpg)
![Page 10: M2M for Java Developers - MQTT with Eclipse Paho](https://reader033.fdocuments.in/reader033/viewer/2022052821/554a36f5b4c905293a8b463d/html5/thumbnails/10.jpg)
![Page 11: M2M for Java Developers - MQTT with Eclipse Paho](https://reader033.fdocuments.in/reader033/viewer/2022052821/554a36f5b4c905293a8b463d/html5/thumbnails/11.jpg)
![Page 12: M2M for Java Developers - MQTT with Eclipse Paho](https://reader033.fdocuments.in/reader033/viewer/2022052821/554a36f5b4c905293a8b463d/html5/thumbnails/12.jpg)
![Page 13: M2M for Java Developers - MQTT with Eclipse Paho](https://reader033.fdocuments.in/reader033/viewer/2022052821/554a36f5b4c905293a8b463d/html5/thumbnails/13.jpg)
![Page 14: M2M for Java Developers - MQTT with Eclipse Paho](https://reader033.fdocuments.in/reader033/viewer/2022052821/554a36f5b4c905293a8b463d/html5/thumbnails/14.jpg)
![Page 15: M2M for Java Developers - MQTT with Eclipse Paho](https://reader033.fdocuments.in/reader033/viewer/2022052821/554a36f5b4c905293a8b463d/html5/thumbnails/15.jpg)
![Page 16: M2M for Java Developers - MQTT with Eclipse Paho](https://reader033.fdocuments.in/reader033/viewer/2022052821/554a36f5b4c905293a8b463d/html5/thumbnails/16.jpg)
![Page 17: M2M for Java Developers - MQTT with Eclipse Paho](https://reader033.fdocuments.in/reader033/viewer/2022052821/554a36f5b4c905293a8b463d/html5/thumbnails/17.jpg)
Which protocol
?
![Page 18: M2M for Java Developers - MQTT with Eclipse Paho](https://reader033.fdocuments.in/reader033/viewer/2022052821/554a36f5b4c905293a8b463d/html5/thumbnails/18.jpg)
![Page 19: M2M for Java Developers - MQTT with Eclipse Paho](https://reader033.fdocuments.in/reader033/viewer/2022052821/554a36f5b4c905293a8b463d/html5/thumbnails/19.jpg)
Why MQTT?✓ Simple
✓ Efficient
✓ Publish / Subscribe
✓ Quality of Service Levels
✓ Last Will and Testament
✓ Designed for unreliable networks
![Page 20: M2M for Java Developers - MQTT with Eclipse Paho](https://reader033.fdocuments.in/reader033/viewer/2022052821/554a36f5b4c905293a8b463d/html5/thumbnails/20.jpg)
Why MQTT?✓ Simple
✓ Efficient
✓ Publish / Subscribe
✓ Quality of Service Levels
✓ Last Will and Testament
✓ Designed for unreliable networksK Wireless? Yep, then it probably is unreliable
![Page 21: M2M for Java Developers - MQTT with Eclipse Paho](https://reader033.fdocuments.in/reader033/viewer/2022052821/554a36f5b4c905293a8b463d/html5/thumbnails/21.jpg)
Publish / Subscribe
![Page 22: M2M for Java Developers - MQTT with Eclipse Paho](https://reader033.fdocuments.in/reader033/viewer/2022052821/554a36f5b4c905293a8b463d/html5/thumbnails/22.jpg)
OMG! Sounds like programming in C!
![Page 23: M2M for Java Developers - MQTT with Eclipse Paho](https://reader033.fdocuments.in/reader033/viewer/2022052821/554a36f5b4c905293a8b463d/html5/thumbnails/23.jpg)
![Page 24: M2M for Java Developers - MQTT with Eclipse Paho](https://reader033.fdocuments.in/reader033/viewer/2022052821/554a36f5b4c905293a8b463d/html5/thumbnails/24.jpg)
What about Java?
![Page 25: M2M for Java Developers - MQTT with Eclipse Paho](https://reader033.fdocuments.in/reader033/viewer/2022052821/554a36f5b4c905293a8b463d/html5/thumbnails/25.jpg)
![Page 26: M2M for Java Developers - MQTT with Eclipse Paho](https://reader033.fdocuments.in/reader033/viewer/2022052821/554a36f5b4c905293a8b463d/html5/thumbnails/26.jpg)
What is Paho?
✓ Scalable Open Source Implementations of M2M standard protocols
✓ Focus on MQTT
✓ Implementations in Java, Javascript, Lua and C
✓ Eclipse Incubator
![Page 27: M2M for Java Developers - MQTT with Eclipse Paho](https://reader033.fdocuments.in/reader033/viewer/2022052821/554a36f5b4c905293a8b463d/html5/thumbnails/27.jpg)
What is Paho?
✓ Scalable Open Source Implementations of M2M standard protocols
✓ Focus on MQTT
✓ Implementations in Java, Javascript, Lua and C
✓ Eclipse Incubator
KRead: What is Paho at the moment
![Page 28: M2M for Java Developers - MQTT with Eclipse Paho](https://reader033.fdocuments.in/reader033/viewer/2022052821/554a36f5b4c905293a8b463d/html5/thumbnails/28.jpg)
Code! public void start() throws Exception { final String clientId = "eclipse_stuttgart_sub";
final MqttClient mqttClient = new MqttClient(BROKER_URL, clientId, new MemoryPersistence());
mqttClient.setCallback(new SubscribeCallback(mqttClient));
mqttClient.connect();
mqttClient.subscribe(TOPIC_SUBSCRIPTION, QUALITY_OF_SERVICE_LEVEL);
}
![Page 29: M2M for Java Developers - MQTT with Eclipse Paho](https://reader033.fdocuments.in/reader033/viewer/2022052821/554a36f5b4c905293a8b463d/html5/thumbnails/29.jpg)
Moar Code!public class SubscribeCallback implements MqttCallback {
@Override public void connectionLost(Throwable cause) {}
@Override public void deliveryComplete(MqttDeliveryToken token) {}
@Override public void messageArrived(MqttTopic topic,
MqttMessage message)throws Exception {
System.out.println("Message arrived. Topic: "
topic.getName() + ", QoS: " + message.getQos() + ", message: " + new String(message.getPayload(), Charset.forName("UTF-8")));
}}
![Page 30: M2M for Java Developers - MQTT with Eclipse Paho](https://reader033.fdocuments.in/reader033/viewer/2022052821/554a36f5b4c905293a8b463d/html5/thumbnails/30.jpg)
DEMO!
![Page 31: M2M for Java Developers - MQTT with Eclipse Paho](https://reader033.fdocuments.in/reader033/viewer/2022052821/554a36f5b4c905293a8b463d/html5/thumbnails/31.jpg)
Other Eclipse M2M Projects
![Page 32: M2M for Java Developers - MQTT with Eclipse Paho](https://reader033.fdocuments.in/reader033/viewer/2022052821/554a36f5b4c905293a8b463d/html5/thumbnails/32.jpg)
Credits✓ Scared Cat Picture by http://www.flickr.com/photos/dat-pics/
✓ Thanks Vincent Le Moign for the awesome Icon Set
✓ Rest of pictures licensed from different people from 500px.com
✓ MQTT Logo by http://www.mqtt.org