Merge pull request #92 from Fortiz2305/pull_req

Change buffer creation approach
This commit is contained in:
Michael Klishin 2016-05-08 07:25:53 +08:00
commit ccea946ff5

View File

@ -5,10 +5,11 @@ var amqp = require('amqplib/callback_api');
amqp.connect('amqp://localhost', function(err, conn) {
conn.createChannel(function(err, ch) {
var q = 'hello';
var msg = 'Hello World!';
ch.assertQueue(q, {durable: false});
ch.sendToQueue(q, new Buffer('Hello World!'));
console.log(" [x] Sent 'Hello World!'");
ch.sendToQueue(q, new Buffer(msg));
console.log(" [x] Sent %s", msg);
});
setTimeout(function() { conn.close(); process.exit(0) }, 500);
});