[ https://issues.apache.org/jira/browse/SCB-379?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16414915#comment-16414915 ]
ASF GitHub Bot commented on SCB-379: ------------------------------------ wujimin commented on a change in pull request #594: [SCB-379] support AsyncRestTemplate URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/594#discussion_r177290894 ########## File path: providers/provider-springmvc/src/main/java/org/apache/servicecomb/provider/springmvc/reference/async/CseAsyncRequestCallback.java ########## @@ -0,0 +1,49 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.servicecomb.provider.springmvc.reference.async; + +import org.apache.servicecomb.provider.springmvc.reference.CseHttpEntity; +import org.springframework.http.HttpEntity; +import org.springframework.http.client.AsyncClientHttpRequest; +import org.springframework.web.client.AsyncRequestCallback; + +public class CseAsyncRequestCallback<T> implements AsyncRequestCallback { + private HttpEntity<T> requestBody; + + CseAsyncRequestCallback(HttpEntity<T> requestBody) { + this.requestBody = requestBody; + } + + @Override + public void doWithRequest(AsyncClientHttpRequest request) { + CseAsyncClientHttpRequest cseAsyncClientHttpRequest = (CseAsyncClientHttpRequest) request; + if (requestBody != null) { + cseAsyncClientHttpRequest.setRequestBody(requestBody.getBody()); + } else { + cseAsyncClientHttpRequest.setRequestBody(requestBody); Review comment: why need to set null? ---------------------------------------------------------------- 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)