@@ -571,7 +571,7 @@ In v3, the similar utility function is available in [`@aws-sdk/polly-request-pre
571
571
572
572
## Notes on Specific Service Clients
573
573
574
- ### Lambda
574
+ ### AWS Lambda
575
575
576
576
Lambda invocations response type differs in v3:
577
577
@@ -616,3 +616,42 @@ const region = "...";
616
616
console .log (" Invoke response object" , payloadObject);
617
617
}
618
618
```
619
+
620
+ ### Amazon SQS
621
+
622
+ When using a custom ` QueueUrl ` in SQS operations that have this as an input parameter, in JSv2
623
+ it was possible to supply a custom ` QueueUrl ` which would override the SQS Client's default endpoint.
624
+
625
+ In JSv3, when using a custom endpoint, i.e. one that differs from the default public SQS endpoints, you
626
+ should always set the endpoint on the SQS Client as well as the ` QueueUrl ` field.
627
+
628
+ ``` ts
629
+ import { SQS } from " @aws-sdk/client-sqs" ;
630
+
631
+ const sqs = new SQS ({
632
+ // client endpoint should be specified in JSv3 when not the default public SQS endpoint for your region.
633
+ // This is required for versions <= v3.506.0
634
+ // This is optional but recommended for versions >= v3.507.0 (a warning will be emitted)
635
+ endpoint: " https://my-custom-endpoint:8000/" ,
636
+ });
637
+
638
+ await sqs .sendMessage ({
639
+ QueueUrl: " https://my-custom-endpoint:8000/1234567/MyQueue" ,
640
+ Message: " hello" ,
641
+ });
642
+ ```
643
+
644
+ If you are not using a custom endpoint, then you do not need to set ` endpoint ` on the client.
645
+
646
+ ``` ts
647
+ import { SQS } from " @aws-sdk/client-sqs" ;
648
+
649
+ const sqs = new SQS ({
650
+ region: " us-west-2" ,
651
+ });
652
+
653
+ await sqs .sendMessage ({
654
+ QueueUrl: " https://sqs.us-west-2.amazonaws.com/1234567/MyQueue" ,
655
+ Message: " hello"
656
+ });
657
+ ```
0 commit comments