Amazon Simple Queue Service (SQS)

Amazon SQS is fully managed message queuing for micro-services, distributed systems, and server-less applications. It lets you send, store, and receive messages between software components at any volume, without losing messages or requiring other services to be available.

SQS integration

Description

<sqsIntegration> - command for integration with Amazon SQS

Required parameters:

  1. alias - unique name of the integration (e.g., "MY_SQS")

  2. enabled – a boolean flag to enable/disable integration (can be “true” or “false”)

  3. region - specifies the AWS region for SQS (e.g., "us-west-2")

  4. endpoint - specifies the endpoint or URL for the SQS

  5. accessKeyId - specifies a unique identifier for authentication. (e.g., "DEFAULT_ACCESS_ KEY")

  6. secretAccessKey - specifies secret key for authentication. (e.g., "DEFAULT_SECRET_ KEY")

<sqsIntegration> <sqs alias="MY_SQS" enabled="true"> <region>us-west-2</region> <endpoint>http://localhost:4566</endpoint> <accessKeyId>DEFAULT_ACCESS_KEY</accessKeyId> <secretAccessKey>DEFAULT_SECRET_KEY</secretAccessKey> </sqs> </sqsIntegration>

SQS command

Description

<sqs> – command which is responsible for sending the SQS queries in testing scenarios

Required parameters:

  • comment

  • alias - unique name of the integration

  • commands: send or receive (only one can be selected)

Optional parameters:

  • condition - the condition according to which this test step will or won't be executed

  • threshold - parameter, where the maximum execution time of the command is defined (milliseconds), if the execution time is exceeded, the step will be defined as failed


Send command

<sqs comment="Check ability to create queue and send first text message and json file" alias="SQS_0"> <send queue="queue1" delaySeconds="5" messageDeduplicationId="1" messageGroupId="1"> <value>Hello World!</value> </send> <send queue="queue1" delaySeconds="5"> <file>body_5.json</file> </send> </sqs>

The send command is used to send a message to SQS. The command has arguments:

  • [required] queue - refers to a specific queue within SQS which represents the destination for the message (e.g., “queue1”)

  • [optional] delaySeconds - sets a delay of 5 seconds before the message becomes available for processing (e.g., “5”, min value is “1”)

  • [optional] messageDeduplicationId - unique identifier for message deduplication. It helps to ensure that only one copy of a particular message is processed, even if it is sent multiple times (e.g., “1”)

  • [optional] messageGroupId - used for message grouping within a queue. It allows related messages to be grouped and ensures that they are processed in the correct order (e.g., “1”)

  • value - contains the actual content or payload of the message being sent

  • file - specifies the file containing the body or content of the message being sent


Receive command

<sqs comment="Check ability to receive messages" alias="SQS_0"> <receive queue="queue1"> <file>expected_10.json</file> </receive> <receive queue="queue1" receiveRequestAttemptId="1" maxNumberOfMessages="1" visibilityTimeout="1" waitTimeSeconds="1"> <value> [ "Hello World!" ] </value> </receive> </sqs>

The receive command is used to receive a message from SQS. The command has arguments:

  • [required] queue - specifies the queue from which a message is being received. It indicates the source queue from which the message will be retrieved for processing (e.g., “queue1”)

  • [optional] receiveRequestAttemptId - indicates the request attempt ID associated with the receive operation. It is a unique identifier that helps track and identify the specific attempt made to receive a message from the queue (e.g., “1”)

  • [optional] maxNumberOfMessages - specifies the maximum number of messages to be received in a single receive operation (e.g., ”1”, min value is “1”)

  • [optional] visibilityTimeout - specifies the duration during which the message is invisible to other consumers after it has been received by one consumer (e.g., “1”, min value is “1”)

  • [optional] waitTimeSeconds - specifies the maximum amount of time to wait for a message to become available in the queue if no messages are currently present (e.g., ”1”, min value is “1”)

  • file - specifies the file name that contains the expected content of the received message

  • value - contains the actual content or payload of the received message