Deletes a specified topic within your account.

Usage notes

You can call this operation when you need to recycle resources. For example, when applications are deleted, you need to recycle relevant resources.

After a topic is deleted, the backend of Message Queue for Apache RocketMQ recycles resources of the topic. This process is time-consuming. Therefore, we recommend that you do not create a topic immediately after you delete one. If a topic fails to be deleted, troubleshoot the issue based on the returned error code.

Note The operation to delete a topic results in the cleanup of all subscriptions under the topic. Proceed with caution.

QPS limit

The queries-per-second (QPS) limit on this operation is 1 per user. Throttling is triggered when the number of calls to this operation per second exceeds the QPS limit. Throttling may affect your business. Therefore, call this operation based on your needs. For more information, see QPS limits.

Authorization information

By default, only Alibaba Cloud accounts can call this operation. RAM users can call this operation only after they are authorized to use it. The following table lists the authorization information of this operation. For more information, see Policies and examples.



Resource (with namespace)

Resource (without namespace)





Request parameters

Parameter Type Required Example Description
Action String Yes OnsTopicDelete

The operation that you want to perform. Set the value to OnsTopicDelete.

InstanceId String Yes MQ_INST_188077086902****_BXSuW61e

The ID of the instance from which you want to delete the topic.

Topic String Yes test

The name of the topic that you want to delete.

Response parameters

Parameter Type Example Description
RequestId String 4189D4A6-231A-4028-8D89-F66A76C1****

The ID of the request, which is a common parameter. Each request has a unique ID to facilitate troubleshooting and fault locating.

Operations in the console

In addition to calling the OnsTopicDelete operation, you can delete a topic in the Message Queue for Apache RocketMQ console. For more information, see Manage topics.


Sample requests

http(s):// Action=OnsTopicDelete
&<Common request parameters>

Sample success responses

XML format


JSON format

    "RequestId": "4189D4A6-231A-4028-8D89-F66A76C1****"

Error codes

For a list of error codes, visit the API Error Center.