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

docs(supplemental-docs): add documentation for using queue names with… #6337

Merged
merged 1 commit into from
Jul 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 27 additions & 1 deletion supplemental-docs/CLIENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -618,4 +618,30 @@ new S3Client({

### SQS

TODO e.g. `useQueueUrlAsEndpoint`
#### Using Queue Names with SQS Client

When using the SQS client, set the `useQueueUrlAsEndpoint` configuration to `false` to allow for providing the `QueueUrl` parameter as a queue name rather than a full queue URL.

```js
import { SQSClient, SendMessageCommand } from "@aws-sdk/client-sqs";

const sqs = new SQSClient({
region: "us-east-1",
useQueueUrlAsEndpoint: false,
});

const QueueName = "foo"; // directly use the queue name
// const QueueUrl = "https://sqs.us-east-1.amazonaws.com/123456789012/foo"; // full URL for reference

try {
await sqs.send(
new SendMessageCommand({
QueueUrl: QueueName,
MessageBody: "Sample message",
})
);
console.log("message sent successfully");
} catch (error) {
console.log("SendMessage Failure", error);
}
```
Loading