xhrg opened a new issue, #13500:
URL: https://github.com/apache/skywalking/issues/13500

   ### Search before asking
   
   - [x] I had searched in the 
[issues](https://github.com/apache/skywalking/issues?q=is%3Aissue) and found no 
similar issues.
   
   
   ### Apache SkyWalking Component
   
   OAP server (apache/skywalking)
   
   ### What happened
   
   When using the Jetty client, the application cannot receive the returned data
   
   ### What you expected to happen
   
   When using the Jetty client, the application can receive the returned data
   
   ### How to reproduce
   
   Use the Jetty client to request the HTTP interface and check the response
   
   ### Anything else
   
   AsyncHttpRequestSendInterceptor.java     beforeMethod   below, This is my 
repair method
   
   `
   if (allArguments[0] instanceof BufferingResponseListener) {
               BufferingResponseListener callback = (BufferingResponseListener) 
allArguments[0];
               allArguments[0] = new BufferingResponseListenerWrapper(callback, 
ContextManager.capture());
           } else {
               Response.CompleteListener callback = (Response.CompleteListener) 
allArguments[0];
               allArguments[0] = new CompleteListenerWrapper(callback, 
ContextManager.capture());
           }
   `
   
   `
   public class BufferingResponseListenerWrapper extends 
BufferingResponseListener {
       private BufferingResponseListener callback;
       private ContextSnapshot context;
   
       public BufferingResponseListenerWrapper(BufferingResponseListener 
callback, ContextSnapshot context) {
           this.callback = callback;
           this.context = context;
       }
   
       @Override
       public void onComplete(Result result) {
           AbstractSpan span = 
ContextManager.createLocalSpan(Constants.PLUGIN_NAME + 
"/CompleteListener/onComplete");
           span.setComponent(ComponentsDefine.JETTY_CLIENT);
           SpanLayer.asHttp(span);
           if (context != null) {
               ContextManager.continued(context);
           }
           if (callback != null) {
               callback.onComplete(result);
           }
           ContextManager.stopSpan();
       }
   
       @Override
       public void onHeaders(Response response) {
           callback.onHeaders(response);
       }
   
       @Override
       public void onContent(Response response, ByteBuffer content) {
           callback.onContent(response, content);
       }
   
       @Override
       public void onBegin(Response response) {
           callback.onBegin(response);
       }
   
       @Override
       public boolean onHeader(Response response, HttpField field) {
           return callback.onHeader(response, field);
       }
   
       @Override
       public void onSuccess(Response response) {
           callback.onSuccess(response);
       }
   
       @Override
       public void onFailure(Response response, Throwable failure) {
           callback.onFailure(response, failure);
       }
   }
   `
   
   
    
   
   
   ### Are you willing to submit a pull request to fix on your own?
   
   - [ ] Yes I am willing to submit a pull request on my own!
   
   ### Code of Conduct
   
   - [x] I agree to follow this project's [Code of 
Conduct](https://www.apache.org/foundation/policies/conduct)
   


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

To unsubscribe, e-mail: 
[email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to