M2M for Java Developers MQTT with Eclipse Paho Dominik Obermaier - - PowerPoint PPT Presentation

m2m for java developers
SMART_READER_LITE
LIVE PREVIEW

M2M for Java Developers MQTT with Eclipse Paho Dominik Obermaier - - PowerPoint PPT Presentation

M2M for Java Developers MQTT with Eclipse Paho Dominik Obermaier @dobermai passionate CTO @ dc-square Architect and Maker Member of the OASIS Regular speaker and MQTT TC author HiveMQ Architect M2M? TECHNOLOGY THA T SUPPORTS WIRED


slide-1
SLIDE 1

M2M for Java Developers

MQTT with Eclipse Paho

slide-2
SLIDE 2

Dominik Obermaier

@dobermai CTO @ dc-square passionate Architect and Maker Member of the OASIS MQTT TC Regular speaker and author HiveMQ Architect

slide-3
SLIDE 3

M2M?

slide-4
SLIDE 4

TECHNOLOGY THA T SUPPORTS WIRED OR WIRELESS COMMUNICA TION BETWEEN DEVICES

slide-5
SLIDE 5

IoT?

slide-6
SLIDE 6

Things?

slide-7
SLIDE 7
slide-8
SLIDE 8
slide-9
SLIDE 9
slide-10
SLIDE 10
slide-11
SLIDE 11
slide-12
SLIDE 12
slide-13
SLIDE 13
slide-14
SLIDE 14
slide-15
SLIDE 15

Why should we care?

slide-16
SLIDE 16

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

slide-17
SLIDE 17 12,500,000,000 25,000,000,000 37,500,000,000 50,000,000,000 2010 2015 2020

People Things

“Things” in the Internet

1.8x 3.4x 6.5x

slide-18
SLIDE 18

Another revolution?

slide-19
SLIDE 19 Screenshot Taken from Oracle JavaOne Strategic Keynote 2013
slide-20
SLIDE 20

Protocols?

slide-21
SLIDE 21

Requirements for a IoT protocol

✓ efficient in bandwidth ✓ scalable ✓ standardized ✓ open ✓ data agnostic ✓ must be suited for constrained devices AND

server infrastructure

slide-22
SLIDE 22

HTTP?

Request / Response Verbose Polling instead of Push No quality of service How to get notified if clients die? Stateless

slide-23
SLIDE 23
slide-24
SLIDE 24

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

slide-25
SLIDE 25

MQTT vs HTTPs

✓ 93x faster (throughput) ✓ 11x less battery when publishing ✓ 170x less battery when receiving messages ✓ 8x less network overhead

http://stephendnicholas.com/archives/1217
slide-26
SLIDE 26

Oil pipeline

http://www.eurotech.com/en/press+room/news/?506
slide-27
SLIDE 27

Sprint Velocity

https://www.facebook.com/notes/facebook-engineering/building-facebook-messenger/10150259350998920
slide-28
SLIDE 28

Logistics

slide-29
SLIDE 29

Facebook Messenger

https://www.facebook.com/notes/facebook-engineering/building-facebook-messenger/10150259350998920
slide-30
SLIDE 30

Sports

slide-31
SLIDE 31

Google Trends

slide-32
SLIDE 32

1999 2010 2013 2014

MQTT invented by IBM and Arcom (Eurotech) royalty free OASIS TC formed MQTT is OASIS standard

History

slide-33
SLIDE 33

Publish / Subscribe

slide-34
SLIDE 34

Publish / Subscribe

slide-35
SLIDE 35

MQTT Topics

slide-36
SLIDE 36

MQTT Topics

MQTT/is/awesome MQTT/is/fantastic Bacon/is/awesome MQTT/looks/fantastic MQTT/looks/fantastic

slide-37
SLIDE 37

MQTT Topics

MQTT Bacon is awesome looks fantastic

MQTT/is/awesome

slide-38
SLIDE 38

MQTT Topics

MQTT Bacon is awesome looks fantastic

Bacon/is/awesome

slide-39
SLIDE 39

MQTT Topic Level Wildcard

MQTT Bacon is awesome looks fantastic

+/is/awesome

slide-40
SLIDE 40

MQTT Topic Level Wildcard

MQTT Bacon is awesome looks fantastic

+/is/+

slide-41
SLIDE 41

MQTT Wildcard

MQTT Bacon is awesome looks fantastic

MQTT/#

slide-42
SLIDE 42

MQTT Wildcard

MQTT Bacon is awesome looks fantastic

#

slide-43
SLIDE 43

Quality of Service Levels

slide-44
SLIDE 44

Last Will and Testament

MQTT Broker

Connect with LWT topic “clientA/lwt”

slide-45
SLIDE 45

Last Will and Testament

MQTT Broker

Subscribe to topic “clientA/lwt”

slide-46
SLIDE 46

Last Will and Testament

MQTT Broker

slide-47
SLIDE 47

Last Will and Testament

MQTT Broker

Broker detects ‘death’ of ClientA

slide-48
SLIDE 48

Last Will and Testament

MQTT Broker

Broker publishes LWT of ClientA

slide-49
SLIDE 49

Broker Implementations

+ others

Extensive list of brokers available at http://mqtt.org/wiki/doku.php/brokers
slide-50
SLIDE 50 QoS QoS 1 QoS 2 Auth Bridge $SYS SSL dynamic topics cluster websockets plugins HiveMQ ✔ ✔ ✔ ✔

✔ ✔ ✔ ✔ ✔ ✔ ✔

mosquitto ✔ ✔ ✔ ✔

✔ ✔ ✔ ✔ X X ✔

RSMB

✔ ✔ ✔ ✔ ✔ ✔ X ✔ X X X

RabbitMQ ✔ ✔ X ✔

X X ✔ ✔ ? ? ?

ActiveMQ ✔ ✔ ✔

? X X ? ? ? ✔ ?

Broker Implementations

slide-51
SLIDE 51

MQTT over Websockets

slide-52
SLIDE 52

Why MQTT over websockets?

✓ Every Browser is a ‘device’ ✓ Device-to-Browser Push ✓ Broadcasting to all online users ✓ Detect if a user is offline ✓ Direct Browser-to-device push ✓ Minimum payload ✓ No application-specific protocol

slide-53
SLIDE 53

MQTT Libraries

  • Paho (Java, Javascript, Python, C, C++,

ObjectiveC, Lua, Go)

  • .Net
  • Ruby
  • Erlang
  • Node.js
  • and many more
slide-54
SLIDE 54

OK, got it. How to start hacking?

slide-55
SLIDE 55

Java!

slide-56
SLIDE 56
slide-57
SLIDE 57

What is Paho?

✓ Scalable Open Source Implementations of M2M

standard protocols

✓ Focus on MQTT ✓ Implementations in Java, Javascript, Lua,

C, C++, Go and Python

✓ Eclipse Incubator

slide-58
SLIDE 58

11/2011 03/2012 04/2013 11/2012 08/2013

contribution of IBM announced at EclipseCon Europe first version in GIT Release v0.1 Release v0.2 Release v0.4.0

Paho - Java

slide-59
SLIDE 59

Eclipse Paho

✓ “Reference Implementation” ✓ Active Community ✓ Blocking and Async API

  • Not in Maven Central :-(
slide-60
SLIDE 60

DEMO!

slide-61
SLIDE 61
slide-62
SLIDE 62

Fusesource MQTT Client

✓ 3 API Styles ✓ Very easy to intercept ✓ Based on HawtIO ✓ Very performant ✓ In Maven Central

slide-63
SLIDE 63

DEMO!

slide-64
SLIDE 64

https://github.com/dobermai/bedcon-mqtt-clients

slide-65
SLIDE 65

THANK YOU!

slide-66
SLIDE 66

Bridging

slide-67
SLIDE 67

Clustering