Amqp connection drop sometimes and not reconnect.
See original GitHub issueHi, I use rhea/amqp with aws active mq. But sometimes the connection is broken for some unknown reason and is not reconnect. When I look at the links on the ActiveMQ page, there are over 50 links for creating a new rhea connection in each job. Is there a setting related to the maximum number of connections? Do you know why this fail happen? I will share last error on below line I ran on pm2
Amqp client disconnected { Error: getaddrinfo ENOTFOUND myhostadresscom:8883 myhostadress.com:8883:5671 at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:56:26) errno: ‘ENOTFOUND’, code: ‘ENOTFOUND’, syscall: ‘getaddrinfo’, hostname: 'myhostaddr host: 'myhostaddr port: ‘5671’ }
also; after that log i see
{ error: { ConnectionError: local-idle-timeout expired message: ‘local-idle-timeout expired’, name: ‘ConnectionError’, condition: ‘amqp:resource-limit-exceeded’, description: ‘local-idle-timeout expired’, connection: Connection { … … …
7|xyz | Amqp client disconnected { Error: read EINVAL
7|xyz | at TLSWrap.onStreamRead (internal/stream_base_commons.js:111:27) errno: 'EINVAL', code: 'EINVAL', syscall: 'read' }
5|xyz | Amqp client disconnected { Error: read EINVAL
5|xyz | at TLSWrap.onStreamRead (internal/stream_base_commons.js:111:27) errno: 'EINVAL', code: 'EINVAL', syscall: 'read' }
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (4 by maintainers)
For others who may come here, because there isn’t a lot of information around AmazonMQ:
If you have a multi-instance broker configuration, only one node is up and running at any given time. There’s no cluster endpoint to redirect traffic to the active node. I just saw today that I get either
ENOTFOUND
orECONNREFUSED
when trying to hit the unavailable node. Using the sample for failover has worked for my team.If you only have a single instance, you may be trying to interact with the broker during a reboot, whether you manually rebooted or you have your instance set up to automatically update at a certain period (AWS will do the reboot for you during that period). A multi-instance setup should update one instance at a time, and using the failover code sample will cause this to be seamless-- so seamless that I didn’t notice for a year. I only noticed now because I’m debugging some other issues and my first node was unavailable.
You can have multiple subscribers all on the same connection. In general I would say use a single connection to a broker unless you have a good reason not to.