Remember when we mentioned MQLight? Here we show how your app can be moved to BlueMix

john mcnamara

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…

View original post 148 more words

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s