No results for

Powered byAlgolia
The APIs provided by this jslib operate synchronously, which means k6 must wait for operations that use the client classes to finish before proceeding with the rest of the script.

In some cases, such as downloading large files from S3, this could affect performance and test results. To minimize the impact on test performance, we recommend using these operations in thesetup and teardown lifecycle functions. These functions run before and after the test run and thus do not influence test results.

SQSClient interacts with the AWS Simple Queue Service (SQS). With it, the user can send messages to specified queues and list available queues in the current region. SQSClient operations are blocking.

Both the dedicated sqs.js jslib bundle and the all-encompassing aws.js bundle include the SQSClient.


sendMessageDelivers a message to the specified queue.
listQueuesReturns a list of your queues in the current region.


SQSClient methods throw errors in case of failure.

InvalidSignatureErrorwhen using invalid credentials
SQSServiceErrorwhen AWS replied to the requested operation with an error


import exec from 'k6/execution'
import { AWSConfig, SQSClient } from ''
const awsConfig = new AWSConfig({
region: __ENV.AWS_REGION,
sessionToken: __ENV.AWS_SESSION_TOKEN,
const sqs = new SQSClient(awsConfig)
const testQueue = ''
export default function () {
// If our test queue does not exist, abort the execution.
const queuesResponse = sqs.listQueues()
if (queuesResponse.queueUrls.filter((q) => q === testQueue).length == 0) {
// Send message to test queue
sqs.sendMessage(testQueue, JSON.stringify({value: '123'}));