There was an error while loading. Please reload this page.
1 parent 16ecfe9 commit bf939e3Copy full SHA for bf939e3
javascript-nodejs/src/receive_logs.js
@@ -1,17 +1,16 @@
1
#!/usr/bin/env node
2
3
var amqp = require('amqplib');
4
-
5
var conn = amqp.connect('amqp://localhost')
6
7
var ch = conn.then(createChannel).then(null, console.warn);
8
9
ch.then(function(ch) {
10
- var ok = ch.assertExchange('logs', 'fanout', {durable: false});
11
- ok = ok.then(function() {
+ var x = ch.assertExchange('logs', 'fanout', {durable: false});
+ var q = x.then(function() {
12
return ch.assertQueue('', {exclusive: true});
13
});
14
- ok = ok.then(function(qok) {
+
+ ok = q.then(function(qok) {
15
return ch.bindQueue(qok.queue, 'logs', '').then(function() {
16
return qok.queue;
17
0 commit comments