Hey folks, we have mentioned the awesomeness of MQLight – and the awesomeness of BlueMix. What I wanted to do was link the two together in a single blog post.
For those not familiar with MQLight – here are a brace of dashing chaps that will give you the lowdown on MQLight as well as some collateral that will help you test your app’s runnimg locally

We have some great info on how to grab the goodies here – https://developer.ibm.com/messaging/mq-light/
But just to show you how simple it is to use – here is a node.js sample to receive a message:

var mqlight = require(‘mqlight’);
var recvClient = mqlight.createClient({service: ‘amqp://localhost’});
recvClient.on(‘connected’, function() {
recvClient.subscribe(‘news/technology’);
recvClient.on(‘message’, function(data, delivery) {
console.log(data);
});
});
recvClient.connect();

and to send:
var mqlight = require(‘mqlight’);
var sendClient = mqlight.createClient({service: ‘amqp://localhost’});
sendClient.on(‘connected’, function() {
sendClient.send(‘news/technology’, ‘Hello World!’);
});
sendClient.connect();

Now we are going to move forward into BlueMix – now a couple of legends Mark Phillips and Melanie Rao have made life easier for everyone by giving an account of how its done here – https://www.ibm.com/developerworks/library/ws-elasticmq-app/#N100E1

Basically the blog outlines a few simple steps to getting your MQLight goodies up and running in BlueMix

1. Familiarize yourself with the MQ Light JMS API, see Getting started with the MQ Light JMS API.

2. Download, deploy, and then run the JMS worker sample for MQ Light, for more information, see JMS worker application.

3. Download, deploy, and then run the JMS web application for MQ Light, for more information, see JMS web application.

4. You can write your own application for MQ Light, for more information, see Writing your own application.

5. When you have written your new application, you can deploy it, for more information see Deploying your own application.

Enjoy!

Advertisements