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_r364193567
 
 

 ##########
 File path: 
rocketmq-spring-boot-samples/rocketmq-produce-demo/src/main/java/org/apache/rocketmq/samples/springboot/ProducerApplication.java
 ##########
 @@ -116,6 +128,53 @@ public void onException(Throwable var1) {
 
         // Send transactional messages using extRocketMQTemplate
         testExtRocketMQTemplateTransaction();
+
+        // send request in sync mode and receive a reply of String type.
+        String replyString = 
rocketMQTemplate.sendAndReceive(stringRequestTopic, "request string", 
String.class);
+        System.out.printf("send %s and receive %s %n", "request string", 
replyString);
+
+        // send request in sync mode with timeout parameter and receive a 
reply of byte[] type.
+        byte[] replyBytes = rocketMQTemplate.sendAndReceive(bytesRequestTopic, 
new Message<String>() {
+            @Override public String getPayload() {
+                return "request byte[]";
+            }
+
+            @Override public MessageHeaders getHeaders() {
+                return null;
+            }
+        }, byte[].class, 3000);
+        System.out.printf("send %s and receive %s %n", "request byte[]", 
replyBytes.toString());
+
+        // send request in sync mode with hashKey parameter and receive a 
reply of User type.
+        User requestUser = new User().setUserAge(Byte.valueOf((byte) 
9)).setUserName("requestUserName");
 
 Review comment:
   Byte.valueOf((byte) 9) --> (byte) 9

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