You are previewing Responsive Mobile User Experience Using MQTT and IBM MessageSight.
O'Reilly logo
Responsive Mobile User Experience Using MQTT and IBM MessageSight

Book Description

IBM® MessageSight is an appliance-based messaging server that is optimized to address the massive scale requirements of machine-to-machine (m2m) and mobile user scenarios. IBM MessageSight makes it easy to connect mobile customers to your existing messaging enterprise system, enabling a substantial number of remote clients to be concurrently connected.

The MQTT protocol is a lightweight messaging protocol that uses publish/subscribe architecture to deliver messages over low bandwidth or unreliable networks. A publish/subscribe architecture works well for HTML5, native, and hybrid mobile applications by removing the wait time of a request/response model. This creates a better, richer user experience.

The MQTT protocol is simple, which results in a client library with a low footprint. MQTT was proposed as an Organization for the Advancement of Structured Information Standards (OASIS) standard. This book provides information about version 3.1 of the MQTT specification.

This IBM Redbooks® publication provides information about how IBM MessageSight, in combination with MQTT, facilitates the expansion of enterprise systems to include mobile devices and m2m communications. This book also outlines how to connect IBM MessageSight to an existing infrastructure, either through the use of IBM WebSphere® MQ connectivity or the IBM Integration Bus (formerly known as WebSphere Message Broker).

This book describes IBM MessageSight product features and facilities that are relevant to technical personnel, such as system architects, to help them make informed design decisions regarding the integration of the messaging appliance into their enterprise architecture.

Using a scenario-based approach, you learn how to develop a mobile application, and how to integrate IBM MessageSight with other IBM products. This publication is intended to be of use to a wide-ranging audience.

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. Introduction
    1. 1.1 Challenges
    2. 1.2 IBM product solutions
      1. 1.2.1 IBM MessageSight
      2. 1.2.2 IBM WebSphere MQ
      3. 1.2.3 IBM Worklight
      4. 1.2.4 IBM Integration Bus (formerly WebSphere Message Broker)
      5. 1.2.5 IBM InfoSphere Streams
    3. 1.3 MQTT advantages (versus HTTP)
    4. 1.4 Mobile user experience scenarios with MQTT and IBM MessageSight
      1. 1.4.1 Connected car
      2. 1.4.2 Connected city
      3. 1.4.3 Connected home
      4. 1.4.4 Connected retail consumers
  5. Chapter 2. IBM MessageSight and MQTT
    1. 2.1 MQTT protocol
      1. 2.1.1 Eclipse Paho project
      2. 2.1.2 OASIS
    2. 2.2 Features of IBM MessageSight
    3. 2.3 Getting started
    4. 2.4 Configuration and administration
      1. 2.4.1 Command-line interface
      2. 2.4.2 The web UI
      3. 2.4.3 Displaying the firmware version in the web UI
      4. 2.4.4 Configuring message hubs
  6. Chapter 3. Integration with enterprise systems
    1. 3.1 WebSphere MQ connectivity and destination mapping
    2. 3.2 JMS connectivity with IBM Integration Bus
      1. 3.2.1 JMS integration with WebSphere MQ as the JMS provider
      2. 3.2.2 JMS integration with IBM MessageSight as the JMS provider
    3. 3.3 Developing stand-alone applications using the IBM MessageSight JMS classes
      1. 3.3.1 IBM MessageSight JMS Client Pack
      2. 3.3.2 IBM MessageSight JMS and JNDI
      3. 3.3.3 Message delivery in IBM MessageSight
      4. 3.3.4 A sample JMS publisher
      5. 3.3.5 A sample JMS subscriber
    4. 3.4 IBM MessageSight resource adapter for Java Platform Enterprise Edition applications
  7. Chapter 4. Security in IBM MessageSight
    1. 4.1 Authentication of a device connecting with IBM MessageSight
      1. 4.1.1 Users and groups
      2. 4.1.2 Creating a user ID and group with the web UI
      3. 4.1.3 Creating a user ID and group on the command line
    2. 4.2 Authorization of a device connecting with IBM MessageSight
      1. 4.2.1 Authorization schemes
      2. 4.2.2 Authorizing MQTT clients
      3. 4.2.3 Setting up authorization in IBM MessageSight: Connection policy
      4. 4.2.4 Setting up authorization in IBM MessageSight: Messaging policy
    3. 4.3 Transport Layer Security
      1. 4.3.1 Certificate profile
      2. 4.3.2 Security profile
      3. 4.3.3 Associating a security profile with an endpoint
      4. 4.3.4 Adding trusted certificates
    4. 4.4 Combining TLS with connection and messaging policy
      1. 4.4.1 Overview of TLS, connection policies, and messaging policies
      2. 4.4.2 Identities in a security setup with TLS, connection policies, and messaging policies for an MQTT client
  8. Chapter 5. MQTT with mobile platforms
    1. 5.1 Mobile application development considerations
    2. 5.2 Mobile application development models
      1. 5.2.1 Web application (browser access) development
      2. 5.2.2 Hybrid application (web) development
      3. 5.2.3 Hybrid application (mixed) development
      4. 5.2.4 Native development
      5. 5.2.5 Comparing the different approaches
    3. 5.3 IBM Worklight
      1. 5.3.1 IBM Worklight Studio
      2. 5.3.2 IBM Worklight Device Runtime Components
    4. 5.4 Mobile technologies
      1. 5.4.1 Android software stack
      2. 5.4.2 Device API specification
      3. 5.4.3 Apache Cordova
      4. 5.4.4 HTML5
      5. 5.4.5 Eclipse Paho
      6. 5.4.6 SQLite database
    5. 5.5 MQTT hybrid application for Android using IBM Worklight
    6. 5.6 Configuring the Android SDK and test environment
      1. 5.6.1 Android SDK tools
      2. 5.6.2 Downloading and installing the ADT bundle
      3. 5.6.3 Installing IBM Worklight studio in Android SDK
      4. 5.6.4 Configuring the Android emulator
    7. 5.7 MQTT hybrid application use case and requirements
      1. 5.7.1 About the company
      2. 5.7.2 Business problem
      3. 5.7.3 Application requirements
      4. 5.7.4 Application use cases
      5. 5.7.5 Application visual blueprint
      6. 5.7.6 Topic strings used for publish and subscribe
    8. 5.8 Developing an MQTT hybrid application for Android
      1. 5.8.1 Creating an IBM Worklight project and Worklight environment
      2. 5.8.2 Creating an MQTT client layer using the Eclipse Paho client
      3. 5.8.3 Creating Android services
      4. 5.8.4 Creating a Cordova plug-in
      5. 5.8.5 Creating application logic and the user interface
      6. 5.8.6 Creating the Android manifest file
      7. 5.8.7 Building and deploying the application
      8. 5.8.8 Running and testing the application
  9. Chapter 6. Scenarios overview
    1. 6.1 Scenario 1 overview
    2. 6.2 Scenario 2 overview
    3. 6.3 Scenario 3 overview
      1. 6.3.1 Push notification for selected trucks based on their location
      2. 6.3.2 Push notification for all trucks in the fleet
    4. 6.4 Scenario 4 overview
  10. Chapter 7. Scenario 1: Secure messaging
    1. 7.1 Scenario description
    2. 7.2 Scenario setup
      1. 7.2.1 User group for MQTT clients
      2. 7.2.2 Users and passwords for MQTT clients
      3. 7.2.3 Connection policy for MQTT clients
      4. 7.2.4 Messaging policy for MQTT clients
    3. 7.3 Testing the security scenario
      1. 7.3.1 Testing the connection policy
      2. 7.3.2 Testing messaging policy for publishing clients
  11. Chapter 8. Scenario 2: Request and response using MQTT
    1. 8.1 Scenario description
    2. 8.2 Scenario setup
      1. 8.2.1 JMS bindings file
      2. 8.2.2 Destination mapping rules between IBM MessageSight and WebSphere MQ
      3. 8.2.3 Creating and deploying an IBM Integration Bus application
    3. 8.3 Scenario execution
      1. 8.3.1 Components of the scenario
      2. 8.3.2 Topic strings and protocols
      3. 8.3.3 Sample messages
    4. 8.4 Scenario testing
  12. Chapter 9. Scenario 3: Push notifications with quality of service
    1. 9.1 Business value
      1. 9.1.1 Using push notifications with MQTT
    2. 9.2 Prerequisites: Technical and infrastructure
      1. 9.2.1 Software prerequisites
      2. 9.2.2 Skills prerequisites
    3. 9.3 Scenario outline
      1. 9.3.1 Push notification to selected mobile applications
      2. 9.3.2 Push notification broadcast to all mobile applications
    4. 9.4 Scenario configuration and implementation
      1. 9.4.1 Configuring IBM MessageSight
      2. 9.4.2 Configuring IBM DB2
      3. 9.4.3 Configuring WebSphere MQ
      4. 9.4.4 Configuring IBM Integration Bus
    5. 9.5 Testing the scenarios
      1. 9.5.1 Capturing and publishing geographic location changes
      2. 9.5.2 Push notification for selected trucks
      3. 9.5.3 Push notification broadcast to all trucks
  13. Chapter 10. Scenario 4: Stand-alone server applications
    1. 10.1 A stand-alone server application implemented with MQTT Java
    2. 10.2 A stand-alone server application implemented using IBM MessageSight JMS classes
    3. 10.3 Conclusion
  14. Appendix A. MQTT protocol
    1. Quality of service levels and flow
    2. QoS determination
    3. QoS effect on performance
    4. MQTT client identifier
    5. Durable and non-durable subscribers with MQTT
    6. MQTT persistence
    7. MQTT header
    8. MQTT keep alive
    9. Retry message delivery
    10. Last Will and Testament
    11. Retained flag on messages
    12. TCP/IP
  15. Appendix B. IBM Mobile Messaging and M2M Client Pack MA9B
    1. Client libraries
    2. Samples
    3. IBM Mobile Messaging and M2M Client Pack MA9B system requirements
    4. Download location
  16. Appendix C. MQTT hybrid application for Android code example
    1. ITSOTransport HTML user interface
    2. ITSOTransport JavaScript application logic
  17. Appendix D. Additional material
    1. Locating the web material
    2. Using the web material
  18. Related publications
    1. IBM Redbooks
    2. Online resources
    3. Help from IBM
  19. Back cover