Jump toUpdate content

Messaging and Queuing - Quickstart

Published on 29 August 2022

Scaleway Messaging and Queuing is a message broker tool that allows you to transfer messages between different microservices and platforms. This enables them to “talk” to each other effectively even if they are not otherwise compatible. Messaging and Queuing enables and simplifies microservices application development and allows you to build highly scalable, reliable, distributed applications.

To get started with Scaleway Messaging and Queuing, you need to create a namespace and generate its credentials. You can then use any supported SDK or CLI of your choice to start creating and managing queues, topics and messages. When you no longer need your namespace, you can delete it.

Identity and Access Management (IAM):

If you have activated IAM, 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
Requirements:

How to create a namespace

A namespace sets a scope for your queues, topics and credentials. For each namespace, you can generate one or multiple sets of credentials, which allow the bearer to perform actions within that namespace, dependent on their access rights. Actions could include creating topics or queues, publishing messages, reading messages etc. Namespaces therefore allow you to isolate queues and topics from each other, as credentials only give access to queues and topics within that namespace.

Two types of namespaces are available: NATS and SNS/SQS. The type of namespace that you choose determines the messaging system used to distribute and queue your messages.

  1. Click Messaging in the Serverless section of the side menu. The Messaging and Queuing namespace creation page displays.

  2. Click Create a namespace. The namespace creation wizard displays.

  3. Complete the following steps in the wizard:

    • Choose a region, which is the geographical region in which your namespace will be created.
    • Choose a namespace type. The namespace type determines the message system used to distribute and queue your messages. Currently, two types are available:
      • NATS: Choose this namespace type if you want to use the NATS messaging system. When you later create credentials, they will be scoped at the namespace level and give full access to all streams related to the namespace.
      • SQS/SNS: Choose this namespace type if you want to use the SQS and/or SNS messaging systems. When you later create credentials, they will be scoped at the namespace level and you can select the required level of access (read/write/manage) for each set of credentials.
    • Choose a name for your namespace, or use the randomly-generated name suggested.
  4. Click Create a namespace to finish.

    Your namespace is created. You are taken to the list of all your namespaces, where your newly-created namespace now appears.

How to generate credentials

Credentials give their bearer (e.g. services and platforms) access to your namespace. The process of creating credentials differs depending on the namespace type (NATS or SQS/SNS).

You can create multiple sets of credentials for each namespace.

How to create credentials for a NATS namespace

Credentials for NATS namespaces are not granular: they necessarily give full read and write access to the namespace. The bearer of these credentials can publish and receive messages, as well as manage topics and streams.

  1. Click Messaging in the Serverless section of the side menu. The list of your Messaging and Queuing namespaces displays.

  2. Click the NATS namespace you wish to create credentials for. The namespace’s Overview page displays.

  3. In the Credentials panel, click Generate credentials. A pop-up displays.

  4. Enter a name for these credentials, and click Generate credentials.

    The credentials are created and a button displays prompting you to download them in a .creds file.

    Important:

    This is your only chance to download these credentials.

  5. Click Download and save the file, before closing the window.

    You are returned to your namespace’s overview page. The name of your newly-generated credentials and their access level is displayed in the Credentials tab.

How to create credentials for an SQS/SNS namespace

Credentials for SQS/SNS namespaces are granular: you can define the level of access that they should give.

  1. Click Messaging in the Serverless section of the side menu. The list of your Messaging and Queuing namespaces displays.

  2. Click the SQS/SNS namespace you wish to create credentials for. The namespace’s Overview page displays.

  3. In the Credentials panel, click Generate credentials. A pop-up displays.

  4. Enter a name for these credentials.

  5. Select the required permissions for the credentials. You must choose at least one of Write, Read and Manage. You are free to select any combination of these permissions.

  6. Click Generate credentials.

    The credentials are created. The access key and secret key are displayed, and you are invited to copy them.

    Important:

    This is your only chance to view and save the secret key. Make sure that you copy it and save it somewhere securely.

  7. Copy and save the credentials, before closing the window.

    You are returned to your namespace’s overview page. The name of your newly-generated credentials, along with the access key and access level are displayed in the Credentials tab.

How to create and manage queues, topics, messages and more

All further actions related to publishing, processing and managing messages, subjects, queues and streams can be done via a supported CLI or SDK. See our documentation on NATS CLI and SDKs and SNS/SQS CLI and SDKs for more information.

How to delete a namespace

  1. Click Messaging in the Serverless section of the side menu. The list of your Messaging and Queuing namespaces displays.

  2. Click the «See more Icon» button next to the namespace you want to update. A menu displays.

  3. Select Delete. A popup displays.

    Important:

    Deleting a namespace is irreversible. Any URLs, credentials and queued messages belonging to this namespace will also be deleted.

  4. Type DELETE to confirm, and click Delete namespace.

    Your namespace is deleted. You are returned to your Messaging and Queuing overview page.