tencent cloud

Migration Guide for TencentCloud API Operations Related to RocketMQ 4.x Cluster Roles
Last updated:2026-01-23 17:36:45
Migration Guide for TencentCloud API Operations Related to RocketMQ 4.x Cluster Roles
Last updated: 2026-01-23 17:36:45

Background

Due to historical reasons, certain TencentCloud API operations were shared among sub-products under the TDMQ product family. For example, some historical clusters of TDMQ for Apache Pulsar and TDMQ for RocketMQ shared role-related TencentCloud API operations. To achieve permission isolation at the finest granularity, TDMQ for RocketMQ introduced dedicated role management APIs. Customers who use these legacy shared TencentCloud API operations will be notified separately by TDMQ for RocketMQ.
This document guides customers on migrating legacy shared TencentCloud API operations. You may ignore this document if you do not use the legacy shared TencentCloud API operations listed below.

Related API Operations

Legacy Shared API Name
Description
New API
CreateRole
Creates a role.
CreateRocketMQRole
DeleteRoles
Deletes roles.
DeleteRocketMQRoles
DescribeRoles
Obtains a list of roles.
DescribeRocketMQRoles
ModifyRole
Modifies a role.
ModifyRocketMQRole
ModifyEnvironmentRole
Modifies an environment role for authorization.
ModifyRocketMQEnvironmentRole
CreateEnvironmentRole
Creates an environment role for authorization.
CreateRocketMQEnvironmentRole
DescribeEnvironmentRoles
Obtains a list of namespace roles.
DescribeRocketMQEnvironmentRoles
DeleteEnvironmentRoles
Deletes an environment role for authorization.
DeleteRocketMQEnvironmentRoles
DescribeMsgTrace
Queries the message trace.
DescribeRocketMQMsgTrace
ModifyVipInstanceState
Modifies the status of an exclusive instance.
ModifyRocketMQVipInstanceState
DescribeAppIdStats
Obtains the user information.
DescribeRocketMQAppIdStats

Migration Sample Code

Migration typically involves only changing the instantiated request object to the corresponding RocketMQ-specific object. The following example shows migrating from the CreateRole API to the CreateRocketMQRole API using the SDK in Java.

Legacy API Access

package com.tencent;

import com.tencentcloudapi.common.Credential; import com.tencentcloudapi.common.profile.ClientProfile; import com.tencentcloudapi.common.profile.HttpProfile; import com.tencentcloudapi.common.exception.TencentCloudSDKException; import com.tencentcloudapi.tdmq.v20200217.TdmqClient; import com.tencentcloudapi.tdmq.v20200217.models.*; public class Sample { public static void main(String [] args) { try{ // Instantiate an authentication object. Enter the SecretId and SecretKey of your Tencent Cloud account. Keep your key pair confidential. // You can obtain the key information at https://console.tencentcloud.com/cam/capi. Credential cred = new Credential("", ""); // Instantiate an HTTP option. This is optional and can be skipped if there are no special requirements. HttpProfile httpProfile = new HttpProfile(); // PolarisMesh is recommended. For related guidance, visit the following link: // https://git.woa.com/tencentcloud-internal/tencentcloud-sdk-java#%E5%8C%97%E6%9E%81%E6%98%9F httpProfile.setEndpoint("tdmq.ap-guangzhou.tencentcloudapi.woa.com"); // Instantiate a client option. This is optional and can be skipped if there are no special requirements. ClientProfile clientProfile = new ClientProfile(); clientProfile.setHttpProfile(httpProfile); // Instantiate the client object for the requested product. clientProfile is optional. TdmqClient client = new TdmqClient(cred, "", clientProfile); // Instantiate a request object. Each API corresponds to a request object. CreateRoleRequest req = new CreateRoleRequest(); // The returned resp is an instance of CreateRoleResponse, corresponding to the request object. CreateRoleResponse resp = client.CreateRole(req); // Output the response package in JSON string format. System.out.println(resp); } catch (TencentCloudSDKException e) { System.out.println(e.toString()); } } }

New API Access

package com.tencent; import com.tencentcloudapi.common.Credential; import com.tencentcloudapi.common.profile.ClientProfile; import com.tencentcloudapi.common.profile.HttpProfile; import com.tencentcloudapi.common.exception.TencentCloudSDKException; import com.tencentcloudapi.tdmq.v20200217.TdmqClient; import com.tencentcloudapi.tdmq.v20200217.models.*; public class Sample { public static void main(String [] args) { try{ // Instantiate an authentication object. Enter the SecretId and SecretKey of your Tencent Cloud account. Keep your key pair confidential. // You can obtain the key information at https://console.tencentcloud.com/cam/capi. Credential cred = new Credential("", ""); // Instantiate an HTTP option. This is optional and can be skipped if there are no special requirements. HttpProfile httpProfile = new HttpProfile(); // PolarisMesh is recommended. For related guidance, visit the following link: // https://git.woa.com/tencentcloud-internal/tencentcloud-sdk-java#%E5%8C%97%E6%9E%81%E6%98%9F httpProfile.setEndpoint("tdmq.ap-guangzhou.tencentcloudapi.woa.com"); // Instantiate a client option. This is optional and can be skipped if there are no special requirements. ClientProfile clientProfile = new ClientProfile(); clientProfile.setHttpProfile(httpProfile); // Instantiate the client object for the requested product. clientProfile is optional. TdmqClient client = new TdmqClient(cred, "", clientProfile); // Instantiate a request object. Each API corresponds to a request object. CreateRocketMQRoleRequest req = new CreateRocketMQRoleRequest(); // The returned resp is an instance of CreateRocketMQRoleResponse, corresponding to the request object. CreateRocketMQRoleResponse resp = client.CreateRocketMQRole(req); // Output the response package in JSON string format. System.out.println(resp); } catch (TencentCloudSDKException e) { System.out.println(e.toString()); } } }




Was this page helpful?
You can also Contact Sales or Submit a Ticket for help.
Yes
No

Feedback