Scale changes everything. What once was quite adequate for enterprise messaging can't scale to support "Internet of Things". We need new protocols, patterns and architectures to support this new world. This session will start with basic introduction to the concept of Internet of Things. Next it will discuss general technical challenges involved with the concept and explain why it is becoming mainstream now. Now we’re ready to start talking about solutions. We will introduce some messaging patterns (like telemetry and command/control) and protocols (such as MQTT and AMQP) used in these scenarios. Finally we will see how Apache ActiveMQ is gearing up for this race. We will show tips for horizontal and vertical scaling of the broker, related projects that can help with deployments and what the future development road map looks like.
Martyn Taylor is a senior software engineer at Red Hat, with over 7 years’ experience working on cloud, middleware and messaging software. Martyn currently works on the Apache ActiveMQ suite of projects.
2. Presenters
Martyn Taylor
Senior Software Engineer at Red Hat
Apache ActiveMQ Committer
Mainly working on Apache Artemis
Keen interest in IoT
Bosanac Dejan
Senior Software Engineer at Red Hat
Apache ActiveMQ committer and PMC member
Co-author of ActiveMQ in Action
6. IoT Messaging Infrastructure
Task
Provides connectivity between devices and back end systems
Challenges
Interoperability
Deployment environment
High Availability
Scalability
12. Requirements on the transport
Communication from/to devices
1 → 1
Device Addressing
1 → Many
Group Addressing
Push
Request → Response
18. MQTT
OASIS standard (v3.1.1)
Created by IBM
Light weight
Low network message
Simple protocol
Pub / Sub
Quality of Service
Connection failures
Very popular in IoT scenarios
24. AMQP 1.0
International Standard (ISO/IEC ISO 19464)
Binary Protocol
Rich feature set:
Conversation multiplexing
Advanced flow control
Type system
QoS Guarantees
Symmetrical message exchange
No Broker required
25. QoS Guarantees
At most once
Fire and Forget
At least once
Retry
Exactly once
3 Way Ack
26. Type System
Highly Interoperable
Rich Type Set
Primitives
integer, long
lists, maps
Descriptive types
Allow application defined types
Mappings in most languages
27. Symmetrical Protocol
Not Client -> Broker
Broker less message
Client -> Client
Client -> Router
Interesting features
Smart routing
28. Flow control & multi channels
Limit producer and consumer flow
Each channel (link) can be controlled individually
Limit telemetry flow for command messages
29. Protocols Overview
Lots of IoT protocol choices including several not discussed here
The right choice depends of the scenario
Scenarios may combine protocols
CoAP
Target usecase Long-haul (&
local)
Long-haul Local (& long-
haul)
Long-haul
Compactness High Medium Highest Verbose
Security SSL SSL DTLS SSL
Flow control No Yes No No
Structured
message
No Yes No Yes
Complexity Medium High Low Lowest
31. Apache ActiveMQ
Apache ActiveMQ is a high-performance, scalable
messaging broker
Started as an open source JMS broker
Moved to Apache Software Foundation in 2006
Now widely used open source messaging system
34. Apache ActiveMQ
Limitations
Broker core getting old
Written using synchronous thread-locking model
Limits vertical scalability of the broker
Number of threads raise with number of connections
and destinations
35. ActiveMQ Artemis
Multi Protocol Broker
AMQP, MQTT, STOMP, OpenWire, Artemis Core
JMS (API)
Started as HornetQ JBoss project in 2009
Embedded WildFly (JBoss AS) JMS messaging
service
In 2014 donated to Apache ActiveMQ
Sub project ActiveMQ Artemis.
Latest Release 1.1.0
36. ActiveMQ Artemis: Core
Contains Broker Business logic
Core maintains a tight scope
Message Routing
Persistence
Protocol utility API
HA and Scaling
Highly Performance
Protocols are plugged in
38. Apache Artemis Summary
Great performance due to
Reactive Architecture
Efficient Append only Journal
Multi - Protocol Broker
AMQP, MQTT, STOMP, CORE, OpenWire, JMS
HA and Scalability built in
39. Apache Artemis Next Steps
Take features from ActiveMQ
Enhance OpenWire for ActiveMQ compatibility
JDBC Journal implementation
More protocols
CoAP
Your protocol here….
42. Broker – Horizontal Scaling
One broker can only do so much
Horizontal scaling
Networks of brokers
Load balance connections
Limitations
All destinations on all brokers
Broker network is the bottleneck
43. Qpid Dispatch Router
Lightweight AMQP 1.0 message router written in C
http://qpid.apache.org/components/dispatch-router/
Provides flexible and scalable interconnect between
AMQP endpoints
44. Qpid Dispatch Router
It is not a broker
It never owns a message
It propagates AMQP transfer, settlement and
disposition frames between endpoints
Message based or link based routing
Router/device1
/device2
48. Qpid dispatch router
Benefits
Better scaling due to more focused tasks
Smart routing can be used to partition the traffic
Ideal candidate for gateway into the system
50. Scalable deployments
Combination of brokers and routers provides
powerful tool box
Brokers should focus on storing messages
Routers should do the rest
Allows for horizontal scaling topologies that can
solve IoT challenges
56. Summary
IoT offers a new set of problems for communication
Messaging is a good fit
We need new tools and technologies to help
Protocols such as AMQP and MQTT help address some
of these problems
ActiveMQ and Artemis are evolving to meet IoT
demands
New tools such as Apache Dispatch Router allow us to
do some novel things to help scale to really high
numbers