tencent cloud

Feedback

Deleting Message

Last updated: 2024-01-03 10:20:36

    API Description

    This API is used to delete a consumed message. The consumer needs to use the ReceiptHandle obtained after the last consumption as a parameter to locate the message to be deleted.
    This operation can be successfully performed only before NextVisibleTime. After NextVisibleTime elapses, the message will return to the Active status, and ReceiptHandle will become invalid, making it impossible to delete the message. In this case, the message needs to be consumed again to get a new ReceiptHandle. When a message is consumed by multiple consumers concurrently, if the message is deleted by one of the consumers, other consumers can no longer get it.
    The public/private domain names for API requests can be copied from Queue Service > API Request Address in the TDMQ for CMQ console. A sample address is as follows:
    Public network address: https://cmq-gz.publicXXX.tencenttdmq.com
    Private network address: http://gz.mqadapter.cmq.tencentyun.com
    Note:
    The API call URL varies by region.
    Whenever downstream traffic is generated from using the public domain name, traffic fees will be charged (even during the beta test period). Therefore, we strongly recommend you use the private domain name to avoid traffic fees.

    Input Parameters

    The list below contains only the API request parameters. Other parameters can be found in Common Request Parameters.
    Parameter
    Required
    Type
    Description
    queueName
    Yes
    String
    Queue name, which is unique under the same account in an individual region. It is a string of up to 64 characters, which must begin with a letter and can contain letters, digits, and dashes (-).
    receiptHandle
    Yes
    String
    The unique message handler returned from the last consumption, which is used to delete the message.

    Output Parameters

    Parameter
    Type
    Description
    code
    Int
    0: Success. others: Error. For more information, see Common Error Codes.
    message
    String
    Error message.
    requestId
    String
    Request ID generated by the server, which can be submitted to the backend for troubleshooting when an internal server error occurs.

    Error Codes

    For more information, see Common Error Codes.

    Samples

    Input:
    https://domain/v2/index.php?Action=DeleteMessage &queueName=test-queue-123 &receiptHandle=3423452345 &<<a href="">Common request parameters</a>>
    Output:
    {
    "code" : 0,
    "message" : "",
    "requestId":"14534664555"
    }
    
    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

    7x24 Phone Support