RongtongJin commented on a change in pull request #209: [ISSUE #208]support 
request/reply model in rocketmq-spring
URL: https://github.com/apache/rocketmq-spring/pull/209#discussion_r363580603
 
 

 ##########
 File path: 
rocketmq-spring-boot/src/main/java/org/apache/rocketmq/spring/core/RocketMQTemplate.java
 ##########
 @@ -537,4 +877,49 @@ public TransactionSendResult 
sendMessageInTransaction(final String destination,
             destination, msg);
     }
 
+    private Message<?> validateMessageAndPayload(Message<?> message, Object 
payload) {
+        if (Objects.nonNull(message) && Objects.nonNull(payload)) {
+            log.error("`message` and `payload` cannot exist at the same 
time.");
+            throw new IllegalArgumentException("`message` and `payload` cannot 
exist at the same time");
+        }
+
+        if (Objects.nonNull(payload)) {
+            message = MessageBuilder.withPayload(payload).build();
+        }
+
+        if (Objects.isNull(message) || Objects.isNull(message.getPayload())) {
+            log.error("send request message failed. Either `message` or 
`payload` needed.");
+            throw new IllegalArgumentException("either `message` or `payload` 
needed.");
+        }
+        return message;
+    }
 
 Review comment:
   Delete useless method

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to