in zuul-core/src/main/java/com/netflix/zuul/netty/server/BaseZuulChannelInitializer.java [167:226]
private BaseZuulChannelInitializer(
int port,
String metricId,
ChannelConfig channelConfig,
ChannelConfig channelDependencies,
ChannelGroup channels) {
this.port = port;
Preconditions.checkNotNull(metricId, "metricId");
this.metricId = metricId;
this.channelConfig = channelConfig;
this.channelDependencies = channelDependencies;
this.channels = channels;
this.accessLogPublisher = channelDependencies.get(ZuulDependencyKeys.accessLogPublisher);
this.withProxyProtocol = channelConfig.get(CommonChannelConfigKeys.withProxyProtocol);
this.idleTimeout = channelConfig.get(CommonChannelConfigKeys.idleTimeout);
this.httpRequestReadTimeout = channelConfig.get(CommonChannelConfigKeys.httpRequestReadTimeout);
this.registry = channelDependencies.get(ZuulDependencyKeys.registry);
this.httpMetricsHandler = new HttpMetricsChannelHandler(registry, "server", "http-" + metricId);
EventLoopGroupMetrics eventLoopGroupMetrics = channelDependencies.get(ZuulDependencyKeys.eventLoopGroupMetrics);
PerEventLoopMetricsChannelHandler perEventLoopMetricsHandler =
new PerEventLoopMetricsChannelHandler(eventLoopGroupMetrics);
this.perEventLoopConnectionMetricsHandler = perEventLoopMetricsHandler.new Connections();
this.perEventLoopRequestsMetricsHandler = perEventLoopMetricsHandler.new HttpRequests();
this.maxConnections = channelConfig.get(CommonChannelConfigKeys.maxConnections);
this.maxConnectionsHandler = new MaxInboundConnectionsHandler(registry, metricId, maxConnections);
this.maxRequestsPerConnection = channelConfig.get(CommonChannelConfigKeys.maxRequestsPerConnection);
this.maxRequestsPerConnectionInBrownout =
channelConfig.get(CommonChannelConfigKeys.maxRequestsPerConnectionInBrownout);
this.connectionExpiry = channelConfig.get(CommonChannelConfigKeys.connectionExpiry);
StripUntrustedProxyHeadersHandler.AllowWhen allowProxyHeadersWhen =
channelConfig.get(CommonChannelConfigKeys.allowProxyHeadersWhen);
this.stripInboundProxyHeadersHandler = new StripUntrustedProxyHeadersHandler(allowProxyHeadersWhen);
this.rateLimitingChannelHandler = channelDependencies
.get(ZuulDependencyKeys.rateLimitingChannelHandlerProvider)
.get();
this.sslClientCertCheckChannelHandler = channelDependencies
.get(ZuulDependencyKeys.sslClientCertCheckChannelHandlerProvider)
.get();
this.passportLoggingHandler = new PassportLoggingHandler(registry);
this.sessionContextDecorator = channelDependencies.get(ZuulDependencyKeys.sessionCtxDecorator);
this.requestCompleteHandler = channelDependencies.get(ZuulDependencyKeys.requestCompleteHandler);
this.httpRequestHeadersReadTimeoutCounter = channelDependencies.get(ZuulDependencyKeys.httpRequestHeadersReadTimeoutCounter);
this.httpRequestHeadersReadTimer = channelDependencies.get(ZuulDependencyKeys.httpRequestHeadersReadTimer);
this.httpRequestReadTimeoutCounter = channelDependencies.get(ZuulDependencyKeys.httpRequestReadTimeoutCounter);
this.filterLoader = channelDependencies.get(ZuulDependencyKeys.filterLoader);
this.filterUsageNotifier = channelDependencies.get(ZuulDependencyKeys.filterUsageNotifier);
this.sourceAddressChannelHandler = new SourceAddressChannelHandler();
}