Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
5.0.1, 5.0
-
None
Description
HttpAsyncClientBuilder.replaceExecInterceptor([String|https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true] existing, AsyncExecChainHandler 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):
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; } } }
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.