Closed zryenz5w closed 6 months ago
Try setting useQueueUrlAsEndpoint
=false
on the client. It will be possible to use just the queue name in the QueueUrl
field, but I recommend using the full URL.
new SQSClient({
useQueueUrlAsEndpoint: false,
});
We had to add the check and warning because of confusion caused by potential conflict between the endpoint
that can be set on the client, and the host URL of the QueueUrl
field itself. useQueueUrlAsEndpoint: false
avoids the check.
It shouldn't take 500 ms to parse a URL and compare its string value, so I think there's also the variable of AWS Lambda cold vs warm invocation potentially involved here.
Thanks, setting useQueueUrlAsEndpoint: false
seems to help if we continue using queueName
. I also tested queueUrl
again without this setting and it seems to end up with similar times.
Only the case queueName
without useQueueUrlAsEndpoint: false
leads to the TypeError and slows the request down. Maybe considering setting useQueueUrlAsEndpoint
to true
by default (for now) to avoid the breaking change for other users that still uses the queueName
.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.
Checkboxes for prior research
Describe the bug
The SQS service has become slower in the recent releases. Maybe since v3.507.0 because of the middleware-sdk-sqs update.
This is a breaking change for us, we ran in multiple Lambda timeouts because of this.
The middleware-sdk-sqs update also causes a new warning because we use the
queueName
instead of thequeueUrl
:When switching from
queueName
toqueueUrl
the warning disappears and it is still working like before; but the performance issue remains.SDK version number
@aws-sdk/client-sqs@^3.507.0
Which JavaScript Runtime is this issue in?
Node.js
Details of the browser/Node.js/ReactNative version
Node 18
Reproduction Steps
We have a class function that logs before and after the
send
command:Observed Behavior
220 ms for the send command:
559 ms for the send command:
Note: the log between these info logs is the TypeError warning described above
Expected Behavior
Setting the sdk version back to v3.504.0 and it seems to work as expected.
11 ms for the send command:
Possible Solution
No response
Additional Information/Context
No response