API | Description |
Creates TDMQ for CMQ queue | |
Creates TDMQ for CMQ subscription | |
Creates TDMQ for CMQ topic | |
Deletes TDMQ for CMQ queue | |
Deletes TDMQ for CMQ subscription | |
Deletes TDMQ for CMQ topic | |
Enumerates dead letter source queues in TDMQ for CMQ | |
Queries the details of TDMQ for CMQ queue | |
Queries all TDMQ for CMQ queues | |
Queries the details of TDMQ for CMQ subscription | |
Queries the details of TDMQ for CMQ topic | |
Enumerates all TDMQ for CMQ topics | |
Modifies TDMQ for CMQ queue | |
Modifies TDMQ for CMQ subscription | |
Modifies TDMQ for CMQ topic | |
Rewinds TDMQ for CMQ queue | |
Unbinds TDMQ for CMQ dead letter queue |
Parameter | Description |
QueueName | Queue name, which must be unique under the same account in the same region. It can contain up to 64 letters, digits, and hyphens and must begin with a letter. |
MaxMsgHeapNum | Maximum number of heaped messages. The value range is 1,000,000–10,000,000 during the beta test and can be 1,000,000–1,000,000,000 after the product is officially released. The default value is 10,000,000 during the beta test and will be 100,000,000 after the product is officially released. |
PollingWaitSeconds | Long polling wait time for message reception. Value range: 0–30 seconds. Default value: 0. |
VisibilityTimeout | Message visibility timeout period. Value range: 1–43200 seconds (i.e., 12 hours). Default value: 30. |
MaxMsgSize | Maximum message length. Value range: 1024–65536 bytes (i.e., 1–64 KB). Default value: 65536. |
MsgRetentionSeconds | Message retention period. Value range: 60–1296000 seconds (i.e., 1 minute–15 days). Default value: 345600 (i.e., four days). |
RewindSeconds | Whether to enable the message rewinding feature for a queue. Value range: 0–msgRetentionSeconds, where 0 means not to enable this feature, while msgRetentionSeconds indicates that the maximum rewindable period is the message retention period of the queue. |
Transaction | 1: transaction queue; 0: general queue. |
FirstQueryInterval | First lookback interval. |
MaxQueryCount | Maximum number of lookbacks. |
DeadLetterQueueName | Dead letter queue name. |
Policy | Dead letter policy. 0: message has been consumed multiple times but not deleted; 1: Time-To-Live has elapsed. |
MaxReceiveCount | Maximum receipt times. Value range: 1–1000. |
MaxTimeToLive | Maximum period in seconds before an unconsumed message expires, which is required if policy is 1. Value range: 300–43200. This value should be smaller than msgRetentionSeconds (maximum message retention period). |
Trace | Whether to enable message trace. true: yes; false: no. If this field is not configured, the feature will not be enabled. |
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 CreateCmqQueue{public static void main(String [] args) {try{// Instantiate an authentication object. Pass in `secretId` and `secretKey` of your Tencent Cloud account as the input parameters and keep them confidential// You can get them at https://console.tencentcloud.com/cam/capiCredential cred = new Credential("SecretId", "SecretKey");// (Optional) Instantiate an HTTP optionHttpProfile httpProfile = new HttpProfile();httpProfile.setEndpoint("tdmq.tencentcloudapi.com");// Instantiate a client option (optional; skip if no special requirements are present)ClientProfile clientProfile = new ClientProfile();clientProfile.setHttpProfile(httpProfile);// Instantiate the client object of the requested product. `clientProfile` is optionalTdmqClient client = new TdmqClient(cred, "ap-guangzhou", clientProfile);// Instantiate a request object. Each API corresponds to a request objectCreateCmqQueueRequest req = new CreateCmqQueueRequest();req.setQueueName("queen");req.setPollingWaitSeconds(10L);req.setVisibilityTimeout(10L);req.setMaxMsgSize(1048576L);req.setMsgRetentionSeconds(345600L);// The returned `resp` is an instance of `CreateCmqQueueResponse` which corresponds to the request objectCreateCmqQueueResponse resp = client.CreateCmqQueue(req);// A string response packet in JSON format is outputSystem.out.println(CreateCmqQueueResponse.toJsonString(resp));} catch (TencentCloudSDKException e) {System.out.println(e.toString());}}}
Was this page helpful?