Skip to content
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

Connection to SQS does not recover? #9

Open
thehappycoder opened this issue Mar 1, 2021 · 5 comments
Open

Connection to SQS does not recover? #9

thehappycoder opened this issue Mar 1, 2021 · 5 comments

Comments

@thehappycoder
Copy link

After an app loses connection with SQS, it's unable to recover it once the Internet connection is back.

I've noticed this when I left my app running on my laptop overnight (with wifi off) and opened it in the morning to find this:

Error   01/03/2021, 22:00:18 /Users/anton/projects/****/tail/node_modules/sqs-consumer/dist/consumer.js:45
    const sqsError = new errors_1.SQSError(message);
                     ^ - {"stack":[null]}
Error   01/03/2021, 22:00:18 SQSError: SQS receive message failed: Inaccessible host: `sqs.ap-southeast-2.amazonaws.com'. This service may not be available in the `ap-southeast-2' region.
    at toSQSError (/Users/anton/projects/****/tail/node_modules/sqs-consumer/dist/consumer.js:45:22)
    at Consumer.receiveMessage (/Users/anton/projects/****/tail/node_modules/sqs-consumer/dist/consumer.js:155:19)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:94:5) - {"stack":[null]}

This is fine but when the wifi is back on, and I push events to the queue, the app doesn't seem to be consuming anything.

@spaquis
Copy link

spaquis commented Jun 4, 2021

Hi @thehappycoder ,
I have the same problem, did you find a solution to ensure that the connection is retablished ?

@adamr2
Copy link

adamr2 commented Feb 24, 2022

Same problem, any quick resolutions available?

@jyustman
Copy link

Make sure you have an @SqsConsumerEventHandler("queue_name", "error") handler. The default EventEmitter behavior when there isn't an error listener is rather extreme -- the process exits:

If an EventEmitter does not have at least one listener registered for the 'error' event, and an 'error' event is emitted, the error is thrown, a stack trace is printed, and the Node.js process exits.
Source: https://nodejs.org/api/events.html#error-events

@gaurav1999
Copy link

The param name is confusing for this decorator, should be queueName.

@JacobJohansen
Copy link

please see issue #42 -- if the promise doesn't resolve it will deadlock until reboot. there needs to be a TTL that will force reset the loop

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants