@@ -112,6 +112,7 @@ public class DefaultAsyncHttpClientConfig implements AsyncHttpClientConfig {
112112
113113 // internals
114114 private final String threadPoolName ;
115+ private final String channelThreadPoolName ;
115116 private final int httpClientCodecMaxInitialLineLength ;
116117 private final int httpClientCodecMaxHeaderSize ;
117118 private final int httpClientCodecMaxChunkSize ;
@@ -128,6 +129,7 @@ public class DefaultAsyncHttpClientConfig implements AsyncHttpClientConfig {
128129 private final int soRcvBuf ;
129130 private final Timer nettyTimer ;
130131 private final ThreadFactory threadFactory ;
132+ private final ThreadFactory channelThreadFactory ;
131133 private final Consumer <Channel > httpAdditionalChannelInitializer ;
132134 private final Consumer <Channel > wsAdditionalChannelInitializer ;
133135 private final ResponseBodyPartFactory responseBodyPartFactory ;
@@ -199,6 +201,7 @@ private DefaultAsyncHttpClientConfig(// http
199201
200202 // internals
201203 String threadPoolName ,
204+ String channelThreadPoolName ,
202205 int httpClientCodecMaxInitialLineLength ,
203206 int httpClientCodecMaxHeaderSize ,
204207 int httpClientCodecMaxChunkSize ,
@@ -212,6 +215,7 @@ private DefaultAsyncHttpClientConfig(// http
212215 ByteBufAllocator allocator ,
213216 Timer nettyTimer ,
214217 ThreadFactory threadFactory ,
218+ ThreadFactory channelThreadFactory ,
215219 Consumer <Channel > httpAdditionalChannelInitializer ,
216220 Consumer <Channel > wsAdditionalChannelInitializer ,
217221 ResponseBodyPartFactory responseBodyPartFactory ,
@@ -287,6 +291,7 @@ private DefaultAsyncHttpClientConfig(// http
287291
288292 // internals
289293 this .threadPoolName = threadPoolName ;
294+ this .channelThreadPoolName = channelThreadPoolName ;
290295 this .httpClientCodecMaxInitialLineLength = httpClientCodecMaxInitialLineLength ;
291296 this .httpClientCodecMaxHeaderSize = httpClientCodecMaxHeaderSize ;
292297 this .httpClientCodecMaxChunkSize = httpClientCodecMaxChunkSize ;
@@ -298,6 +303,7 @@ private DefaultAsyncHttpClientConfig(// http
298303 this .allocator = allocator ;
299304 this .nettyTimer = nettyTimer ;
300305 this .threadFactory = threadFactory ;
306+ this .channelThreadFactory = channelThreadFactory ;
301307 this .httpAdditionalChannelInitializer = httpAdditionalChannelInitializer ;
302308 this .wsAdditionalChannelInitializer = wsAdditionalChannelInitializer ;
303309 this .responseBodyPartFactory = responseBodyPartFactory ;
@@ -581,6 +587,11 @@ public String getThreadPoolName() {
581587 return threadPoolName ;
582588 }
583589
590+ @ Override
591+ public String getChannelThreadPoolName () {
592+ return channelThreadPoolName ;
593+ }
594+
584595 @ Override
585596 public int getHttpClientCodecMaxInitialLineLength () {
586597 return httpClientCodecMaxInitialLineLength ;
@@ -636,6 +647,11 @@ public ThreadFactory getThreadFactory() {
636647 return threadFactory ;
637648 }
638649
650+ @ Override
651+ public ThreadFactory getChannelThreadFactory () {
652+ return channelThreadFactory ;
653+ }
654+
639655 @ Override
640656 public Consumer <Channel > getHttpAdditionalChannelInitializer () {
641657 return httpAdditionalChannelInitializer ;
@@ -732,6 +748,7 @@ public static class Builder {
732748
733749 // internals
734750 private String threadPoolName = defaultThreadPoolName ();
751+ private String channelThreadPoolName = defaultChannelThreadPoolName ();
735752 private int httpClientCodecMaxInitialLineLength = defaultHttpClientCodecMaxInitialLineLength ();
736753 private int httpClientCodecMaxHeaderSize = defaultHttpClientCodecMaxHeaderSize ();
737754 private int httpClientCodecMaxChunkSize = defaultHttpClientCodecMaxChunkSize ();
@@ -743,6 +760,7 @@ public static class Builder {
743760 private EventLoopGroup eventLoopGroup ;
744761 private Timer nettyTimer ;
745762 private ThreadFactory threadFactory ;
763+ private ThreadFactory channelThreadFactory ;
746764 private Consumer <Channel > httpAdditionalChannelInitializer ;
747765 private Consumer <Channel > wsAdditionalChannelInitializer ;
748766 private ResponseBodyPartFactory responseBodyPartFactory = ResponseBodyPartFactory .EAGER ;
@@ -814,6 +832,7 @@ public Builder(AsyncHttpClientConfig config) {
814832
815833 // internals
816834 threadPoolName = config .getThreadPoolName ();
835+ channelThreadPoolName = config .getChannelThreadPoolName ();
817836 httpClientCodecMaxInitialLineLength = config .getHttpClientCodecMaxInitialLineLength ();
818837 httpClientCodecMaxHeaderSize = config .getHttpClientCodecMaxHeaderSize ();
819838 httpClientCodecMaxChunkSize = config .getHttpClientCodecMaxChunkSize ();
@@ -824,6 +843,7 @@ public Builder(AsyncHttpClientConfig config) {
824843 allocator = config .getAllocator ();
825844 nettyTimer = config .getNettyTimer ();
826845 threadFactory = config .getThreadFactory ();
846+ channelThreadFactory = config .getChannelThreadFactory ();
827847 httpAdditionalChannelInitializer = config .getHttpAdditionalChannelInitializer ();
828848 wsAdditionalChannelInitializer = config .getWsAdditionalChannelInitializer ();
829849 responseBodyPartFactory = config .getResponseBodyPartFactory ();
@@ -1148,6 +1168,11 @@ public Builder setThreadPoolName(String threadPoolName) {
11481168 return this ;
11491169 }
11501170
1171+ public Builder setChannelThreadPoolName (String channelThreadPoolName ) {
1172+ this .channelThreadPoolName = channelThreadPoolName ;
1173+ return this ;
1174+ }
1175+
11511176 public Builder setHttpClientCodecMaxInitialLineLength (int httpClientCodecMaxInitialLineLength ) {
11521177 this .httpClientCodecMaxInitialLineLength = httpClientCodecMaxInitialLineLength ;
11531178 return this ;
@@ -1204,6 +1229,11 @@ public Builder setThreadFactory(ThreadFactory threadFactory) {
12041229 return this ;
12051230 }
12061231
1232+ public Builder setChannelThreadFactory (ThreadFactory channelThreadFactory ) {
1233+ this .channelThreadFactory = channelThreadFactory ;
1234+ return this ;
1235+ }
1236+
12071237 public Builder setHttpAdditionalChannelInitializer (Consumer <Channel > httpAdditionalChannelInitializer ) {
12081238 this .httpAdditionalChannelInitializer = httpAdditionalChannelInitializer ;
12091239 return this ;
@@ -1291,6 +1321,7 @@ public DefaultAsyncHttpClientConfig build() {
12911321 soSndBuf ,
12921322 soRcvBuf ,
12931323 threadPoolName ,
1324+ channelThreadPoolName ,
12941325 httpClientCodecMaxInitialLineLength ,
12951326 httpClientCodecMaxHeaderSize ,
12961327 httpClientCodecMaxChunkSize ,
@@ -1304,6 +1335,7 @@ public DefaultAsyncHttpClientConfig build() {
13041335 allocator ,
13051336 nettyTimer ,
13061337 threadFactory ,
1338+ channelThreadFactory ,
13071339 httpAdditionalChannelInitializer ,
13081340 wsAdditionalChannelInitializer ,
13091341 responseBodyPartFactory ,
0 commit comments