Getting started with MQTT clients
You can get started developing a mobile or machine-to-machine (M2M) app by building and running a sample MQTT client app that uses an MQTT client library. The sample apps, and associated client libraries, are available in the Mobile Messaging and M2M Client Pack from IBM®. There are versions of the apps and client libraries written in Java, in JavaScript, and in C. You can run these apps on most platforms and devices, including Android devices and products from Apple.
Before you begin
To build and run your app, you need some experience of building apps for the target device or platform and the programming language being used. A little experience is usually enough to get a sample app up and running on your chosen device or platform.
If you use an enterprise-strength MQTT server such as IBM WebSphere® MQ or IBM MessageSight, you can exchange information from your sample app with your existing enterprise apps.
About this task
- Choose an MQTT server to which you can connect the client app.
- Download the Mobile Messaging and M2M Client Pack.
- Build, for your target device or platform, the sample apps from the client pack.
- Verify that the samples behave as expected by connecting them to the MQTT server.
- Sample MQTT client apps written in Java, in JavaScript, and in C.
- MQTT client libraries that support these client apps, and enable them to run on most platforms and devices.
Procedure
The following articles guide you through the platform-specific steps for building and running a sample MQTT app on a desktop computer, or on a mobile device for Android or from Apple:
- Getting started with the MQTT client for Java
- Getting started with the MQTT client for Java on Android
- Getting started with the MQTT messaging client for JavaScript
- Getting started with the MQTT client for C
- Getting started with the MQTT client for C on iOS
What to do next
- Programming in the language that is required for the device or platform.
- Programming for the target device or platform.
- Designing publish/subscribe applications.
- Designing programs for the MQTT programming model.
- Designing programs to run on your chosen mobile device.
- Using SSL and JAAS to secure programs.
You do not need any network programming skills to connect an MQTT client with another device or application, because MQTT is a messaging and queuing system. The MQTT client libraries manage the network connections for your application.
To integrate your MQTT client with existing enterprise applications, you have two choices. You can share the MQTT publish/subscribe topics with (for example) an IBM WebSphere MQ or JMS application, or you can write your own integration adapter as another MQTT client.