tencent cloud

Feedback

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.
    
    
    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 avaliable.

    7x24 Phone Support