shyiko / amqplib-auto-recovery Goto Github PK
View Code? Open in Web Editor NEWAutomatic connection recovery for amqplib (squaremo/amqp.node)
Home Page: https://www.npmjs.com/package/amqplib-auto-recovery
Automatic connection recovery for amqplib (squaremo/amqp.node)
Home Page: https://www.npmjs.com/package/amqplib-auto-recovery
I believe this shouldn't be happening with auto recovery, when we run our program and rabbitmq is not up we get this issue with auto recovery
AMQP error Error: Channel ended, no reply will be forthcoming
at rej (/Users/localadmin/workspace/nautilus-js/node_modules/amqplib/lib/channel.js:190:7)
at Channel.C._rejectPending (/Users/localadmin/workspace/nautilus-js/node_modules/amqplib/lib/channel.js:196:42)
at Channel.C.toClosed (/Users/localadmin/workspace/nautilus-js/node_modules/amqplib/lib/channel.js:160:8)
at Channel.C.accept (/Users/localadmin/workspace/nautilus-js/node_modules/amqplib/lib/channel.js:411:10)
at Connection.mainAccept [as accept] (/Users/localadmin/workspace/nautilus-js/node_modules/amqplib/lib/connection.js:63:33)
at Socket.go (/Users/localadmin/workspace/nautilus-js/node_modules/amqplib/lib/connection.js:476:48)
at emitNone (events.js:86:13)
at Socket.emit (events.js:185:7)
at emitReadable_ (_stream_readable.js:433:10)
at emitReadable (_stream_readable.js:427:7)
at readableAddChunk (_stream_readable.js:188:13)
at Socket.Readable.push (_stream_readable.js:135:10)
at TCP.onread (net.js:542:20)```
I have been trying to to use this library to open a confirm channel on Node 6.9.1 against RabbitMQ. It seems that the invocation of my channel callback (#L86 in this library) is failing to run. Stepping through with the debugger I get right to line 86 and step into but nothing happens. I have a breakpoint at the first line of the callback and it does not get hit.
Have you ever seen something like this? Thoughts on what could be wrong?
Here is my amqp implementation with RPC pattern,
var amqp = require('amqplib');
var uuid = require('uuid-v4');
var url = 'amqp://localhost';
var rpc_queue = 'rpc_queue';
const REPLY_QUEUE = 'amq.rabbitmq.reply-to';
const createClient = () => amqp.connect(url)
.then((conn) => conn.createChannel())
.then((channel) => {
console.log('channel created');
// create an event emitter where rpc responses will be published by correlationId
channel.responseEmitter = new EventEmitter();
channel.responseEmitter.setMaxListeners(0);
channel.consume(REPLY_QUEUE,
(msg) => channel.responseEmitter.emit(msg.properties.correlationId, msg.content),
{noAck: true});
return channel;
});
async function test() {
var channel = await createClient();
};
test();
I am getting following errors
'(node:15384) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'then' of undefined'
and
if (err === null) cb(null, new CallbackModel(c));
^
TypeError: cb is not a function
Please help me in getting my code working with your library .
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.