postwait / node-amqp

[UNMAINTAINED] node-amqp is an AMQP client for nodejs
MIT License
1.69k stars 357 forks source link

Reconnect not working, keep getting "ECONNREFUSED" error. #230

Open spako opened 11 years ago

spako commented 11 years ago

node-amqp does not seem to want to reconnect.

I can demonstrate this with the reconnection tests. When running test-reconnection.js I get the following output:

Starting...
Connection ready (1)
Message one published
Message two published
Message received (1): one
Message received (2): two
Connection error (1): Error: INTERNAL_ERROR
Connection close (1)
Connection error (2): Error: connect ECONNREFUSED
Connection close (2)
Connection error (3): Error: connect ECONNREFUSED
Connection close (3)
Message three published
Connection error (4): Error: connect ECONNREFUSED
Connection close (4)
Connection error (5): Error: connect ECONNREFUSED
Connection close (5)
Connection error (6): Error: connect ECONNREFUSED
Connection close (6)
Connection error (7): Error: connect ECONNREFUSED
Connection close (7)
Connection error (8): Error: connect ECONNREFUSED
Connection close (8)

etc, reconnection does not stop.

I have tried various versions of node.js, the output if from v0.10.15.

cmoesel commented 11 years ago

I've encountered the same problem. I recently upgraded from 0.1.6 to the HEAD from git, and now my services don't properly reconnect or failover anymore. I'll see if 0.1.7 works and add another comment (so we know how recent the regression is).

cmoesel commented 11 years ago

I've tested with 0.1.7 and confirmed that reconnect still works there, so this is a regression since 0.1.7 was published.

ssafejava commented 11 years ago

I'm getting this same issue with HEAD. I am not keen on using 0.1.7 as it has a big eventemitter leak that cripples the app after a small number of reconnects. Have you been able to narrow it down?