This document discusses using MQTT as a lightweight protocol for connecting devices in the Internet of Things. It provides an overview of MQTT and its advantages for sensor applications and devices. It also describes how MQTT can be used with Red Hat JBoss Fuse and A-MQ to collect IoT information from devices and process the data. The presentation includes a demonstration of an MQTT architecture on OpenShift using Fuse.
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Connect to the IoT with a lightweight protocol MQTT
1. Connect to the IoT with a lightweight protocol: MQTT
Kenneth Peeples
Technical Marketing Manager, Red Hat
April 23, 2015
2. Red Hat | Kenneth Peeples
Agenda
● Overview of MQTT for IoT
● Overview of MQTT with JBoss Fuse and A-MQ
● Demonstration with MQTT with Fuse on Openshift
3. Red Hat | Kenneth Peeples
What is MQTT?
● Lightweight Message Transport Protocol
● Machine 2 Machine/Wireless Sensor
Networks/Internet of Things Transport
● OASIS Standard
– https://www.oasis-open.org/committees/tc_home.php?
wg_abbrev=mqtt
● Growing Support
● Publish and Subscribe (PubSub) Model with
Topics
4. Red Hat | Kenneth Peeples
Why MQTT for IoT?
● Simple to implement
● PubSub for Sensor applications and devices
● Zero administration
● Lightweight and bandwidth efficient
● Last will and testament
● Data agnostic
● Quality of Service
5. Red Hat | Kenneth Peeples
MQTT with Red Hat JBoss Fuse and A-MQ
http://library.dzone.com/whitepaper/2014-guide-internet-things
8. Resources:
Red Hat | Kenneth Peeples
● http://www.dzone.com/articles/red-hat-jboss-mq-and-iot
● https://github.com/jbossdemocentral/jboss-fuse-iot-mashup
● https://www.oasis-open.org/committees/download.php/49205/MQTT-OASIS-Webi
● http://www.slideshare.net/rajdavies/connecting-applicationswitha-mq
● http://www.slideshare.net/opensourcementor/understanding-and-using-client
● http://wei-meilin.blogspot.tw/2014/05/red-hat-openshift-xpaas-simple-
mqtt.html
Notas do Editor
MQTT stands for Message Queue Telemetry Transport. MQTT is a lightweight publish/subscribe message protocol for constrained internet of things devices and low-bandwidth, high latency or unreliable networks. As MQTT specializes in low-bandwidth, high-latency environments is an ideal protocol for machine to machine (M2M) communication and Wireless Sensor networks.
MQTT was first developed in 1999 but has found a growing market and support due to the exponential growth of the internet of things. It was built to be a low-overhead protocol which considered bandwidth and CPU limitations. It was designed with abilitiy to run in an embedded environment. Now a OASIS standard handled by the OASIS MQTT Technical Committee, the standard supports bi-directional messaging to uniformly handle both signals and commands, deterministic message delivery, basic QoS levels, always/sometimes connected scenarios, loose coupling and scalability to support large numbers of devices.
MQTT fundamentally is a publish/subscribe protocol that allows clients to connect as publisher, subscriber or both. A broker handles al message passing. MQTT focuses on topics.
Benefits are:
Extends connectivity beyond boundaries to smart devices
Provides connectivity options which are optimized for sensors and remote devices
Enables massive scalability of deployment and management of solutions
Delivers relevant data to intelligent, decision-making assets that can use it
As a m2m/iot protocol, mqtt is designed to support messaging transport from remote locations/devices involving small code footprints, low power, low bandwidth, high-cost connections, high latency, variable availability and negotiated delivery guarantees
MQTT is also ideal for mobile applications because of its small size, minimized data packets and efficient distribution of information to one or many receivers/subscribers.
The messages are delivered asynchronously (push) through publish/subscribe architecture. The protocol works by exchangeing a series of control packets which are small.
Many apps can be developed just by implementing CONNECT, PUBLISH, SUBSCRIBE, DISCONNECT, control packets. Since it is open and standardized by OASIS it is easy to adopt for a wide variety of IoT devices, platforms and Oss.
Zero administration or as close as possible
“Last Will and Testament” LWT message: specified in CONNECT message with topic, QoS and retain. On unexpected client disconnection, the “Last Will and Testament” message is sent to subscribed clients on the LWT topic.
Data agnostic and message content is received as it was sent
Quality of Service
0-at most once (fire and forget) delivered according to the best efforts of the os. Message loss can occur.
1- at least once. Messages are assured to arrive but duplicates can occur
2-exactly once. Messages are assured to arrive exactly once.
MQTT is flexible for IoT devices. The simple rule to follow with QoS is the higher th QoS, the lower the performance.
Also MQTT helps minimise the on-the0wire footprint
Caters to frequent network disruptions
Continuous Session awareness
Describe where to get the download
A-MQ-
JBoss A-MQ is a high performance, flexible messaging platform that delivers information safely, reliably and enables Internet of Things (IoT). JBoss A-MQ can be deployed, and easily managed, in any configuration so you can deploy a network of brokers across your infrastructure whether they are on premise, in the Cloud, or in a hybrid configuration.
JBoss A-MQ for xPaaS extends the messaging capabilities to OpenShift Platform-as-a-Service (PaaS) solution.
High performance messaging: A reliable messaging platform that supports standard messaging paradigms for a real-time enterprise.
Cross-language and multi-protocol support: Allows native connectivity from applications written in Java, C, C++. Multiple transport protocols for exchanging data between applications, services and devices. Supports JMS 1.1, TCP, SSL, STOMP, NMS, MQTT, AMQP 1.0.
Cloud ready:Deploy on premise, in the cloud or in a hybrid configuration.
Fuse-
JBoss Fuse is an open source Enterprise Service Bus (ESB) with an elastic footprint that supports integration beyond the data center. The ability to deploy JBoss Fuse in several different configurations enables intelligent integration to all facets of your business - on premise or in the Cloud.
JBoss Fuse for xPaaS extends the integration capabilities to OpenShift Platform-as-a-Service (PaaS) solution.
Pattern based integration framework:Leverage Apache Camel to provide a full-featured, easy-to-use and intuitive framework for quicker integration solutions.
Dynamic configuration and management:Change configuration while container is running. Easily deploy or update services across nodes while the ESB is running.
Multiple connectivity options: Connect to external applications with connectors for JDBC, FTP/SFTP, HTTP/HTTPS, file, SalesForce.com, SAP, Twitter, and more.
Fuse contains
Apache Camel:compose your applications from Enterprise Integration Patterns (EIPs) based on the popular Hohpe and Woolf EIPs.
Apache CXF: Integrate applications with SOAP, XML/HTTP and RESTful HTTP.
Apache ActiveMQ: Provides core messaging within the ESB and for integrating with other applications.
Apache Karaf:Offers a lightweight OSGI-based runtime container for managing the components that compose your applications.
Fabric8: Makes it simple to manage large and distributed, JBoss Fuse deployments from a central location.
A-MQ as we discussed can aggregate data reliability and provide real-time notification. A hub-and-spoke architecture is natural for MQTT. The goal of MQTT is to collect data from many devices and transport that data to the IT infrastructure. You don’t want to lose data, so the protocol works on top of TCP, which provides a simple, reliable stream. Since the data is used by the IT infrastructure, the entire system is designed to easily transport data into enterprise technologies like A-MQ/ActiveMQ and Fuse/ESBs.
Overview:
Describe Architecture
Describe clients used and setup
Describe A-MQ/Fuse setup on premise and on openshift
Describe Camel Context in JBDS
Describe as one of the goals simplicity
Script of demo:
Start Camel context in JBDS which starts the broker
Describe project in JBDS
Describe the clients
Describe Google Earth and network link
Run the sensor 1 Client, show message received and GE
Run the sensor 2 client, show message received and GE
Run the sensor 2 client, show message received and GE