How to create and manage SQS/SNS queues
This page shows how to create and manage queues in a Messaging and Queuing SQS/SNS namespace. Note that queues cannot be created via the console or Scaleway API for a NATS namespace.
You may need certain IAM permissions to carry out some actions described on this page. This means:
- you are the Owner of the Scaleway Organization in which the actions will be carried out, or
- you are an IAM user of the Organization, with a policy granting you the necessary permission sets
- You have an account and are logged into the Scaleway console
- You have created a Messaging and Queuing SQS/SNS namespace
How to create a queue
-
Click Messaging in the Serverless section of the Scaleway console side menu. The list of your Messaging and Queuing namespaces displays.
-
Click the SQS/SNS namespace you wish to create a queue for. The namespace’s Overview page displays.
-
Click the Queues tab. If you have existing queues, they are listed here. Otherwise, the screen below displays:
-
Click the green
+
button to create a new queue. The queue creation wizard displays. -
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.
-
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.
-
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.
-
Click Create queue to finish.
You are returned to the Queues tab, where your newly-created queue now displays. You can view its URL here, for use in your API/CLI operations. Go further by clicking on the queue’s name to access its Overview page and see additional information such as its ARN (Amazon Resource Name) and configuration parameters.
Remember that you need to create credentials in order to access your namespace 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.
-
Click Messaging in the Serverless section of the Scaleway console side menu. The list of your Messaging and Queuing namespaces displays.
-
Click the SQS/SNS namespace containing the queue you wish to modify. The namespace’s Overview page displays.
-
Click the Queues tab.
-
Click the queue you wish to modify. The queue’s Overview page displays:
-
Modify the visibility timeout, message retention period, maximum message size and (for FIFO queues) Content Based Deduplication values as you wish.
-
Click Save.
How to purge a queue of messages
You can use the Purge feature to delete all messages from a queue.
-
Click Messaging in the Serverless section of the Scaleway console side menu. The list of your Messaging and Queuing namespaces displays.
-
Click the SQS/SNS namespace containing the queue you wish to modify. The namespace’s Overview page displays.
-
Click the Queues tab.
-
Either:
- Click the queue you wish to purge. The queue’s Overview 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.
-
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.
-
Click Messaging in the Serverless section of the Scaleway console side menu. The list of your Messaging and Queuing namespaces displays.
-
Click the SQS/SNS namespace containing the queue you wish to modify. The namespace’s Overview page displays.
-
Click the Queues tab.
-
Either:
- Click the queue you wish to delete. The queue’s Overview 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.
-
Type DELETE and click Delete queue.