Yandex Cloud
  • Services
  • Solutions
  • Why Yandex Cloud
  • Pricing
  • Documentation
  • Contact us
Get started
Language / Region
© 2022 Yandex.Cloud LLC
Yandex Message Queue
  • Getting started
    • Quick start
    • Supported tools
    • Code samples
      • Node.js
      • PHP
      • JMS
      • Laravel
      • Terraform
  • Step-by-step instructions
    • Overview
    • Creating a new message queue
    • Sending messages
    • Receiving and deleting messages
    • Deleting a message queue
    • Monitoring processes in queues
  • Concepts
    • Overview
    • Message queues
    • Messages
    • Deduplication
    • Visibility timeout
    • Long Polling
    • Dead Letter Queue
    • Delay queues
    • Quotas and limits
  • Practical guidelines
    • Converting a video to a GIF in Python
  • Access management
  • Pricing policy
  • Yandex Message Queue API
    • Overview
    • Queue
      • CreateQueue
      • DeleteQueue
      • GetQueueAttributes
      • GetQueueUrl
      • ListQueues
      • PurgeQueue
      • SetQueueAttributes
    • Message
      • ChangeMessageVisibility
      • ChangeMessageVisibilityBatch
      • DeleteMessage
      • DeleteMessageBatch
      • ReceiveMessage
      • SendMessage
      • SendMessageBatch
    • Data types
      • BatchResultErrorEntry
      • ChangeMessageVisibilityBatchRequestEntry
      • ChangeMessageVisibilityBatchResultEntry
      • DeleteMessageBatchRequestEntry
      • DeleteMessageBatchResultEntry
      • Message
      • MessageAttributeValue
      • SendMessageBatchRequestEntry
      • SendMessageBatchResultEntry
    • Common errors
  • Questions and answers
  1. Yandex Message Queue API
  2. Queue
  3. PurgeQueue

PurgeQueue

Written by
Yandex Cloud
  • Request
    • Request parameters
  • Response
    • Successful response fields
    • PurgeQueue errors
  • Sample request
  • Response example

Method for deleting messages in a queue. It takes some time to delete messages. To make sure no messages are left in the queue, pause sending messages to the queue and call the GetQueueAttributes method.

Messages that were sent to the queue before calling PurgeQueue can be picked by consumers, but will be deleted from the queue within the next minute.

Messages sent to the queue after calling PurgeQueue won't be deleted.

Alert

You cannot retrieve any messages deleted from a queue.

Request

Request parameters

Parameter Type Required parameter Description
QueueUrl string Yes URL of a queue. Case-sensitive.

Response

Successful response fields

The response does not contain any fields.

PurgeQueue errors

For a list of errors common for all methods, see Common errors.

HTTP code Error ID Description
400 NonExistentQueue The specified queue does not exist.
403 PurgeQueueInProgress The PurgeQueue method has already been called for the specified queue within the last 60 seconds.

Sample request

Action=PurgeQueue
&Version=2012-11-05
&QueueUrl=https://message-queue.api.cloud.yandex.net/b1g8ad42m6he1ooql78r/dj600000000000le07ol/sample-queue

For more information about forming requests, see General API request format.

Response example

<PurgeQueueResponse>
    <ResponseMetadata>
        <RequestId>c89ea19f-37d3a529-58142774-e25a26f-2618ff0043df35a802b77c9459dc96c7</RequestId>
    </ResponseMetadata>
</PurgeQueueResponse>

Was the article helpful?

Language / Region
© 2022 Yandex.Cloud LLC
In this article:
  • Request
  • Request parameters
  • Response
  • Successful response fields
  • PurgeQueue errors
  • Sample request
  • Response example