Yandex Cloud
Search
Contact UsGet started
  • Blog
  • Pricing
  • Documentation
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • ML & AI
    • Business tools
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Customer Stories
    • Gateway to Russia
    • Cloud for Startups
    • Education and Science
  • Blog
  • Pricing
  • Documentation
Yandex project
© 2025 Yandex.Cloud LLC
Yandex Message Queue
    • Quick start
    • Supported tools
  • Access management
  • Pricing policy
  • Terraform reference
  • Monitoring metrics
  • Public materials
  • FAQ
  1. Getting started
  2. Quick start

Getting started with Message Queue

Written by
Yandex Cloud
Improved by
Maxim C.
Updated at March 28, 2025

Let's perform the basic actions using the AWS CLI, one of the tools you can use to work with Message Queue.

  1. Install the AWS CLI, a command line utility for working with Message Queue.

  2. Create a service account with the editor role.

  3. Create static access keys. Save the ID and secret key to a secure location. You will not be able to view the secret key parameters again after you close the window.

  4. Configure the AWS CLI:

    1. Launch the interactive profile setup:

      aws configure
      
    2. Specify the service account key ID you obtained earlier:

      AWS Access Key ID [****************ver_]: <service_account_key_ID>
      
    3. Specify the service account secret key you obtained earlier:

      AWS Secret Access Key [****************w5lb]: <service_account_secret_key>
      
    4. Specify the ru-central1 default region name:

      Default region name [ru-central1]: ru-central1
      
    5. Specify json as the default format for output data:

      Default output format [None]: json
      
    6. To view the current profile settings, run this command:

      aws configure list
      

      Result:

            Name                    Value             Type    Location
            ----                    -----             ----    --------
         profile                <not set>             None    None
      access_key     ****************aBc1 shared-credentials-file
      secret_key     ****************DeF2 shared-credentials-file
          region              ru-central1      config-file    ~/.aws/config
      
  5. Create a queue named sample-queue:

    AWS CLI
    Management console
    aws sqs create-queue \
      --queue-name <queue_name> \
      --endpoint <endpoint>
    

    Where:

    • --queue-name: Name of the new queue, e.g., sample-queue.
    • --endpoint: Endpoint in the https://message-queue.api.cloud.yandex.net/ value.

    Result:

    {
        "QueueUrl": "https://message-queue.api.cloud.yandex.net/aoeaql9r10cd********/000000000000********/sample-queue"
    }
    

    Save the obtained queue URL. You will need it at the next steps.

    1. In the management console, select the folder to create the queue in.

    2. Select Message Queue.

    3. Click Create queue.

    4. Enter a name for the queue: sample-queue.

      The name may contain lowercase Latin letters, numbers, hyphens, and underscores. The FIFO queue name must end with the .fifo suffix. The name may not be longer than 80 characters.

    5. Select the Standard type. Do not change other settings.

    6. Click Create.

    7. Open the queue you created.

    8. In the Overview tab, under General information, copy the queue URL as you will need it later.

  6. Send a message to the created queue using the saved queue URL:

    AWS CLI
    aws sqs send-message \
      --message-body "<message_text>" \
      --endpoint <endpoint> \
      --queue-url <queue_URL>
    

    Where:

    • --message-body: Text of the message you want to send to the queue, e.g., Hello World.
    • --endpoint: Endpoint in the https://message-queue.api.cloud.yandex.net/ value.
    • --queue-url: URL of the queue the message will be sent to.

    Result:

    {
        "MD5OfMessageBody": "67e63db14341b5a696596634********",
        "MessageId": "765ff4d2-fa4bc83-6cfcc***-*****"
    }
    
  7. Accept the message from the queue:

    AWS CLI
    aws sqs receive-message \
      --endpoint <endpoint> \
      --queue-url <queue_URL>
    

    Where:

    • --endpoint: Endpoint in the https://message-queue.api.cloud.yandex.net/ value.
    • --queue-url: URL of the queue to receive the message from.

    Result:

    {
        "Messages": [
            {
                "MessageId": "948de7-9ec8d787-c*******-*",
                "ReceiptHandle": "EAEggbj********",
                "MD5OfBody": "ed076287532e86365e841e92********",
                "Body": "Hello World",
                "Attributes": {
                    "ApproximateFirstReceiveTimestamp": "15459********",
                    "ApproximateReceiveCount": "1",
                    "SentTimestamp": "15459********",
                    "SenderId": "abcdefkbh72is78********"
                }
            }
        ]
    }
    

    Save the ReceiptHandle parameter value. You will need it at the next steps.

  8. Delete the message from the queue.

    After messages are processed, they should be deleted from the queue for applications not to process them again.

    To delete a message received from the queue, use the ReceiptHandle parameter value you saved earlier:

    AWS CLI
    aws sqs delete-message \
      --endpoint <endpoint> \
      --queue-url <queue_URL>
      --receipt-handle <receipt_ID>
    

    Where:

    • --endpoint: Endpoint in the https://message-queue.api.cloud.yandex.net/ value.
    • --queue-url: URL of the queue to delete the message from.
    • --receipt-handle: Previously saved message receipt ID (ReceiptHandle).
  9. Delete the queue:

    AWS CLI
    Management console
    aws sqs delete-queue \
      --endpoint <endpoint> \
      --queue-url <queue_URL>
    

    Where:

    • --endpoint: Endpoint in the https://message-queue.api.cloud.yandex.net/ value.
    • --queue-url: URL of the queue you need to delete.
    1. In the management console, select the folder the queue belongs to.
    2. Select Message Queue.
    3. Click next to the appropriate queue and select Delete.
    4. In the window that opens, click Delete.

Was the article helpful?

Next
Supported tools
Yandex project
© 2025 Yandex.Cloud LLC