bbc / sqs-consumer

Build Amazon Simple Queue Service (SQS) based applications without the boilerplate
https://bbc.github.io/sqs-consumer/
Other
1.72k stars 331 forks source link

[Bug]: Using @aws-sdk/client-sqs": "3.53.0" throws error #356

Closed kirrg001 closed 1 year ago

kirrg001 commented 1 year ago

Describe the bug

"sqs-consumer": "6.2.0"
"@aws-sdk/client-sqs": "3.53.0"

When using a different version of @aws-sdk/client-sqs in my app to send a message, the sqs-consumer throws the following error:

SQSError: SQS receive message failed: config.endpointProvider is not set. at toSQSError (nodejs/node_modules/sqs-consumer/dist/errors.js:40:22) at Consumer.receiveMessage (nodejs/node_modules/sqs-consumer/dist/consumer.js:149:43)

cat node_modules/sqs-consumer/node_modules/@aws-sdk/client-sqs/package.json 3.256.0

I guess the versions are not compatible? But they should be or because it's the same major version?

Your minimal, reproducible example

Install latest version of @aws-sdk/client-sqs in your app, send a message with this sdk version and receive the message in a different process with sqs-consumer@latest.

Steps to reproduce

Described above :)

Expected behavior

Expected that it does not throw the error.

How often does this bug happen?

None

Screenshots or Videos

No response

Platform

osx monterey

Package version

6.2.0

AWS SDK version

3.53.0

Additional context

No response

nicholasgriffintn commented 1 year ago

We have only tested this with 3.241.0 so far so we'll have to look into the reason for that, it's possible that AWS SDK requires a new option but I have not seen that before.

nicholasgriffintn commented 1 year ago

Hmm, so I've just updated sqs-consumer and sqs-producer to the latest versions available and they both appear to be working on the latest version of aws-sdk 3.253.0 and then to 3.258.0, we have integration tests that are passing so I don't appear to be able to find the issue here.

Do you have options.sqs configured in your implementation?

It's possible that there's something in that that's causing the error, or I just haven't looked hard enough yet.

kirrg001 commented 1 year ago

I am not using sqs-producer. I am using the client lib from @aws-sdk/client-sqs@3.53.0.

const awsSdk3 = require('@aws-sdk/client-sqs');
const sqs = new awsSdk3.SQSClient({ region: awsRegion });
await sqs.send(command);
nicholasgriffintn commented 1 year ago

An update: Sorry I've been out and about recently and didn't get a notification for this reply, or it was buried, apologies for that.

I'm still trying to understand the issue, from the code provided, and my own tests, theoretically this should work perfectly fine, I'll do some further investigation though to see if I can find out more.

nicholasgriffintn commented 1 year ago

Not been able to find the reason for this and it doesn't appear to be an issue elsewhere, so I'm afraid I can only really close this issue.

If you'd like to continue the conversation then please raise a discussion, outside of that, I don't think there's much that we can do here, sorry.