[ 
https://issues.apache.org/jira/browse/SCB-379?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16424043#comment-16424043
 ] 

ASF GitHub Bot commented on SCB-379:
------------------------------------

WillemJiang commented on a change in pull request #594: [SCB-379] support 
AsyncRestTemplate
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/594#discussion_r178828367
 
 

 ##########
 File path: 
samples/springmvc-sample/springmvc-consumer/src/main/java/org/apache/servicecomb/samples/springmvc/consumer/SpringmvcConsumerMain.java
 ##########
 @@ -64,10 +65,25 @@ public static void main(String[] args) throws Exception {
     System.out.println("AsyncRestTemplate Consumer sayHi services: " + 
responseEntity.getBody());
 
     HttpEntity<Person> entity = new HttpEntity<>(person);
-    ListenableFuture<ResponseEntity<String>> exchange = cseAsyncRestTemplate
+    ListenableFuture<ResponseEntity<String>> listenableFuture = 
cseAsyncRestTemplate
         .exchange("cse://springmvc/springmvchello/sayhello", HttpMethod.POST, 
entity, String.class);
-    ResponseEntity<String> responseEntity1 = exchange.get();
-    System.out.println("AsyncRestTemplate Consumer sayHello services: " + 
responseEntity1.getBody());
+//    ResponseEntity<String> responseEntity1 = listenableFuture.get();
+//    System.out.println("AsyncRestTemplate Consumer sayHello services: " + 
responseEntity1.getBody());
+
+    listenableFuture.addCallback(
+        new ListenableFutureCallback<ResponseEntity<String>>() {
+          @Override
+          public void onFailure(Throwable ex) {
+            ex.printStackTrace();
 
 Review comment:
   Please printout the exception before printing the stack trace.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Support Spring AsyncRestTemplate
> --------------------------------
>
>                 Key: SCB-379
>                 URL: https://issues.apache.org/jira/browse/SCB-379
>             Project: Apache ServiceComb
>          Issue Type: New Feature
>            Reporter: Bo Li
>            Assignee: Bo Li
>            Priority: Major
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to