@@ -112,6 +112,7 @@ public class DefaultAsyncHttpClientConfig implements AsyncHttpClientConfig {
112
112
113
113
// internals
114
114
private final String threadPoolName ;
115
+ private final String channelThreadPoolName ;
115
116
private final int httpClientCodecMaxInitialLineLength ;
116
117
private final int httpClientCodecMaxHeaderSize ;
117
118
private final int httpClientCodecMaxChunkSize ;
@@ -128,6 +129,7 @@ public class DefaultAsyncHttpClientConfig implements AsyncHttpClientConfig {
128
129
private final int soRcvBuf ;
129
130
private final Timer nettyTimer ;
130
131
private final ThreadFactory threadFactory ;
132
+ private final ThreadFactory channelThreadFactory ;
131
133
private final Consumer <Channel > httpAdditionalChannelInitializer ;
132
134
private final Consumer <Channel > wsAdditionalChannelInitializer ;
133
135
private final ResponseBodyPartFactory responseBodyPartFactory ;
@@ -199,6 +201,7 @@ private DefaultAsyncHttpClientConfig(// http
199
201
200
202
// internals
201
203
String threadPoolName ,
204
+ String channelThreadPoolName ,
202
205
int httpClientCodecMaxInitialLineLength ,
203
206
int httpClientCodecMaxHeaderSize ,
204
207
int httpClientCodecMaxChunkSize ,
@@ -212,6 +215,7 @@ private DefaultAsyncHttpClientConfig(// http
212
215
ByteBufAllocator allocator ,
213
216
Timer nettyTimer ,
214
217
ThreadFactory threadFactory ,
218
+ ThreadFactory channelThreadFactory ,
215
219
Consumer <Channel > httpAdditionalChannelInitializer ,
216
220
Consumer <Channel > wsAdditionalChannelInitializer ,
217
221
ResponseBodyPartFactory responseBodyPartFactory ,
@@ -287,6 +291,7 @@ private DefaultAsyncHttpClientConfig(// http
287
291
288
292
// internals
289
293
this .threadPoolName = threadPoolName ;
294
+ this .channelThreadPoolName = channelThreadPoolName ;
290
295
this .httpClientCodecMaxInitialLineLength = httpClientCodecMaxInitialLineLength ;
291
296
this .httpClientCodecMaxHeaderSize = httpClientCodecMaxHeaderSize ;
292
297
this .httpClientCodecMaxChunkSize = httpClientCodecMaxChunkSize ;
@@ -298,6 +303,7 @@ private DefaultAsyncHttpClientConfig(// http
298
303
this .allocator = allocator ;
299
304
this .nettyTimer = nettyTimer ;
300
305
this .threadFactory = threadFactory ;
306
+ this .channelThreadFactory = channelThreadFactory ;
301
307
this .httpAdditionalChannelInitializer = httpAdditionalChannelInitializer ;
302
308
this .wsAdditionalChannelInitializer = wsAdditionalChannelInitializer ;
303
309
this .responseBodyPartFactory = responseBodyPartFactory ;
@@ -581,6 +587,11 @@ public String getThreadPoolName() {
581
587
return threadPoolName ;
582
588
}
583
589
590
+ @ Override
591
+ public String getChannelThreadPoolName () {
592
+ return channelThreadPoolName ;
593
+ }
594
+
584
595
@ Override
585
596
public int getHttpClientCodecMaxInitialLineLength () {
586
597
return httpClientCodecMaxInitialLineLength ;
@@ -636,6 +647,11 @@ public ThreadFactory getThreadFactory() {
636
647
return threadFactory ;
637
648
}
638
649
650
+ @ Override
651
+ public ThreadFactory getChannelThreadFactory () {
652
+ return channelThreadFactory ;
653
+ }
654
+
639
655
@ Override
640
656
public Consumer <Channel > getHttpAdditionalChannelInitializer () {
641
657
return httpAdditionalChannelInitializer ;
@@ -732,6 +748,7 @@ public static class Builder {
732
748
733
749
// internals
734
750
private String threadPoolName = defaultThreadPoolName ();
751
+ private String channelThreadPoolName = defaultChannelThreadPoolName ();
735
752
private int httpClientCodecMaxInitialLineLength = defaultHttpClientCodecMaxInitialLineLength ();
736
753
private int httpClientCodecMaxHeaderSize = defaultHttpClientCodecMaxHeaderSize ();
737
754
private int httpClientCodecMaxChunkSize = defaultHttpClientCodecMaxChunkSize ();
@@ -743,6 +760,7 @@ public static class Builder {
743
760
private EventLoopGroup eventLoopGroup ;
744
761
private Timer nettyTimer ;
745
762
private ThreadFactory threadFactory ;
763
+ private ThreadFactory channelThreadFactory ;
746
764
private Consumer <Channel > httpAdditionalChannelInitializer ;
747
765
private Consumer <Channel > wsAdditionalChannelInitializer ;
748
766
private ResponseBodyPartFactory responseBodyPartFactory = ResponseBodyPartFactory .EAGER ;
@@ -814,6 +832,7 @@ public Builder(AsyncHttpClientConfig config) {
814
832
815
833
// internals
816
834
threadPoolName = config .getThreadPoolName ();
835
+ channelThreadPoolName = config .getChannelThreadPoolName ();
817
836
httpClientCodecMaxInitialLineLength = config .getHttpClientCodecMaxInitialLineLength ();
818
837
httpClientCodecMaxHeaderSize = config .getHttpClientCodecMaxHeaderSize ();
819
838
httpClientCodecMaxChunkSize = config .getHttpClientCodecMaxChunkSize ();
@@ -824,6 +843,7 @@ public Builder(AsyncHttpClientConfig config) {
824
843
allocator = config .getAllocator ();
825
844
nettyTimer = config .getNettyTimer ();
826
845
threadFactory = config .getThreadFactory ();
846
+ channelThreadFactory = config .getChannelThreadFactory ();
827
847
httpAdditionalChannelInitializer = config .getHttpAdditionalChannelInitializer ();
828
848
wsAdditionalChannelInitializer = config .getWsAdditionalChannelInitializer ();
829
849
responseBodyPartFactory = config .getResponseBodyPartFactory ();
@@ -1148,6 +1168,11 @@ public Builder setThreadPoolName(String threadPoolName) {
1148
1168
return this ;
1149
1169
}
1150
1170
1171
+ public Builder setChannelThreadPoolName (String channelThreadPoolName ) {
1172
+ this .channelThreadPoolName = channelThreadPoolName ;
1173
+ return this ;
1174
+ }
1175
+
1151
1176
public Builder setHttpClientCodecMaxInitialLineLength (int httpClientCodecMaxInitialLineLength ) {
1152
1177
this .httpClientCodecMaxInitialLineLength = httpClientCodecMaxInitialLineLength ;
1153
1178
return this ;
@@ -1204,6 +1229,11 @@ public Builder setThreadFactory(ThreadFactory threadFactory) {
1204
1229
return this ;
1205
1230
}
1206
1231
1232
+ public Builder setChannelThreadFactory (ThreadFactory channelThreadFactory ) {
1233
+ this .channelThreadFactory = channelThreadFactory ;
1234
+ return this ;
1235
+ }
1236
+
1207
1237
public Builder setHttpAdditionalChannelInitializer (Consumer <Channel > httpAdditionalChannelInitializer ) {
1208
1238
this .httpAdditionalChannelInitializer = httpAdditionalChannelInitializer ;
1209
1239
return this ;
@@ -1291,6 +1321,7 @@ public DefaultAsyncHttpClientConfig build() {
1291
1321
soSndBuf ,
1292
1322
soRcvBuf ,
1293
1323
threadPoolName ,
1324
+ channelThreadPoolName ,
1294
1325
httpClientCodecMaxInitialLineLength ,
1295
1326
httpClientCodecMaxHeaderSize ,
1296
1327
httpClientCodecMaxChunkSize ,
@@ -1304,6 +1335,7 @@ public DefaultAsyncHttpClientConfig build() {
1304
1335
allocator ,
1305
1336
nettyTimer ,
1306
1337
threadFactory ,
1338
+ channelThreadFactory ,
1307
1339
httpAdditionalChannelInitializer ,
1308
1340
wsAdditionalChannelInitializer ,
1309
1341
responseBodyPartFactory ,
0 commit comments