IBM Mobile Messaging and M2M Client Pack MA9B
The IBM Mobile Messaging and M2M Client Pack MA9B provides a software development kit (SDK) for building MQTT-based mobile messaging and machine-to-machine (m2m) applications.
MQTT is an open lightweight messaging protocol that is well suited for use in mobile, device, and m2m applications. The SDK contains client libraries and samples for use in building these types of applications. This appendix describes the following topics about IBM Mobile Messaging and M2M Client Pack MA9B:
Client libraries
IBM Mobile Messaging and M2M Client Pack MA9B provides two Java client libraries. To read more details about MA9B, see the following website:
Java Client: org.eclipse.paho.client.mqttv3
The Java client library is found in the ../SDK/clients/java directory of the MA9B client pack. This Java library implements the client portion of the MQTT V3.1 protocol implementation. The Java client runs on any suitable Java run time (Java 1.5 and later), including Android. Separate interfaces are provided for synchronous and asynchronous styles of operation.
The synchronous application programming interface (API) supports a style where an operation only returns to the caller when the operation has completed. This is a traditional style, which might be used to implement a simple client. However, the blocking nature of this API limits its usage in environments where threads
are not allowed to block, or when high performance or large numbers of clients are required.
The asynchronous API supports a different style in which a call returns immediately. The application can then either be notified through a callback when the operation completes, or can use a token returned to the application to block until the operation completes. This style of API is better suited to mobile, event-oriented, and high-performing applications. Applications where it might take time to complete an operation, or where a thread must not be blocked, are good candidates for the asynchronous API.
This client is a version of the open source MQTT client that is available from the Eclipse.org Paho project.
Java Client: com.ibm.micro.client.mqttv3
The Java client library is found in the ../SDK/clients/java directory of the MA9B client pack. This Java library implements the client portion of the MQTT V3.1 protocol. An interface is provided for the synchronous style of operation. This is the same interface that was first included with WebSphere MQ V7.0.1, and is suitable for use with existing applications. This interface has been stabilized.
For new applications, use the client in the org.eclipse.paho.client.mqttv3 package. To use this library, the Eclipse Paho version of the client (org.eclipse.paho.client.mqttv3v3.jar) must be included on the class path.
Samples
IBM Mobile Messaging and M2M Client Pack MA9B provides a variety of samples.
Java sample
A set of Java samples that shows how to program using both synchronous and asynchronous programming styles is provided.
The pre-built Java archive (JAR) file is org.eclipse.paho.sample.mqtv3app.jar.
Source code for this sample is available in the ../SDK/clients/java/samples directory of the MA9B client pack.
Android sample
The Android sample for the MQTT mobile application can be found in the ../SDK/clients/android directory of the MA9B client pack. Native Android applications are made up of one or more activities and, optionally, one or more services.
Although a native Android application can call the asynchronous Java client directly from an activity, it often makes more sense to call the asynchronous Java client from a service. A service can continue running (and in particular, can be receiving incoming messages) when the application activities have stopped.
The MA9B client pack provides a sample Android application (called mqttExerciser) that connects to an MQTT server and sends and receives messages. This application is made up of an Android activity that is bound to an Android service that encapsulates all of its MQTT API calls.
C client
The C sample client for MQTT is in the ../SDK/clients/c directory of the MA9B client pack. The C implementation of the MQTT V3.1 protocol, similar to the Java equivalent, has separate interfaces provided for synchronous and asynchronous styles of operation. These clients are provided for a variety of platforms.
This client is a version of the open source MQTT client that is available from the Eclipse.org Paho project.
Client for JavaScript
The client for JavaScript is in the ../SDK/WebContent/WebSocket directory of MA9B client pack. JavaScript implementation of the MQTT V3.1 protocol enables HTML web pages to connect to servers and send MQTT messages over a WebSocket. The JavaScript implementation can be loaded by the browser from a suitably configured WebSphere MQ queue manager, or from a web server.
 
Restriction: User interfaces resulting from the Sample code are not warranted to be compliant to any accessibility standards or accessibility requirements.
IBM Mobile Messaging and M2M Client Pack MA9B system requirements
Support is available on the latest level of code, and clients must upgrade to the most recent level of the IBM Mobile Messaging and M2M Client Pack MA9B from the IBM developerWorks Messaging website:
The IBM Service team might also request that a problem is reproduced on a reference platform.
IBM Messaging client for JavaScript
The following sections provide information about the system requirements
for JavaScript.
Supported platforms
All major browser versions that are compliant with the RFC 6455 (WebSocket) Standard are supported.
Reference platforms
The following list includes the reference platforms for JavaScript:
Samsung Galaxy S III Android 4.1 Firefox (latest version)
Apple iPhone 5 iOS 7 Safari (latest version)
Intel (x86-32) Microsoft Windows 7 Chrome (latest version)
Intel (x86-64) Linux Red Hat 6 Firefox (latest version)
Java clients
The following sections provide information about the system requirements for Java clients.
Supported platforms
The Java client runs on any platform that has a suitable Java runtime environment (JRE). The client can be run on the following Java run times:
JRE 1.5 or later that is Java compatible
Reference platforms
The following list includes the reference platforms for Java clients:
Samsung Galaxy S III/Android 4.1/Native (built-in) Java run time for Android
Samsung Galaxy Tab 2 10.1/Android 4.0/Native (built-in) Java run time for Android
Intel (x86-32)/Windows 7/IBM Java 1.5
Intel (x86-32)/Red Hat 6/IBM Java 1.6
C clients (synchronous)
The following sections provide information about the system requirements for synchronous C clients.
Supported platforms
The client can be run on the following supported platforms:
iOS 7.0 and future OS fix packs
Currently supported platforms for C client in WebSphere MQTT
Reference platforms
The following list includes the reference platforms for synchronous C clients:
Apple iPad 3/iOS 6.0
Apple iPhone 5/iOS 7.0
Intel (x86-32)/Windows 7 Professional/Microsoft Visual Studio 2010
Intel (x86-32)/Red Hat Enterprise Linux (RHEL) Server 6.0 with glibc 2.12 and kernel 2.6.32
Intel (x86-64)/RHEL Server 6.0 with glibc 2.12 and kernel 2.6.32
C clients (asynchronous)
The following sections provide information about the system requirements for asynchronous C clients.
Supported platforms
The client can be run on the following supported platforms:
iOS 7.0 and later OS fix packs
Intel Linux glibc 2.12 and kernel 2.6.32 and future OS fix packs
Windows XP, Windows Vista, Windows 7 and future OS fix packs
Reference platforms
The following list includes the reference platforms for asynchronous C clients:
Apple iPad 3/iOS 6.0
Apple iPhone 5/iOS 7.0
Intel (x86-32)/Windows 7 Professional/Visual Studio 2010
Intel (x86-32)/RHEL Server 6.0 with glibc 2.12 and kernel 2.6.32
Intel (x86-64)/RHEL Server 6.0 with glibc 2.12 and kernel 2.6.32
Download location
You can download the most recent level of the IBM Mobile Messaging and M2M Client Pack MA9B from the IBM developerWorks Messaging website:
 
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset