8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c544f23 commit bdb2179Copy full SHA for bdb2179
javascript-nodejs/src/send.js
@@ -5,11 +5,11 @@ var amqp = require('amqplib/callback_api');
5
amqp.connect('amqp://localhost', function(err, conn) {
6
conn.createChannel(function(err, ch) {
7
var q = 'hello';
8
- var buffer = new Buffer('Hello World!');
+ var msg = 'Hello World!';
9
10
ch.assertQueue(q, {durable: false});
11
- ch.sendToQueue(q, buffer);
12
- console.log(" [x] Sent %s", buffer.toString());
+ ch.sendToQueue(q, new Buffer(msg));
+ console.log(" [x] Sent %s", msg);
13
});
14
setTimeout(function() { conn.close(); process.exit(0) }, 500);
15
0 commit comments