NavigationContentFooter
Jump toSuggest an edit

How to create and manage SQS queues

Reviewed on 01 February 2024Published on 11 August 2022

This page shows how to create and manage SQS queues with Scaleway Messaging and Queuing. Note that queues cannot be created via the console or Scaleway API for SNS or NATS, only for SQS.

Before you start

To complete the actions presented below, you must have:

  • A Scaleway account logged into the console
  • Owner status or IAM permissions allowing you to perform actions in the intended Organization
  • Activated SQS for the region in which you want to create a queue

How to create a queue

  1. Click Messaging in the Serverless section of the Scaleway console side menu. The list of Messaging and Queuing protocols displays.

  2. Use the drop-down menu to select the region in which you want to create a queue.

  3. Click SQS, then Create queue. The queue creation wizard displays.

  4. Check the region that your queue will be created in. If you want to change the region, go back to step 2.

  5. Enter a name for your queue. The name must be no more than 80 characters, and consist only of alphanumeric characters, hyphens, and underscores. Alternatively, you can go with the auto-generated name suggested for you.

  6. Choose your queue type, from one of the following:

    • Standard: Standard queues ensure at-least-once delivery. The exact order of messages in the queue is not preserved.
    • FIFO: FIFO queues (First In First Out) preserves the exact ordering of messages.
  7. Configure your queue’s parameters. The following parameters can be defined:

    • Visibility timeout: The length of time (in seconds) during which, after a message is received, it is hidden and cannot be received again by the same or other consumers. This is useful as the queue itself does not automatically delete messages once they are received, and so prevents consumers from receiving the same message many times before they have finished processing it. Therefore, the value set here should be informed by the expected length of time it will take consumers to process messages. The default value is 30 seconds. The value must be between 1 second and 43 200 seconds (12 hours).
    • Message retention period: The length of time (in seconds) that messages are kept in the queue before being deleted. Setting a longer message retention period allows for a longer interval between a message being sent and it being received. The default value is 60 seconds. The value must be between 60 seconds and 1 290 600 seconds (14 days).
    • Maximum message size: The maximum size (in kilobytes) of a message that can be sent to the queue. Messages greater than the defined size will be rejected. The default value is 256 KB. The value must be between 1 KB and 256 KB.
    • Content Based Deduplication: This setting is only available for FIFO queues. Enable content based deduplication if the message body is guaranteed to be unique for each message. A unique hash value is generated from the body of each message, which is used as its deduplication ID. This avoids the need to set a deduplication ID when sending messages.
  8. Click Create queue to finish.

You are returned to the Queues tab, where your newly-created queue now displays. The queue’s URL is also displayed here, for use in your API/CLI operations.

Go further by clicking on the queue’s name to access its Settings page and see additional information such as its ARN (Amazon Resource Name) and configuration parameters.

Tip

Remember that you need to create credentials in order to access your SQS service and its queues from an API or CLI. Sending messages to queues requires that credentials have the can_publish permission, while receiving messages from queues requires the can_receive permission. You can create separate credentials if you need to isolate these two roles in your application.

How to modify a queue’s configuration

You can modify the visibility timeout, message retention period and maximum message size of a queue after creation. You can also modify the content based deduplication settings for FIFO queues. However, you cannot change a queue’s name or type after creation.

  1. Click Messaging in the Serverless section of the Scaleway console side menu. The list of Messaging and Queuing protocols displays.

  2. Use the drop-down menu to select the region of the queue you want to configure.

  3. Click SQS. The list of your queues in the pre-selected region displays.

  4. Click the queue you wish to modify. The queue’s Settings page displays:

  5. Modify the visibility timeout, message retention period, maximum message size, and (for FIFO queues) Content Based Deduplication values as you wish.

  6. Click Save.

How to purge a queue of messages

You can use the Purge feature to delete all messages from a queue.

  1. Click Messaging in the Serverless section of the Scaleway console side menu. The list of Messaging and Queuing protocols displays.

  2. Use the drop-down menu to select the region of the queue you want to purge.

  3. Click SQS. The list of your queues in the pre-selected region displays.

  4. Either:

    • Click the queue you wish to purge. The queue’s Settings page displays. Click the Purge button in the top right corner.
    • Click the «See more Icon» icon next to the queue you wish to purge, then select Purge from the menu that displays.

    A pop-up asks you to confirm that you understand this action will delete all your queued messages.

  5. Type PURGE and click Purge queue.

How to delete a queue

When you no longer want a queue, you can delete it. This action is irreversible and deletes the queue along with any queued messages.

  1. Click Messaging in the Serverless section of the Scaleway console side menu. The list of Messaging and Queuing protocols displays.

  2. Use the drop-down menu to select the region of the queue you want to delete.

  3. Click SQS. The list of your queues in the pre-selected region displays.

  4. Either:

    • Click the queue you wish to delete. The queue’s Settings page displays. Click the Delete queue button in the bottom right corner.
    • Click the «See more Icon» icon next to the queue you wish to delete, then select Delete from the menu that displays.

    A pop-up asks you to confirm that you understand this action will delete the queue and all your queued messages.

  5. Type DELETE and click Delete queue.

See also
How to manage credentialsHow to create and manage topics
Docs APIScaleway consoleDedibox consoleScaleway LearningScaleway.comPricingBlogCarreer
© 2023-2024 – Scaleway