Configures the read permissions for a consumer group.
Note
You can call this operation to specify whether consumers in a specified consumer group can read messages. You can call this operation in scenarios in which you want to forbid consumers in a specific group from reading messages.
Request limit
Each Alibaba Cloud account can call this operation up to 10 times per second. If the number of requests that you send to call this operation within one second reaches the request limit, new requests fail. This may interrupt your business. For information about the request limit of each operation, see API request limits.
Authorization
By default, Alibaba Cloud accounts can call this operation. A Resource Access Management (RAM) user can call this operation only after the RAM user is granted the required permissions. The following table describes the permissions that must be granted to a RAM user to call this operation. For information about how to grant permissions, see Policies.
API |
Action |
Resource in an instance that uses a namespace |
Resource in an instance that does not use a namespace |
---|---|---|---|
OnsGroupConsumerUpdate |
mq:QueryInstanceBaseInfo mq:UpdateGroupConsumer |
acs:mq:*:*:{instanceId}%{groupId} |
acs:mq:*:*:{groupId} |
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | OnsGroupConsumerUpdate |
The operation that you want to perform. Set the value to OnsGroupConsumerUpdate. |
GroupId | String | Yes | GID_test_groupId |
The ID of the consumer group for which you want to configure the read permissions. |
ReadEnable | Boolean | Yes | true |
Specifies whether to authorize the specified consumer group to read messages. Valid values:
Default value: true. |
InstanceId | String | Yes | MQ_INST_111111111111_DOxxxxxx |
The ID of the Message Queue for Apache RocketMQ instance which contains the specified consumer group. |
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
RequestId | String | A07E3902-B92E-44A6-B6C5-6AA111111**** |
The ID of the request. The system generates a unique ID for each request. You can troubleshoot issues based on the request ID. |
Examples
Sample requests
http(s)://ons.cn-hangzhou.aliyuncs.com/?Action=OnsGroupConsumerUpdate
&GroupId=GID_test_groupId
&InstanceId=MQ_INST_111111111111_DOxxxxxx
&ReadEnable=true
&<Common request parameters>
Sample success responses
XML
format
HTTP/1.1 200 OK
Content-Type:application/xml
<OnsGroupConsumerUpdateResponse>
<RequestId>A07E3902-B92E-44A6-B6C5-6AA111111****</RequestId>
</OnsGroupConsumerUpdateResponse>
JSON
format
HTTP/1.1 200 OK
Content-Type:application/json
{
"RequestId" : "A07E3902-B92E-44A6-B6C5-6AA111111****"
}
Error codes
For a list of error codes, visit the API Error Center.