8000 Merge pull request #92 from Fortiz2305/pull_req · sardesh/rabbitmq-tutorials@ccea946 · GitHub
[go: up one dir, main page]

Skip to content

Commit ccea946

Browse files
Merge pull request rabbitmq#92 from Fortiz2305/pull_req
Change buffer creation approach
2 parents 406ef10 + bdb2179 commit ccea946

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

javascript-nodejs/src/send.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@ var amqp = require('amqplib/callback_api');
55
amqp.connect('amqp://localhost', function(err, conn) {
66
conn.createChannel(function(err, ch) {
77
var q = 'hello';
8+
var msg = 'Hello World!';
89

910
ch.assertQueue(q, {durable: false});
10-
ch.sendToQueue(q, new Buffer('Hello World!'));
11-
console.log(" [x] Sent 'Hello World!'");
11+
ch.sendToQueue(q, new Buffer(msg));
12+
console.log(" [x] Sent %s", msg);
1213
});
1314
setTimeout(function() { conn.close(); process.exit(0) }, 500);
1415
});

0 commit comments

Comments
 (0)
0