-
Notifications
You must be signed in to change notification settings - Fork 42
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
Missing reconnect and 'close' event #27
Comments
alavers
added a commit
to zendesk/amqp-ts
that referenced
this issue
Jan 9, 2019
Fixes a bug where amqp-ts would fail to reconnect in the event that a node in a RabbitMQ cluster was cycled. In this case, amqplib emits a close event which amqp-ts fails to listen for. Fixes abreits#27
alavers
added a commit
to zendesk/amqp-ts
that referenced
this issue
Jan 10, 2019
Fixes a bug where amqp-ts would fail to reconnect in the event that a node in a RabbitMQ cluster was cycled. In this case, amqplib emits a close event which amqp-ts fails to listen for. Fixes abreits#27
alavers
added a commit
to zendesk/amqp-ts
that referenced
this issue
Jan 12, 2019
Fixes a bug where amqp-ts would fail to reconnect in the event that a node in a RabbitMQ cluster was cycled. In this case, amqplib emits a close event which amqp-ts fails to listen for. Fixes abreits#27
alavers
added a commit
to zendesk/amqp-ts
that referenced
this issue
Jan 12, 2019
Fixes a bug where amqp-ts would fail to reconnect in the event that a node in a RabbitMQ cluster was cycled. In this case, amqplib emits a close event which amqp-ts fails to listen for. Fixes abreits#27
This was referenced Jan 12, 2019
This issue was closed.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi and thank you for the project 👍
I was testing some error scenarios and found unexpected behaviour when using the Connection class'
reconnectStrategy
.amqp-ts seems to handle closing connections differently in scenario 1 and 2. Scenario 1 works as expected while scenario 2 doesn't reconnect, but leaves consumers hanging as if nothing happened.
By hooking up the 'close' callback, I see that only Scenario 1 results in a
isFatalError=true
from the dependencyamqplib
. The 'close' callback also allows me to detect that Scenario 2 doesn't reconnect and results inisFatalError=false
.If Scenario 1 happens, the 'close' callback is only invoked on the first 'close' event. Since I have to handle Scenario 2 manually this unfortunately renders the reconnect feature unuseful for me, since I can't handle the manual reconnects if a successful reconnect has already happened.
Scenario 1: reconnects as expected ✅
kill -9 <PID>
)Setting up a callback on 'close' shows that amqplib's isFatalError returns
true
.Scenario 2: reconnect doesn't happen on CONNECTION-FORCED ❌
sudo systemctl restart rabbitmq-server.service
)Setting up a callback on 'close' shows that amqplib's isFatalError returns
false
and error: "Connection closed: 320 (CONNECTION-FORCED) with message "CONNECTION_FORCED - broker forced connection closure with reason 'shutdown'".Scenario 3: 'close' callback isn't invoked after succesfull reconnect (scenario 1) ❌
kill -9 <PID>
)sudo systemctl restart rabbitmq-server.service
)The text was updated successfully, but these errors were encountered: