Skip to content
Permalink
Browse files
HttpAsyncClientBuilder: Make IOReactor exception callback configurable
  • Loading branch information
rschmitt committed Mar 31, 2021
1 parent 3f09dbe commit f5975881983f63560816b84038822751b9bb28e2
Showing 1 changed file with 12 additions and 1 deletion.
@@ -209,6 +209,7 @@ private ExecInterceptorEntry(
private AsyncClientConnectionManager connManager;
private boolean connManagerShared;
private IOReactorConfig ioReactorConfig;
private Callback<Exception> ioReactorExceptionCallback;
private Http1Config h1Config;
private H2Config h2Config;
private CharCodingConfig charCodingConfig;
@@ -316,6 +317,16 @@ public final HttpAsyncClientBuilder setIOReactorConfig(final IOReactorConfig ioR
return this;
}

/**
* Sets the callback that will be invoked when the client's IOReactor encounters an uncaught exception.
*
* @since 5.1
*/
public final HttpAsyncClientBuilder setIoReactorExceptionCallback(final Callback<Exception> ioReactorExceptionCallback) {
this.ioReactorExceptionCallback = ioReactorExceptionCallback;
return this;
}

/**
* Sets {@link CharCodingConfig} configuration.
*/
@@ -932,7 +943,7 @@ public AsyncPushConsumer create(final HttpRequest request, final HttpContext con
ioReactorConfig != null ? ioReactorConfig : IOReactorConfig.DEFAULT,
threadFactory != null ? threadFactory : new DefaultThreadFactory("httpclient-dispatch", true),
LoggingIOSessionDecorator.INSTANCE,
LoggingExceptionCallback.INSTANCE,
ioReactorExceptionCallback != null ? ioReactorExceptionCallback : LoggingExceptionCallback.INSTANCE,
null,
new Callback<IOSession>() {

0 comments on commit f597588

Please sign in to comment.