tencent cloud

TDMQ for RocketMQ

Sending and Receiving Delayed Messages

PDF
포커스 모드
폰트 크기
마지막 업데이트 시간: 2026-01-23 17:52:24

Scenarios

This document uses the Spring Boot Starter SDK as an example to introduce the operation process of sending and receiving messages through an open-source software development kit (SDK), helping you better understand the whole process of sending and receiving delayed messages.

Prerequisites

You have obtained the client connection parameters as instructed in SDK Overview.

Operation Steps

Sending Messages

Like sending normal messages, you just need to pass the delay level when calling a sending method.
SendResult sendResult = rocketMQTemplate.syncSend(
destination,
MessageBuilder.withPayload(message).build(),
5000,
delayLevel);
The following table describes the mapping between delay levels and specific delay times.
Delay Level
Time
1
1s
2
5s
3
10s
4
30s
5
1m
6
2m
7
3m
8
4m
9
5m
10
6m
11
7m
12
8m
13
9m
14
10m
15
20m
16
30m
17
1h
18
2h

Consuming Messages

It is the same as normal messages and requires no special processing.



도움말 및 지원

문제 해결에 도움이 되었나요?

피드백