Attribute | Description | Value |
Queue Name | It is the `QueueName` attribute of the queue. | It is the unique identifier of a resource and can be used to differentiate API calls. It cannot be changed once the queue is created. It is case-insensitive and cannot end with `-retry` or `-dlq`. |
Resource Tag | It is optional and can help you easily categorize and manage TDMQ for CMQ resources in many dimensions. For detailed usage, see Managing Resource with Tag. | - |
Maximum Message Unacknowledged Time | If the consumer client fails to acknowledge a received message within this time period, the server will automatically acknowledge the message. | It ranges from 30 seconds to 12 hours. |
Long Polling Wait Time for Message Receipt | It is the `PollingWaitSeconds` attribute of the queue. Just like with long polling of Ajax requests, a message consumption request will return a response only after a valid message is fetched or the long-polling time elapses. | It ranges from 0 to 30 seconds. We recommend you set it to 3 seconds. A higher value may cause more duplicated messages. |
Hidden Duration of Fetched Message | It is the `VisibilityTimeout` attribute of the queue. Each message has a default `VisibilityTImeout`, which starts counting after a worker receives a message. If the worker fails to complete processing the message within the period specified by this attribute, the message will be sent to and processed by another worker. | It ranges from 1 second to 12 hours. |
Max Invisible Messages | If the client fails to acknowledge messages in a timely manner, an excessive number of invisible messages are generated. The generation of invisible messages will consume the memory; therefore, a capacity upper limit is set for each queue. | It is 100,000. If you need to increase the upper limit, contact technical support. |
Max Capacity for Heaped Messages | Message heap is generally caused by the production speed being greater than the consumption speed or the consumption being blocked. The heap will use disk space; therefore, a capacity upper limit is set for each queue. | It is 10 GB. If you need to increase the upper limit, contact technical support. |
Dead Letter Queue | A dead letter queue is used to handle messages that cannot be consumed successfully after their retry limit has been reached. Rather than being discarded immediately, such messages will be sent to the consumer's specified dead letter queue. | - |
Message Rewind | If the message rewind feature is not enabled, a message consumed by a consumer and confirmed for deletion will be deleted immediately. When enabling this feature, you need to specify the rewindable time range. | The rewindable time range must be equal to or shorter than the message lifecycle. We recommend you make it the same as the message lifecycle to facilitate troubleshooting. |
Rewindable Time Range | If the message rewind feature is enabled, messages confirmed for deletion by the consumer will not be deleted immediately; instead, they will be stored for the maximum time configured here. | It ranges from 1 to 15 days. A higher value may cause higher storage fees. The maximum rewindable time point is the current time minus the configured rewindable time range. Messages cannot be rewound if produced before this time. |
Rewindable Storage Space | After the message rewind feature is enabled, if the volume of persistently stored messages exceeds this maximum storage space, messages will be deleted by time (the oldest data will be deleted first). | It ranges from 1 to 10 GB. A higher value may cause higher storage fees. |
<!-- cmq sdk --><!-- cmq sdk --><dependency> <groupId>com.qcloud</groupId> <artifactId>cmq-http-client</artifactId> <version>1.0.7</version></dependency><!-- TencentCloud API SDK --><dependency> <groupId>com.tencentcloudapi</groupId> <artifactId>tencentcloud-sdk-java</artifactId> <version>3.1.423</version></dependency>
Account account = new Account(SERVER_ENDPOINT, SECRET_ID, SECRET_KEY);Queue queue = account.getQueue(queueName);String msg = "hello client, this is a message. Time:" + new Date();CmqResponse response = queue.send(msg);
Parameter | Description |
SERVER_ENDPOINT | API call address, which can be copied from Queue Service > API Request Address in the TDMQ for CMQ console. |
SECRET_ID, SECRET_KEY | TencentCloud API key, which can be copied on the Access Key > API Key Management page in the CAM console. |
queueName |
Account account = new Account(SERVER_ENDPOINT, SECRET_ID, SECRET_KEY);Queue queue = account.getQueue(queueName);Message message = queue.receiveMessage();// Successfully consumed messages are deleted. Retained messages can be delivered again after a certain period of timequeue.deleteMessage(message.receiptHandle);
Parameter | Description |
SERVER_ENDPOINT | API call address, which can be copied from Queue Service > API Request Address in the TDMQ for CMQ console. |
SECRET_ID, SECRET_KEY | TencentCloud API key, which can be copied on the Access Key > API Key Management page in the CAM console. |
queueName |
Was this page helpful?