You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by ji...@apache.org on 2025/03/12 13:25:39 UTC

(rocketmq-spring) branch master-0312 created (now 7f1e005)

This is an automated email from the ASF dual-hosted git repository.

jinrongtong pushed a change to branch master-0312
in repository https://gitbox.apache.org/repos/asf/rocketmq-spring.git


      at 7f1e005  Remove unnecessary catch blocks and log statements.

This branch includes the following new commits:

     new 7f1e005  Remove unnecessary catch blocks and log statements.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



(rocketmq-spring) 01/01: Remove unnecessary catch blocks and log statements.

Posted by ji...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jinrongtong pushed a commit to branch master-0312
in repository https://gitbox.apache.org/repos/asf/rocketmq-spring.git

commit 7f1e00580aedcb960adfed41d8228995676b7d28
Author: RongtongJin <ji...@mails.ucas.ac.cn>
AuthorDate: Wed Mar 12 21:21:49 2025 +0800

    Remove unnecessary catch blocks and log statements.
---
 .../apache/rocketmq/client/core/RocketMQClientTemplate.java   | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/rocketmq-v5-client-spring-boot/src/main/java/org/apache/rocketmq/client/core/RocketMQClientTemplate.java b/rocketmq-v5-client-spring-boot/src/main/java/org/apache/rocketmq/client/core/RocketMQClientTemplate.java
index 25f94ca..74f6356 100644
--- a/rocketmq-v5-client-spring-boot/src/main/java/org/apache/rocketmq/client/core/RocketMQClientTemplate.java
+++ b/rocketmq-v5-client-spring-boot/src/main/java/org/apache/rocketmq/client/core/RocketMQClientTemplate.java
@@ -228,12 +228,7 @@ public class RocketMQClientTemplate extends AbstractMessageSendingTemplate<Strin
         try {
             org.apache.rocketmq.client.apis.message.Message rocketMsg = this.createRocketMQMessage(destination, message, messageDelayTime, messageGroup);
             Producer grpcProducer = this.getProducer();
-            try {
-                sendReceipt = grpcProducer.send(rocketMsg);
-                log.info("Send message successfully, messageId={}", sendReceipt.getMessageId());
-            } catch (Throwable t) {
-                log.error("Failed to send message", t);
-            }
+            sendReceipt = grpcProducer.send(rocketMsg);
         } catch (Exception e) {
             log.error("send request message failed. destination:{}, message:{} ", destination, message);
             throw new MessagingException(e.getMessage(), e);
@@ -310,9 +305,11 @@ public class RocketMQClientTemplate extends AbstractMessageSendingTemplate<Strin
     }
 
     public CompletableFuture<SendReceipt> asyncSend(String destination, Message<?> message, Duration messageDelayTime, String messageGroup, CompletableFuture<SendReceipt> future) {
-        if (Objects.isNull(message) || Objects.isNull(message.getPayload())) {
+        if (Objects.isNull(message)) {
             log.error("send request message failed. destination:{}, message is null ", destination);
             throw new IllegalArgumentException("`message` and `message.payload` cannot be null");
+        } else {
+            message.getPayload();
         }
         Producer grpcProducer = this.getProducer();
         CompletableFuture<SendReceipt> future0;