-
Notifications
You must be signed in to change notification settings - Fork 475
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error event is emitted due to normal connection close from RabbitMQ side #110
Comments
I see what you mean. Would your code be happy if it got a |
It gets |
Hi squaremo, did you have a chance to fix that? |
I (think I) have fixed this in master, if you would like to give it a try @vicneanschi @xaka |
Hi there, I would like to detect correctly this connection-forced (close connection) to enable a manual reconnection process. But I have two issues:
Somewhere, this error object is not been created correctly.
What should be the best option to detect this closing connection with the server? |
I think it is related to: #149 |
@jgato Is this still a source of problems? My test program
prints out a "proper" error so far as I can tell. (By the way I've added a bit to put the replyCode on the error, and to give the close event the message, as you suggested above) |
Is this now expected behavior? Your API documentation seems to clearly state:
I was going to attach a handler to the error event in my client to attempt to re-establish its connection a fixed number of times upon closure caused by error or by action on the server. Using node |
It seems that this is still an issue on 0.5.1. |
When I run the following script then gracefully stop the broker I get a channel close event followed by a connection close event. The connection close event still provides an error object though. const amqp = require('amqplib');
(async () => {
const connection = await amqp.connect();
connection.on('error', (err) => {
console.log('Connection Error', err);
})
connection.on('close', (err) => {
console.log('Connection Closed', err);
})
const channel = await connection.createChannel();
channel.consume('test', (message) => {
console.log({ message });
})
channel.on('error', (err) => {
console.log('Channel Error', err);
})
channel.on('close', (err) => {
console.log('Channel Closed', err);
})
})(); Channel Closed undefined
|
Hi there,
I was verifying how service behaves when RabbitMQ gets restarted, etc. and I've got the following:
It was absolutely usual RabbitMQ restart procedure and service crashed because it was expecting to get
close
event, but noterror
.In my opinion there should be no
error
event when library gets320
code from RabbitMQ. Even though it's calledCONNECTION-FORCED
, there is nothing wrong happened.The text was updated successfully, but these errors were encountered: