tencent cloud

All product documents
TDMQ for RocketMQ
Sending and Receiving Delayed Messages
Last updated: 2023-04-12 11:41:05
Sending and Receiving Delayed Messages
Last updated: 2023-04-12 11:41:05

Overview

This document describes how to use Spring Boot Starter to send and receive messages and helps you better understand the message sending and receiving processes.

Prerequisites

You have created the required resources as instructed in Resource Creation and Preparation.
You have learned about the sending and receiving process of general messages.
You have downloaded the demo here or have downloaded one at the GitHub project.

Directions

Sending a message

This process is the same as that of general messages, but you need to pass in the corresponding delay level when calling the sending method.
SendResult sendResult = rocketMQTemplate.syncSend(
destination,
MessageBuilder.withPayload(message).build(),
5000,
delayLevel);
The relationship between the delay level and the delay time
The corresponding relationship between other delay levels and specific delay times is as follows:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
1s, 5s, 10s, 30s, 1m, 2m, 3m, 4m, 5m, 6m, 7m, 8m, 9m, 10m, 20m, 30m, 1h, 2h;

Consuming a message

This process is the same as that of general messages. No other actions are required.


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

Feedback

Contact Us

Contact our sales team or business advisors to help your business.

Technical Support

Open a ticket if you're looking for further assistance. Our Ticket is 7x24 available.

7x24 Phone Support
Hong Kong, China
+852 800 906 020 (Toll Free)
United States
+1 844 606 0804 (Toll Free)
United Kingdom
+44 808 196 4551 (Toll Free)
Canada
+1 888 605 7930 (Toll Free)
Australia
+61 1300 986 386 (Toll Free)
EdgeOne hotline
+852 300 80699
More local hotlines coming soon