You are previewing Building Real-time Mobile Solutions with MQTT and IBM MessageSight.
O'Reilly logo
Building Real-time Mobile Solutions with MQTT and IBM MessageSight

Book Description

Message Queuing Telemetry Transport (MQTT) is a messaging protocol designed for the Internet of Things (IoT). It is lightweight enough to be supported by the smallest devices, yet robust enough to ensure that important messages get to their destinations every time. With MQTT devices, such as energy meters, cars, trains, mobile phones and tablets, and personal health care devices, devices can communicate with each other and with other systems or applications.

IBM® MessageSight is a messaging appliance designed to handle the scale and security of a robust IoT solution. MessageSight allows you to easily secure connections, configure policies for messaging, and scale to up to a million concurrently connected devices.

This IBM Redbooks® publication introduces MQTT and MessageSight through a simple key fob remote MQTT application. It then dives into the architecture and development of a robust, cross-platform Ride Share and Taxi solution (PickMeUp) with real-time voice, GPS location sharing, and chat among a variety of mobile platforms. The publication also includes an addendum describing use cases in a variety of other domains, with sample messaging topology and suggestions for design.

Table of Contents

  1. Front cover
  2. Notices
    1. Trademarks
  3. Preface
    1. Authors
    2. Now you can become a published author, too!
    3. Comments welcome
    4. Stay connected to IBM Redbooks
  4. Chapter 1. Overview of Message Queuing Telemetry Transport (MQTT)
    1. 1.1 Building a Smarter Planet world
      1. 1.1.1 The Internet of Things (IoT)
      2. 1.1.2 Smarter Planet concept
      3. 1.1.3 Telemetry and the Internet
    2. 1.2 MQTT
      1. 1.2.1 Benefits of the MQTT protocol
      2. 1.2.2 Basic concepts of the MQTT protocol
      3. 1.2.3 The OASIS MQTT Technical Committee
      4. 1.2.4 The Eclipse Paho project
      5. 1.2.5 Comparison of MQTT and HTTP
    3. 1.3 MessageSight
    4. 1.4 Benefits of using MQTT
    5. 1.5 Where to use MQTT
      1. 1.5.1 Connected car
      2. 1.5.2 Connected city
      3. 1.5.3 Connected home
      4. 1.5.4 Connected consumers
  5. Chapter 2. Getting started with Message Queuing Telemetry Transport (MQTT)
    1. 2.1 MQTT concepts
      1. 2.1.1 MQTT messaging
      2. 2.1.2 MQTT client programming
    2. 2.2 MQTT server
      1. 2.2.1 IBM MessageSight
      2. 2.2.2 IBM WebSphere MQ
      3. 2.2.3 Really Small Message Broker and MQ Telemetry daemon for devices
      4. 2.2.4 Mosquitto
    3. 2.3 MQTT clients
      1. 2.3.1 Eclipse Paho clients
      2. 2.3.2 IBM Mobile Messaging and M2M Client Pack MA9B
      3. 2.3.3 Preparation
      4. 2.3.4 Building the sample MQTT application
      5. 2.3.5 MQTT publisher and subscriber in Java
      6. 2.3.6 MQTT publisher and subscriber in JavaScript
  6. Chapter 3. Overview of IBM MessageSight
    1. 3.1 Features of MessageSight
      1. 3.1.1 MessageSight is a developer-friendly solution
      2. 3.1.2 Connections to MessageSight
    2. 3.2 Messaging patterns of MessageSight
      1. 3.2.1 Fan out broadcast
      2. 3.2.2 Fan in per device notification
      3. 3.2.3 Fan out per device notification
      4. 3.2.4 Fan out per device request-reply
      5. 3.2.5 Fan in per device request-reply
    3. 3.3 Install the MessageSight virtual appliance (for developers)
    4. 3.4 Overview of the MessageSight web UI
      1. 3.4.1 Connect to the MessageSight appliance
      2. 3.4.2 The MessageSight Home page
      3. 3.4.3 Administrator actions using the MessageSight web UI
    5. 3.5 Overview of the MessageSight CLI
      1. 3.5.1 Connect to the MessageSight appliance
      2. 3.5.2 Administrator actions using the MessageSight CLI
    6. 3.6 Message hubs, endpoints, and policies
      1. 3.6.1 Endpoints
      2. 3.6.2 Message hubs
      3. 3.6.3 Connection policies
      4. 3.6.4 Messaging policies
      5. 3.6.5 Endpoints
      6. 3.6.6 The DemoHub message hub
      7. 3.6.7 Configuring your first message hub using the MessageSight web UI
      8. 3.6.8 Configuring a message hub using the MessageSight CLI
      9. 3.6.9 Use the MessageSight SSH to deploy message hub configuration
  7. Chapter 4. Typical network topology, messaging patterns, and considerations
    1. 4.1 Network topology
      1. 4.1.1 The architecture
    2. 4.2 Messaging patterns
      1. 4.2.1 Fan out broadcast
      2. 4.2.2 Fan in per device notification
      3. 4.2.3 Fan out per device notification
      4. 4.2.4 Fan in per device request reply
      5. 4.2.5 Fan out per device request reply
    3. 4.3 Messaging considerations
      1. 4.3.1 Quality of service
      2. 4.3.2 Message size
      3. 4.3.3 Message order
      4. 4.3.4 Topic namespace
      5. 4.3.5 Retained message
  8. Chapter 5. IBM MessageSight and the key fob remote application
    1. 5.1 Overview of the key fob remote application
      1. 5.1.1 Application overview
      2. 5.1.2 Testing the key fob remote application
    2. 5.2 MessageSight configurations for the key fob remote application
      1. 5.2.1 MessageSight basic configuration
    3. 5.3 Security capabilities of the MessageSight appliance
      1. 5.3.1 Adding security controls to the key fob remote application
      2. 5.3.2 Adding security at the transport level using SSL or TLS
  9. Chapter 6. Overview of the PickMeUp application
    1. 6.1 Company A scenario
      1. 6.1.1 Company A business problem
      2. 6.1.2 Requirements for the PickMeUp application at Company A
    2. 6.2 PickMeUp architecture for real-life use
      1. 6.2.1 Architecture overview
      2. 6.2.2 Considerations for the real-life use of PickMeUp
    3. 6.3 Company A solution
      1. 6.3.1 Scenario 1: Connecting
      2. 6.3.2 Scenario 2: Pairing
      3. 6.3.3 Scenario 3: Approaching
      4. 6.3.4 Scenario 4: Riding
      5. 6.3.5 Scenario 5: Payment
  10. Chapter 7. PickMeUp messaging scenario
    1. 7.1 Actors in the PickMeUp solution
    2. 7.2 Stages of the PickMeUp solution
    3. 7.3 Topics and messages for the PickMeUp scenario
      1. 7.3.1 Connecting
      2. 7.3.2 Pairing
      3. 7.3.3 Approaching
      4. 7.3.4 Riding
      5. 7.3.5 Payment
    4. 7.4 Summary of publication and subscription topics for the PickMeUp solution
      1. 7.4.1 Driver app topics
      2. 7.4.2 Passenger app topics
      3. 7.4.3 Back-end application topics
  11. Chapter 8. PickMeUp Message Queuing Telemetry Transport (MQTT) on iOS
    1. 8.1 Advantages of developing a native (iOS) passenger app
      1. 8.1.1 Using the iOS MQTT client
    2. 8.2 Features of the PickMeUp iOS passenger app
      1. 8.2.1 PickMeUp class overview
      2. 8.2.2 Chat topic structure
      3. 8.2.3 Chat Implementation
      4. 8.2.4 The PickMeUp iOS passenger app storyboard
  12. Chapter 9. PickMeUp Message Queuing Telemetry Transport (MQTT) on Android
    1. 9.1 Advantages of developing an Android PickMeUp application
    2. 9.2 Features of the Android PickMeUp application
      1. 9.2.1 PickMeUp class overview
      2. 9.2.2 Using the Eclipse Paho Android service
      3. 9.2.3 More information about the Android MQTT Client
      4. 9.2.4 Payment message flow
  13. Chapter 10. PickMeUp Message Queuing Telemetry Transport (MQTT) in HTML5 applications
    1. 10.1 Advantages of developing an HTML5 PickMeUp application
    2. 10.2 Features of the HTML5 MQTT application
      1. 10.2.1 PickMeUp Messenger overview
      2. 10.2.2 PickMeUp Messenger: The Driver and Passenger location flow
  14. Chapter 11. Download, deploy, and run PickMeUp in iOS, Android, and HTML environments
    1. 11.1 Set up a PickMeUp iOS project
      1. 11.1.1 Prerequisites
      2. 11.1.2 Obtain the PickMeUp iOS source code
      3. 11.1.3 Open the PickMeUp iOS project
      4. 11.1.4 Configure the project build settings
      5. 11.1.5 Run the application
      6. 11.1.6 Run PickMeUp for your iOS project
    2. 11.2 Set up a PickMeUp Android project
      1. 11.2.1 Prerequisites
      2. 11.2.2 Register with Google Maps API
      3. 11.2.3 Android SDK Packages
      4. 11.2.4 Run PickMeUp for your Android project
    3. 11.3 Set up the PickMeUp back end
      1. 11.3.1 Prerequisites
      2. 11.3.2 Register with Bluemix
      3. 11.3.3 Download, deploy, and run PickMeUp
    4. 11.4 Set up the PickMeUp HTML5 project
  15. Appendix A. The Message Queuing Telemetry Transport (MQTT) protocol
    1. Quality of service (QoS) levels and flow
    2. QoS determination
    3. Impact of QoS level on performance
    4. The MQTT client identifier
    5. MQTT durable and non-durable subscribers
    6. MQTT persistence
    7. The MQTT header
    8. The MQTT keep alive timer
    9. Delivery of the MQTT retry message
    10. The MQTT last will and testament
    11. The MQTT retained flag on messages
    12. The TCP/IP stack
  16. Appendix B. Additional material
    1. Locating the web material
    2. Using the web material
  17. Related publications
    1. IBM Redbooks
    2. Online resources
    3. Help from IBM
  18. Back cover
  19. IBM System x Reference Architecture for Hadoop: IBM InfoSphere BigInsights Reference Architecture
    1. Introduction
    2. Business problem and business value
    3. Reference architecture use
    4. Requirements
    5. InfoSphere BigInsights predefined configuration
    6. InfoSphere BigInsights HBase predefined configuration
    7. Deployment considerations
    8. Customizing the predefined configurations
    9. Predefined configuration bill of materials
    10. References
    11. The team who wrote this paper
    12. Now you can become a published author, too!
    13. Stay connected to IBM Redbooks
  20. Notices
    1. Trademarks