apache / rocketmq-spring

Apache RocketMQ Spring Integration
https://rocketmq.apache.org/
Apache License 2.0
2.09k stars 894 forks source link

[Enhancement] Enhance the send delayed message interface to include a message send timeout. #676

Open magestacks opened 3 weeks ago

magestacks commented 3 weeks ago

Before Creating the Enhancement Request

Summary

Multiple overloaded methods of RocketMQTemplate#syncSendDelayTimeSeconds do not support a custom timeout parameter.

The RocketMQTemplate#syncSend method that supports custom configurations is private.

/**
 * Same to {@link #syncSend(String, Message)} with send timeout and delay time specified in addition.
 * This function is only valid when the broker version is 5.0 or above
 *
 * @param destination formats: `topicName:tags`
 * @param message {@link org.springframework.messaging.Message}
 * @param timeout send timeout with millis
 * @param delayTime delay time for message
 * @return {@link SendResult}
 */
private SendResult syncSend(String destination, Message<?> message, long timeout, long delayTime, DelayMode mode) {
    // ......
}

Motivation

Hope to include a custom timeout parameter when sending any delayed messages.

Describe the Solution You'd Like

Add an additional overloaded method for RocketMQTemplate#syncSendDelayTimeSeconds, or change the visibility of the RocketMQTemplate#syncSend method to public.

If you agree with this enhancement, I can submit a PR.

Describe Alternatives You've Considered

Add an additional overloaded method for RocketMQTemplate#syncSendDelayTimeSeconds, or change the visibility of the RocketMQTemplate#syncSend method to public.

If you agree with this enhancement, I can submit a PR.

Additional Context

No response