[ https://issues.apache.org/jira/browse/HTTPCLIENT-2115?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17192245#comment-17192245 ]
ASF subversion and git services commented on HTTPCLIENT-2115: ------------------------------------------------------------- Commit feaa72e6e15748478a296ca859ffe5bdd776fb8e in httpcomponents-client's branch refs/heads/master from Oleg Kalnichevski [ https://gitbox.apache.org/repos/asf?p=httpcomponents-client.git;h=feaa72e ] HTTPCLIENT-2115: HttpAsyncClientBuilder and H2AsyncClientBuilder fail to take `replaceExecInterceptor()` into account > HttpAsyncClientBuilder build() ignores replaceExecInterceptor() > ---------------------------------------------------------------- > > Key: HTTPCLIENT-2115 > URL: https://issues.apache.org/jira/browse/HTTPCLIENT-2115 > Project: HttpComponents HttpClient > Issue Type: Bug > Components: HttpClient (async) > Affects Versions: 5.0.1, 5.0 > Reporter: Thomas Warner > Priority: Minor > Fix For: 5.0.2 > > > *[HttpAsyncClientBuilder.replaceExecInterceptor|https://hc.apache.org/httpcomponents-client-5.0.x/httpclient5/apidocs/org/apache/hc/client5/http/impl/async/HttpAsyncClientBuilder.html#replaceExecInterceptor(java.lang.String,%20org.apache.hc.client5.http.async.AsyncExecChainHandler)]*([String|https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true] > existing, > [AsyncExecChainHandler|https://hc.apache.org/httpcomponents-client-5.0.x/httpclient5/apidocs/org/apache/hc/client5/http/async/AsyncExecChainHandler.html] > interceptor) stores the interceptor internally, but is not added to the > execChain given to the client that is created on build(). > The problem appears to be in HttpAsyncClientBuilder.build() (starting line > 940 in 5.0.1): > > {code:java} > if (execInterceptors != null) { > for (final ExecInterceptorEntry entry: execInterceptors) { > switch (entry.postion) { > case AFTER: > execChainDefinition.addAfter(entry.existing, > entry.interceptor, entry.name); > break; > case BEFORE: > execChainDefinition.addBefore(entry.existing, > entry.interceptor, entry.name); > break; > case FIRST: > execChainDefinition.addFirst(entry.interceptor, entry.name); > break; > case LAST: > execChainDefinition.addLast(entry.interceptor, entry.name); > break; > } > } > } > {code} > Note that there is no case for the RETRY option. > Potential workaround: addExecInterceptorAfter() or > addExecInterceptorBefore(), in which case both exec interceptors are included > but ideally the intended exec interceptor supersedes the one you wish to > replace. > -- This message was sent by Atlassian Jira (v8.3.4#803005) --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org For additional commands, e-mail: dev-h...@hc.apache.org