Run Amazon SQS FIFO messages

The First-in, First-out (FIFO) queues are designed to ensure that the order in which messages are sent and received is strictly preserved and that each Amazon SQS message is processed exactly once.

The FIFO queue always keeps transactions within an Amazon SQS message group in the order in which they arrived.

To require Amazon SQS messages to be processed, choose one of the following connection types and follow the steps below.

To determine whether a queue is FIFO, check whether Amazon SQS message ends with the fifo file extension.

Methods: Push, Pull and Purge actions.

Option 1 - Run Amazon SQS FIFO messages with a predefined connection

Push messages

To push messages with a predefined Amazon SQS FIFO messages, follow the steps below:

  1. Create a new message.

  2. In the Connection section, go to Manage to create an Amazon SQS connection.

  3. From the Connection drop-down menu, select your connection.

  4. In the Action drop-down menu, select Push. The Endpoint field displays the ARN.

  5. In the Payload field, enter your message.

  6. Click the icon to the right side of the message section. Double-click the respective rows to edit the header value entries for:

    • MessageGroupID: Use this key to specify multiple ordered message groups within a single queue.

    • MessageDeduplicationID: Optionally, use this key to manage deduplication of sent messages.

    For more information on MessageGroupID and MessageDeduplicationID, see the AWS documentation.

  7. Click on Run in the API Scan menu to send your message to the specified queue.

Push Amazon SQS FIFO message in API Scan

Pull messages

To pull messages with a predefined Amazon SQS FIFO message, follow the steps below:

  1. Create a new message.

  2. In the Connection section, go to Manage in order to create an Amazon SQS connection.

  3. From the Connection drop-down menu, select your connection.

  4. In the Action drop-down menu, select Pull. The Endpoint field displays the ARN.

  5. Click the icon to the right side of the message section. Double-click the respective rows to edit the header value entries for:

    • MessageGroupID: Use this key to specify multiple ordered message groups within a single queue.

    • MessageDeduplicationID: Optionally, use this key to manage deduplication of sent messages.

    For more information on MessageGroupID and MessageDeduplicationID, see the AWS documentation.

  6. Click on Run in the API Scan menu to receive your message in the specified queue. Only one message is retrieved at a time. To retrieve multiple messages, create a Loop. See also Amazon SQS Visibility Timeout.

Pull Amazon SQS FIFO message in API Scan

Purge a queue

To purge an Amazon SQS queue with a predefined connection, follow the steps below:

  1. In the Connection section, go to Manage in order to create an Amazon SQS connection.

  2. From the Connection drop-down menu, select your connection.

  3. In the Action drop-down menu, select Purge. The Endpoint field displays the ARN.

  4. Click on Run in the API Scan menu to purge the specified queue. The queue is then cleared of all messages.

Purge Amazon SQS FIFO queue in API Scan

Option 2 - Run Amazon SQS FIFO messages with a non-predefined connection

Push messages

To push messages with a non-predefined Amazon SQS FIFO message, follow the steps below:

  1. Create a new message.

  2. From the Connection drop-down menu, select <explicit>.

  3. In the Endpoint field, copy the Amazon Resource Name (ARN) of your selected SQS FIFO queue from the AWS console in the Details tab.

  4. In the Action drop-down menu, select Push.

  5. In the Auth tab, choose AWS Signature from the Authentication drop-down list and enter Access Key and Secret Key credentials for your AWS account.

  6. Optionally, enter your Session Token in case you have temporary credentials.

  7. Optionally, in case your endpoint does not contain a Region entry, select it from the drop-down menu. The default value is US East (Ohio).

  8. Click the icon to the right side of the message section. Double-click the respective rows to edit the header value entries for:

    • MessageGroupID: Use this key to specify multiple ordered message groups within a single queue.

    • MessageDeduplicationID: Optionally, use this key to manage deduplication of sent messages.

    For more information on MessageGroupID and MessageDeduplicationID, see the AWS documentation.

  9. In the Payload field, enter your message.

  10. Click on Run in the API Scan menu to send your message on the queue to the specified queue.

Push action: Auth tab for Amazon SQS FIFO message in API Scan

Pull messages

To pull messages with a non-predefined Amazon SQS FIFO message, follow the steps below:

  1. Create a new message.

  2. From the Connection drop-down menu, select <explicit>.

  3. In the Endpoint field, copy the Amazon Resource Name (ARN) of your selected SQS FIFO queue from the AWS console in the Details tab.

  4. In the Action drop-down menu, select Pull.

  5. In the Auth tab, choose AWS Signature from the Authentication drop-down list and enter Access Key and Secret Key credentials for your AWS account.

  6. Optionally, enter your Session Token in case you have temporary credentials.

  7. Optionally, in case your endpoint does not contain a Region entry, select it from the drop-down menu. The default value is US East (Ohio).

  8. Click the icon to the right side of the message section. Double-click the respective rows to edit the header value entries for:

    • MessageGroupID: Use this key to specify multiple ordered message groups within a single queue.

    • MessageDeduplicationID: Optionally, use this key to manage deduplication of sent messages.

    For more information on MessageGroupID and MessageDeduplicationID, see the AWS documentation.

  9. Click on Run in the API Scan menu to receive your message in the specified queue. Only one message is retrieved at the time. To retrieve multiple messages, create a Loop. Also see Amazon SQS Visibility Timeout.

Pull action: Auth tab for Amazon SQS FIFO message in API Scan

After running your Amazon SQS FIFO messages in API Scan, you can export them to Tosca Commander. This allows you to use the message information to define Module Attributes and verify their values. Depending on what you want to test, you can export the messages as an API TestCase.

Purge a queue

To purge an Amazon SQS queue with a non-predefined Amazon SQS FIFO message, follow the steps below:

  1. From the Connection drop-down menu, select <explicit>.

  2. In the Endpoint field, copy the Amazon Resource Name (ARN) of your selected SQS FIFO queue from the AWS console in the Details tab.

  3. In the Action drop-down menu, select Purge.

  4. In the Auth tab, choose AWS Signature from the Authentication drop-down list and enter Access Key and Secret Key credentials for your AWS account.

  5. Optionally, enter your Session Token in case you have temporary credentials.

  6. Optionally, select a Region from the drop-down menu. The default value is US East (Ohio).

  7. Click on Run in the API Scan menu to purge the specified queue. The queue is then cleared of all messages.

Purge action: Auth tab for Amazon SQS FIFO message in API Scan