-
Notifications
You must be signed in to change notification settings - Fork 106
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
Reconnect to the closed channel. #230
Comments
Did you manage to test it? in my case also after I'm using |
@terrasoff Try watching for @elizatlawy Calling |
Oh, but there should be connect/close events for the channel too... |
@jwalton Here is the complete example. const amqp = require('amqp-connection-manager');
(async() => {
console.log("Try to connect.");
const connection = await amqp.connect(<rabbitmq host>);
const channel = connection.createChannel({
setup: function (channel) {
console.log("Set up channel to close channel in 5 seconds.");
setTimeout(async () => {
console.log("Close the channel in 5 seconds.");
await channel.close();
console.log("The channel is closed.");
// trying to manipulate with the channel you will get an error like the channel is closed
}, 5000);
return channel;
},
});
connection.on('connect', () => {
console.log("Connection is established.");
});
connection.on('close', () => {
console.log("Connection was closed.");
});
channel.on('close', () => {
console.log("Channel is closed.");
})
channel.on('connect', () => {
console.log("Channel is connected.");
});
})() |
Reconnection to the broker works fine!
Do you have the closed channels detection and reconnection?
How could I test it?
I tried the next code.
No reconnection was found:
What is your recommendation related to the channel reconnection?
The text was updated successfully, but these errors were encountered: