Save the date Explore sessions covering OpenTelemetry, Prometheus, & Loki, discover Grafana 12’s latest features, and more.
Save the dateProducts
LGTM+ Stack
Key Capabilities
Observability Solutions
IRM
Deploy The Stack
Open Source
Community resources
Dashboard templates
Try out and share prebuilt visualizations
Prometheus exporters
Get your metrics into Prometheus quickly
end-to-end solutions
Opinionated solutions that help you get there easier and faster
monitor infrastructure
Out-of-the-box KPIs, dashboards, and alerts for observability
visualize any data
Instantly connect all your data sources to Grafana
Learn
Stay up to date
Technical learning
Docs
Get started
Get started with Grafana
Build your first dashboard
Get started with Grafana Cloud
Learning Journeys
What's new / Release notes
Help build the future of open source observability software Open positions
Check out the open source projects we support Downloads
Deploy The Stack
end-to-end solutions
Opinionated solutions that help you get there easier and faster
visualize any data
Instantly connect all your data sources to Grafana
SQSClient.deleteMessage(queueUrl, receiptHandle)
deletes a message from the specified Amazon Simple Queue Service (SQS) queue.
Name | Type | Description |
---|---|---|
queueUrl | string | The URL of the Amazon SQS queue from which messages are deleted. Queue URLs and names are case-sensitive. |
receiptHandle | string | The receipt handle associated with the message to delete. The receipt handle is returned when you receive a message using receiveMessages . |
Type | Description |
---|---|
Promise | A Promise that fulfills when the message is successfully deleted. |
import exec from 'k6/execution';
import {
AWSConfig,
SQSClient,
} from 'https://jslib.k6.io/aws/0.14.0/sqs.js';
const awsConfig = new AWSConfig({
region: __ENV.AWS_REGION,
accessKeyId: __ENV.AWS_ACCESS_KEY_ID,
secretAccessKey: __ENV.AWS_SECRET_ACCESS_KEY,
sessionToken: __ENV.AWS_SESSION_TOKEN,
});
const sqs = new SQSClient(awsConfig);
const testQueue = 'https://sqs.us-east-1.amazonaws.com/000000000/test-queue';
export default async function () {
// If our test queue does not exist, abort the execution.
const queuesResponse = await sqs.listQueues();
if (queuesResponse.urls.filter((q) => q === testQueue).length == 0) {
exec.test.abort();
}
// Send a message to the queue
await sqs.sendMessage(testQueue, JSON.stringify({ value: '123' }));
// Receive messages from the queue
const messages = await sqs.receiveMessages(testQueue);
// Delete each received message
for (const message of messages) {
console.log('Deleting message:', message.messageId);
await sqs.deleteMessage(testQueue, message.receiptHandle);
}
}