question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Amqp connection drop sometimes and not reconnect.

See original GitHub issue

Hi, 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:closed
  • Created 4 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
ps2goatcommented, Sep 12, 2019

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 or ECONNREFUSED 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.

1reaction
grscommented, Aug 20, 2019

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Reconnect missing when broker closes connection gracefully #8
This happens if you e.g. manually shutdown the RabbitMQ server. The underlying amqplib then generates a CONNECTION_FORCED error and emits a close event...
Read more >
Troubleshooting Network Connectivity - RabbitMQ
Troubleshooting Network Connectivity. Overview. This guide accompanies the one on networking and focuses on troubleshooting of network connections.
Read more >
RabbitMQ connections dropping and not recovering despite ...
This problem seems to occur after running for a few days and by restarting our application it seems to connect and work fine...
Read more >
Clients routinely disconnected and automatically reconnected
We routinely (several times a day nominally) receive callbacks into the Java client and .Net client that indicate that connection was dropped by...
Read more >
13 Common RabbitMQ Mistakes and How to Avoid Them
Don't open a channel each time you are publishing. If you can't have long-lived connections, then make sure to gracefully close the connection....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found