Modifies a topic.

Authorization

By default, only Alibaba Cloud accounts can call this operation. RAM users can call this operation only after the RAM users are granted the related permissions. The following table describes the authorization information of this operation. For more information, see Permission policies and examples.

Name Value
API SetTopicAttributes
Action mns:SetTopicAttributes
Item acs:mns:$region:$accountid:/topics/$topicName

Request

A request consists of the following parts:

  • Request line

    PUT /topics/$TopicName?metaoverride=true HTTP/1.1

  • Operation-specific URI parameters

    To modify the parameters of a topic, specify metaoverride=true in the URI.

  • Operation-specific request headers

    None.

  • Request Body

    The request body is in the XML format and contains the following parameters that are used to modify the topic.

    Parameter Type Required Example Description
    MaximumMessageSize Integer No. 65536 The maximum size of a message body that can be sent to the topic.

    Valid values: 1024 to 65536. Unit: bytes.

    Default value: 65536.

    LoggingEnabled Boolean No True Specifies whether to enable the log management feature. Valid values:
    Valid values:
    • True: enables the log management feature.
    • False: disables the log management feature.

    Default value: False.

    If you want to use Terraform to manage alicloud_message_service_topic, configure the parameters. The following table describes the parameters.

    Parameter Type Required Example Description
    MaximumMessageSize Integer No. 65536 The maximum size of a message body that can be sent to the topic.

    Valid values: 1024 to 65536. Unit: bytes.

    Default value: 65536.

    EnableLogging Boolean No True Specifies whether to enable the log management feature.
    Valid values:
    • True: enables the log management feature.
    • False: disables the log management feature.

    Default value: False.

Error message

A response consists of the following parts:

  • HTTP Status Code

    HTTP/1.1 204 No Content

  • Operation-specific response headers

    None.

  • Response Body

    None.

Examples

Sample requests

PUT /topics/$TopicName?metaoverride=true HTTP/1.1
Host: $AccountId.mns.cn-hangzhou.aliyuncs.com
x-mns-version: 2015-06-06
Date: Tue, 08 Dec 2015 06:01:00 GMT
Authorization:MNS 15B4D3461F177624206A:SeIRcZk3lKiP7bl19WB9Uz07****

<?xml version="1.0" encoding="utf-8"?>
<Topic xmlns="http://mns.aliyuncs.com/doc/v1/">
    <MaximumMessageSize>65536</MaximumMessageSize>
    <LoggingEnabled>True</LoggingEnabled>
</Topic>    

Sample responses

HTTP/1.1 204 No Content
x-mns-request-id:5666721CB2B71C9C1600****
x-mns-version: 2015-06-06

Error codes

Error code Error message HTTP status code Description
TopicNotExist The topic you provided does not exist. 404 The error message returned because the topic does not exist. You must create a topic.