You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by GitBox <gi...@apache.org> on 2023/01/17 02:37:32 UTC

[GitHub] [rocketmq-spring] RongtongJin commented on a diff in pull request #515: [ISSUE #506] support send message with arbitrarily delay time

RongtongJin commented on code in PR #515:
URL: https://github.com/apache/rocketmq-spring/pull/515#discussion_r1071684707


##########
rocketmq-spring-boot/src/main/java/org/apache/rocketmq/spring/core/RocketMQTemplate.java:
##########
@@ -535,6 +536,77 @@ public <T extends Message> SendResult syncSend(String destination, Collection<T>
         }
     }
 
+    /**
+     * Same to {@link #syncSend(String, Message)} with send delay time specified in addition.
+     *
+     * @param destination formats: `topicName:tags`
+     * @param message {@link org.springframework.messaging.Message}
+     * @param delayTime delay time in seconds for message
+     * @return {@link SendResult}
+     */
+    public SendResult syncSendDelayTimeSeconds(String destination, Message<?> message, long delayTime) {
+        return syncSend(destination, message, producer.getSendMsgTimeout(), delayTime, DelayMode.DELAY_SECONDS);
+    }
+
+    /**
+     * Same to {@link #syncSend(String, Object)} with send delayTime specified in addition.
+     *
+     * @param destination formats: `topicName:tags`
+     * @param payload the Object to use as payload
+     * @param delayTime delay time in seconds for message
+     * @return {@link SendResult}
+     */

Review Comment:
   It would be better to remind users that the interface can only take effect on RocketMQ 5.0 servers



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org