Uploaded image for project: 'HttpComponents HttpClient'
  1. HttpComponents HttpClient
  2. HTTPCLIENT-1928

HttpAsyncClient callback should ignore exception throwed by compelete method

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 5.0 Beta2
    • None
    • None

    Description

      If exception throwed by completed method in FutureCallback argument in HttpAsyncClient.execute,the connection will be closed.
      but the exception throwed by customer code,should not affect the connection managed by the framework,the connection should be connected also.

      there can be a class called FutureCallbackIgnorecompelteExcepton class.
      public abstract class FutureCallbackIgnorecompelteExcepton <T> {
      private FutureCallback<T> t;
      void completed(T result){
      try

      { t.completed(result); }

      catch(Exception e)
      //ignore
      }
      void failed(Exception ex);
      void cancelled();
      }
      HttpAsyncClient changed as:
      HttpAsyncClient.<T> Future<T> execute(
      AsyncRequestProducer requestProducer,
      AsyncResponseConsumer<T> responseConsumer,
      HttpContext context,
      FutureCallbackIgnorecompelteExcepton <T> callback);

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              silver9886 silver9886
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: