Worklight: push notification from WebSphere MQ pattern

Use the Worklight: push notification from WebSphere MQ pattern to send notifications to Worklight mobile applications from WebSphere MQ.

A diagram showing the Worklight notification architecture.

Solution

An instance of the Worklight: push notification from WebSphere MQ pattern manages a WebSphere MQ queue. The queue stores messages that are delivered to users through a mobile application. You must arrange for a provider application to put messages to the queue. The messages are in a pre-defined format specified by the pattern using an XML schema. The messages contain the user who is the intended recipient for the notification. The messages also specify several additional fields including a text notification to display to the user when the message is delivered.

The pattern is configured with an event source name. The event source name provides the link between the mobile application, Worklight, and IBM Integration Bus. The mobile application must be written to subscribe to the event source (this process is explained in the Worklight Developer Reference). The pattern generates an adapter which periodically calls the web service to collect any pending notification messages from the queue. The adapter converts the notification messages from XML into JSON and passes them to Worklight. Worklight arranges for the messages to be delivered to the mobile application. Delivery is organised by Worklight using the appropriate intermediary such as Apple Push Notification (APN) servers. Worklight determines the location to which to send the notifications based on the original subscription from the mobile application.

The pattern is configured with an optional set of payload fields. The notification message sent to a mobile application contain these additional application specific data fields. The payload fields are delivered in a JSON message so their names must be compatible with JavaScript/JSON naming conventions. There are limits on the size of these data fields. For more information refer to the Worklight Developer Reference.

Generated Web Service

The pattern instance generates message flows that implement a web service. The pattern instance also generates a multi-file WSDL that represents the web services interface between the Worklight adapter and the IBM Integration Bus. The WSDL files are a WS-I compliant web services description.

The first WSDL file contains a WSDL port type definition, and an operation to retrieve pending notification messages from the queue. The second WSDL file contains a SOAP service and port definition. The SOAP address of the web service is configured as a pattern parameter. The pattern instance also generates an XML schema file. The XML schema represents the data types for all input and output parameters for each WSDL operation. The schema file is included in the WSDL file using a standard WSDL include statement.

Deployment

The pattern generates a Integration Bus application which must be deployed to the Integration Bus runtime. The Worklight adapter must be deployed to the Worklight Server.

Constraints on the use of the pattern
Worklight adapters
Tasks to complete before applying the pattern
Parameters for the pattern
Tasks to complete after generating the pattern