Eclipse Democamps 2013 - M2M for Java Developers with MQTT

1,951 views
1,775 views

Published on

I gave this talk at Eclipse Democamp Munich and Stuttgart. This presentation explains the benefits of MQTT, why HTTP isn't enough for the Internet of Things and Machine-to-Machine communication. Last but not least it shows how to use the Eclipse Paho Java library for efficient

Published in: Technology, Education
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,951
On SlideShare
0
From Embeds
0
Number of Embeds
14
Actions
Shares
0
Downloads
70
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

Eclipse Democamps 2013 - M2M for Java Developers with MQTT

  1. 1. M2M for Java Developers MQTT with Eclipse Paho
  2. 2. Dominik Obermaier @dobermai excited about M2M passionate Architect & Maker helps standardizing MQTT at OASIS loves OSS Co-Founder and CTO at dc-square HiveMQ architect
  3. 3. M2M?
  4. 4. TECHNOLOGY THA T SUPPORTS WIRED OR WIRELESS COMMUNICA TION BETWEEN DEVICES
  5. 5. Why should we care?
  6. 6. “Things” in the Internet 2010 2015 2020 ~6.909.000.000 ~7.302.000.000 ~7.675.000.000 [1] [2] ~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 [2]Source: http://share.cisco.com/internet-of-things.html
  7. 7. “Things” in the Internet People Things 50,000,000,000 37,500,000,000 25,000,000,000 12,500,000,000 0 2010 2015 2020
  8. 8. “Things” in the Internet People Things 50,000,000,000 37,500,000,000 25,000,000,000 1.8x 12,500,000,000 0 2010 2015 2020
  9. 9. “Things” in the Internet People Things 50,000,000,000 37,500,000,000 25,000,000,000 1.8x 3.4x 12,500,000,000 0 2010 2015 2020
  10. 10. “Things” in the Internet People Things 50,000,000,000 6.5x 37,500,000,000 25,000,000,000 1.8x 3.4x 12,500,000,000 0 2010 2015 2020
  11. 11. Which protocol ?
  12. 12. HTTP? Request / Response Verbose Polling instead of Push No quality of service How to get notified if clients die? Stateless
  13. 13. Why MQTT? ✓ Simple ✓ Efficient ✓ Publish / Subscribe ✓ Quality of Service Levels ✓ Last Will and Testament ✓ Designed for unreliable networks
  14. 14. Why MQTT? ✓ Simple ✓ Efficient ✓ Publish / Subscribe ✓ Quality of Service Levels ✓ Last Will and Testament ✓ Designed for unreliable networks K Wireless? Yep, then it probably is unreliable
  15. 15. Google Trends
  16. 16. History MQTT invented by IBM and Arcom (Eurotech) 1999 royalty free OASIS TC formed 2010 2013 MQTT becomes Standard 2014
  17. 17. Publish / Subscribe
  18. 18. MQTT Topics
  19. 19. MQTT Topics MQTT/is/awesome MQTT/is/fantastic Bacon/is/awesome MQTT/looks/fantastic MQTT/looks/fantastic
  20. 20. MQTT Topics MQTT/is/awesome MQTT Bacon looks is fantastic awesome
  21. 21. MQTT Topics MQTT/is/awesome MQTT Bacon looks is fantastic awesome
  22. 22. MQTT Topics MQTT/is/awesome MQTT Bacon looks is fantastic awesome
  23. 23. MQTT Topics MQTT/is/awesome MQTT Bacon looks is fantastic awesome
  24. 24. MQTT Topics MQTT/is/awesome MQTT Bacon looks is fantastic awesome
  25. 25. MQTT Topics MQTT/is/awesome MQTT Bacon looks is fantastic awesome
  26. 26. MQTT Topics Bacon/is/awesome MQTT Bacon looks is fantastic awesome
  27. 27. MQTT Topics Bacon/is/awesome MQTT Bacon looks is fantastic awesome
  28. 28. MQTT Topics Bacon/is/awesome MQTT Bacon looks is fantastic awesome
  29. 29. MQTT Topics Bacon/is/awesome MQTT Bacon looks is fantastic awesome
  30. 30. MQTT Topics Bacon/is/awesome MQTT Bacon looks is fantastic awesome
  31. 31. MQTT Topics Bacon/is/awesome MQTT Bacon looks is fantastic awesome
  32. 32. MQTT Topic Level Wilcard +/is/awesome MQTT Bacon looks is fantastic awesome
  33. 33. MQTT Topic Level Wilcard +/is/awesome MQTT Bacon looks is fantastic awesome
  34. 34. MQTT Topic Level Wilcard +/is/awesome MQTT Bacon looks is fantastic awesome
  35. 35. MQTT Topic Level Wilcard +/is/awesome MQTT Bacon looks is fantastic awesome
  36. 36. MQTT Topic Level Wilcard +/is/awesome MQTT Bacon looks is fantastic awesome
  37. 37. MQTT Topic Level Wilcard +/is/awesome MQTT Bacon looks is fantastic awesome
  38. 38. MQTT Topic Level Wilcard +/is/awesome MQTT Bacon looks is fantastic awesome
  39. 39. MQTT Topic Level Wilcard +/is/+ MQTT Bacon looks is fantastic awesome
  40. 40. MQTT Topic Level Wilcard +/is/+ MQTT Bacon looks is fantastic awesome
  41. 41. MQTT Topic Level Wilcard +/is/+ MQTT Bacon looks is fantastic awesome
  42. 42. MQTT Topic Level Wilcard +/is/+ MQTT Bacon looks is fantastic awesome
  43. 43. MQTT Topic Level Wilcard +/is/+ MQTT Bacon looks is fantastic awesome
  44. 44. MQTT Topic Level Wilcard +/is/+ MQTT Bacon looks is fantastic awesome
  45. 45. MQTT Topic Level Wilcard +/is/+ MQTT Bacon looks is fantastic awesome
  46. 46. MQTT Topic Level Wilcard +/is/+ MQTT Bacon looks is fantastic awesome
  47. 47. MQTT Wildcard MQTT/# MQTT Bacon looks is fantastic awesome
  48. 48. MQTT Wildcard MQTT/# MQTT Bacon looks is fantastic awesome
  49. 49. MQTT Wildcard MQTT/# MQTT Bacon looks is fantastic awesome
  50. 50. MQTT Wildcard MQTT/# MQTT Bacon looks is fantastic awesome
  51. 51. MQTT Wildcard MQTT/# MQTT Bacon looks is fantastic awesome
  52. 52. MQTT Wildcard MQTT/# MQTT Bacon looks is fantastic awesome
  53. 53. MQTT Wildcard MQTT/# MQTT Bacon looks is fantastic awesome
  54. 54. MQTT Wildcard MQTT/# MQTT Bacon looks is fantastic awesome
  55. 55. MQTT Wildcard MQTT/# MQTT Bacon looks is fantastic awesome
  56. 56. MQTT Wildcard # MQTT Bacon looks is fantastic awesome
  57. 57. MQTT Wildcard # MQTT Bacon looks is fantastic awesome
  58. 58. MQTT Wildcard # MQTT Bacon looks is fantastic awesome
  59. 59. MQTT Wildcard # MQTT Bacon looks is fantastic awesome
  60. 60. MQTT Wildcard # MQTT Bacon looks is fantastic awesome
  61. 61. MQTT Wildcard # MQTT Bacon looks is fantastic awesome
  62. 62. MQTT Wildcard # MQTT Bacon looks is fantastic awesome
  63. 63. MQTT Wildcard # MQTT Bacon looks is fantastic awesome
  64. 64. MQTT Wildcard # MQTT Bacon looks is fantastic awesome
  65. 65. MQTT Wildcard # MQTT Bacon looks is fantastic awesome
  66. 66. Broker Implementations
  67. 67. Broker Implementations
  68. 68. Broker Implementations
  69. 69. Broker Implementations
  70. 70. Broker Implementations
  71. 71. Broker Implementations
  72. 72. Broker Implementations + others
  73. 73. Broker Implementations + others Extensive list of brokers available at http://mqtt.org/wiki/doku.php/brokers
  74. 74. OK, got it. How to start hacking?
  75. 75. What is Paho? ✓ Scalable Open Source Implementations of M2M standard protocols ✓ Focus on MQTT ✓ Implementations in Java, Javascript, Lua, C, C++ and Python ✓ Eclipse Incubator
  76. 76. What is Paho? K Read: What is Paho at the moment ✓ Scalable Open Source Implementations of M2M standard protocols ✓ Focus on MQTT ✓ Implementations in Java, Javascript, Lua, C, C++ and Python ✓ Eclipse Incubator
  77. 77. Java!
  78. 78. Paho - Java contribution of IBM announced at EclipseCon Europe 11/2011 first version in GIT 03/2012 Release v0.1 11/2012 Release v0.2 04/2013 Release v0.4.0 08/2013
  79. 79. Code! public void start() throws Exception { final String clientId = "democamp_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); }
  80. 80. 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"))); }
  81. 81. DEMO!
  82. 82. Other Eclipse M2M Projects
  83. 83. Other Eclipse M2M Projects + others
  84. 84. THANK YOU!
  85. 85. Credits ✓ Pictures licensed from different people from 500px.com and depositphotos.com ✓ MQTT Logo by http://www.mqtt.org ✓ Paho Logo from http://wiki.eclipse.org/Paho/Branding

×