Yandex Cloud
Search
Discuss with expertTry it for free
  • Customer Stories
  • Documentation
  • Blog
  • All Services
    • Cloud Interconnect
    • Cloud Backup
    • Cloud Registry
    • Yandex AI Studio
    • Compute Cloud
    • Object Storage
    • Managed Service for Kubernetes®
    • Yandex BareMetal
    • Smart Web Security
    • Security Deck
    • Managed Service for PostgreSQL
    • Managed Service for ClickHouse®
    • Monium
    • Cloud CDN
    • Network Load Balancer
    • Virtual Private Cloud
    • Cloud DNS
    • Application Load Balancer
    • Yandex Cloud Video
    • Stackland
    • Yandex Cloud Router
    • Yandex Managed Service for Trino
    • Managed Service for MySQL®
    • Managed Service for Valkey™
    • Managed Service for Apache Spark™
    • Yandex StoreDoc
    • Managed Service for OpenSearch
    • Managed Service for Apache Kafka®
    • Data Transfer
    • Yandex MPP Analytics Engine for PostgreSQL
    • Yandex Managed Service for Apache Airflow®
    • Data Processing
    • Yandex MetaData Hub
    • Managed Service for YDB
    • Managed Service for Sharded PostgreSQL
    • Managed Service for YTsaurus
    • Yandex WebSQL
    • DataLens
    • Yandex Search API
    • SpeechSense
    • SpeechKit
    • DataSphere
    • Vision OCR
    • Translate
    • Yandex Identity Hub
    • Key Management Service
    • Certificate Manager
    • Yandex Lockbox
    • Audit Trails
    • SmartCaptcha
    • Cloud Desktop
    • Yandex SIEM
    • SourceCraft Code Assistant
    • Container Registry
    • Managed Service for GitLab
    • Managed Service for Prometheus®
    • Cloud Functions
    • API Gateway
    • Yandex Cloud Postbox
    • Message Queue
    • Serverless Integrations
    • IoT Core
    • Data Streams
    • Serverless Containers
    • Cloud Notification Service
    • Yandex Query
    • Identity and Access Management
    • Yandex Cloud Console
    • Resource Manager
    • Yandex Cloud Billing
    • Yandex Cloud Quota Manager
    • Cloud Apps
  • System Status
  • Marketplace
    • Featured
    • Infrastructure & Network
    • Data Platform
    • AI for business
    • Security
    • DevOps tools
    • Serverless
    • Monitoring & Resources
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Start testing with double trial credits
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Center for Technologies and Society
    • Yandex Cloud Partner program
    • Price calculator
    • Pricing plans
  • Customer Stories
  • Documentation
  • Blog
© 2026 Direct Cursus Technology L.L.C.
Yandex Message Queue
    • Overview
    • Configuring the AWS CLI
    • Creating a new message queue
    • Sending messages
    • Receiving and deleting messages
    • Deleting a message queue
    • Managing queue labels
    • Monitoring processes in queues
  • Access management
  • Pricing policy
  • Terraform reference
  • Audit Trails events
  • Monitoring metrics
  • Public materials
  • FAQ
  1. Step-by-step guides
  2. Receiving and deleting messages

Receiving and deleting messages

Written by
Yandex Cloud
Updated at June 17, 2026
View in Markdown

Messages queued in Message Queue are received by consumers, i.e., components of distributed applications. After messages are received and processed, they should be deleted from the queue.

AWS CLI
  1. Install and configure the AWS CLI.

  2. Create a message queue and send a test message to it.

  3. Receive the message you sent earlier:

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

    Where:

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

    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 value: you will need it later.

    Note

    If there are no messages in the queue, the aws sqs receive-message command will end with no text output to the terminal.

  4. To delete a message from a queue, use the receipt ID: the ReceiptHandle parameter value received together with the message.

    Delete the received message from the queue:

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

    Where:

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

If the delete command is executed successfully, no text is output to the terminal. To check the deletion of the message:

Management console
  1. In the management console, select the folder where you created the message queue.
  2. Navigate to Message Queue.
  3. The current number of enqueued messages is specified in the Messages in queue field.

Was the article helpful?

Previous
Sending messages
Next
Deleting a message queue
© 2026 Direct Cursus Technology L.L.C.