Sunday, 2 April 2017

I didn't run Node JS v6 and mqlight v2.0 with ibm mq?

I get the exampe snippet to publish and subscribe below, i didn't run with Node JS 6 and mqlight v2.0

https://www.npmjs.com/package/mqlight?cm_mc_uid=47189062138014548006442&cm_mc_sid_50200000=1490060435

// Receive:
var mqlight = require('mqlight');
var recvClient = mqlight.createClient({service: 'amqp://user:user@localhost:5672'});
recvClient.on('started', function() {
recvClient.subscribe('/TEST/#','sub1');
recvClient.on('message', function(data, delivery) {
          console.log(data);
     });
});

// Send:

 var sendClient = mqlight.createClient({service: 'amqp://user:user@localhost:5672'});
 sendClient.on('started', function() {
     sendClient.send('TEST');
});

Hope anyone can help.

Thanks



via dhaavhincy

No comments:

Post a Comment