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. Sending messages

Sending messages

Written by
Yandex Cloud
Updated at October 28, 2024
View in Markdown

Messages are sent through message queues in Message Queue and may contain plain text in the message body. Consumers get messages and delete them from the queue after receiving and processing them.

To send a message to a queue:

  1. If you do not have a message queue in Message Queue, create one.

  2. Run the following command in the terminal:

    AWS CLI
    cURL
    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***-*****"
    }
    
    curl \
      --request POST \
      --header 'Content-Type: application/x-www-form-urlencoded' \
      --data-urlencode 'Action=SendMessage' \
      --data-urlencode 'MessageBody=<message_text>' \
      --data-urlencode 'QueueUrl=<message_queue_URL>' \
      --user '<access_key_ID>:<secret_key>' \
      --aws-sigv4 'aws:amz:ru-central1:sqs' \
      https://message-queue.api.cloud.yandex.net/
    

    Where:

    • --header: HTTP request headers.
    • --data-urlencode: Parameters for generating an API request.
      • MessageBody: Text of the message you want to send to the queue.
      • QueueURL: URL of the queue the message will be sent to.
    • --user: Static key components (ID and secret key).
    • --aws-sigv4: Parameter for generating AWS-compatible authorization headers.

    Result:

    <?xml version="1.0" encoding="UTF-8"?>
    <SendMessageResponse><SendMessageResult><MD5OfMessageBody>fa46dfdbe2396ac930bfa896********</MD5OfMessageBody><MessageId>31bebd6e-5b61e482-7aaaa45a***-*****</MessageId></SendMessageResult><ResponseMetadata><RequestId>7c65c427-be26a31a-cf93dee9-dd4989d8-ab97b54614e49d7fe560b779********</RequestId></ResponseMetadata></SendMessageResponse>
    

Was the article helpful?

Previous
Creating a new message queue
Next
Receiving and deleting messages
© 2026 Direct Cursus Technology L.L.C.