Modify queue properties

Last updated: 2020-02-26 15:30:31

Interface description

This API (SetQueueAttributes) is used to modify the attributes of message queues.

  • Domain name requested by public network API: https://cmq-queue-{$region}.api.qcloud.com
  • Domain name requested by private network API: http://cmq-queue-{$region}.api.tencentyun.com

The above {$region} in the domain name needs to be replaced with a specific region : gz (Guangzhou), sh (Shanghai), bj (Beijing), shjr (Shanghai Finance), szjr (Shenzhen Finance), hk (Hong Kong, China), cd (Chengdu), ca (North America), usw (American West), sg (Singapore). The region value in the common parameters should be consistent with the region value of the domain name. If there is any inconsistency, the request will be sent to the region specified by the domain name region based on the region value of the domain name.

  • The queue name cannot be modified.
  • At any time (including during internal testing), if the public network downstream Traffic is generated by using a public network domain name, Traffic and cost will be charged. Therefore, users of the service on Tencent Cloud are strongly recommended to use it. Private network Domain name, private network will not produce Traffic cost.

Input Parameter

The following request parameter list only lists the API request parameters. For other parameters, please see Common Request Parameters page.

Parameter name Required Type Description
QueueName Yes String Queue name, which is unique under the same account in a single region. The queue name is a string of no more than 64 characters, must begin with a letter, and the rest can contain letters, numbers, and dashes (-).
MaxMsgHeapNum No Int Maximum number of heap messages. The range of values during the public test period is 1,000,000 - 10,000,000 The range can be reached after the official Activate 1000,000-1000,000,000 . The default value during public testing is 10,000,000 After Activate, it is officially called 100,000,000 .
PollingWaitSeconds No Int Long-polling Waiting Time for Message Receipt. The value range is 0-30 seconds, and the default value is 0.
VisibilityTimeout No Int Message visibility timed out. Value range: 1-43200 seconds (that is, within 12 hours). The default value is 30.
MaxMsgSize No Int Max Message Length. Value range is 1024-1048576Byte (that is, 1K-1024K), with a default value of 65536.
MsgRetentionSeconds No Int Message retention cycle. Value range: 60-1296000 seconds (1min-15 days), with a default value of 345600 (4 days).
RewindSeconds No Int The longest rewind time of the message. The maximum value range is 0-msgRetentionSeconds, message. The maximum rewind of the message is the preservation period of the message in the queue. 0 means the message rewind is not enabled.

Output Parameter

Parameter name Type Description
Code Int 0: successful. 4440: queue does not exist. The meaning of other return values can be found in Error Codes .
Message String Error message.
RequestId String Request ID generated by the server. When an internal error occurs on the server, the user can submit this ID to Backend Background to locate the problem.
MaxMsgHeapNum Int The maximum number of heap messages after the change.
PollingWaitSeconds Int The changed message receives a long polling wait time.
VisibilityTimeout Int The visibility of the changed message timed out.
MaxMsgSize Int The maximum length of the changed message.
MsgRetentionSeconds Int The changed message life cycle.
RewindSeconds Int The longest news after the change rewind time.

Example

Enter:

Https://domain/v2/index.php?Action=SetQueueAttributes & queueName=test-queue-123 & pollingWaitSeconds=20 & <Common Request Parameters>

Output:

{
"code" : 0,
"message" : "",
"requestId":"14534664555",
"queueId":"queue-ajksdfasdowe",
"maxMsgHeapNum":10000000,
"pollingWaitSeconds":20,
"visibilityTimeout":0,
"maxMsgSize":65536,
"msgRetentionSeconds":345600
}