From 85ffa0d312afa5f72f50c2fa928de4422c5a2cd4 Mon Sep 17 00:00:00 2001 From: argha-c <007.argha@gmail.com> Date: Thu, 3 Oct 2024 11:52:04 -0700 Subject: [PATCH] wire new listener spec through channel deps --- .../zuul/netty/server/BaseServerStartup.java | 29 +++++++++++++++++-- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/zuul-core/src/main/java/com/netflix/zuul/netty/server/BaseServerStartup.java b/zuul-core/src/main/java/com/netflix/zuul/netty/server/BaseServerStartup.java index b2a1ebe9da..6fe9713d90 100644 --- a/zuul-core/src/main/java/com/netflix/zuul/netty/server/BaseServerStartup.java +++ b/zuul-core/src/main/java/com/netflix/zuul/netty/server/BaseServerStartup.java @@ -148,15 +148,38 @@ protected ChannelConfig defaultChannelDependencies(String listenAddressName) { return channelDependencies; } - protected ChannelConfig defaultChannelDependencies(ListenerSpec listenSpec) { + protected ChannelConfig defaultChannelDependencies(ListenerSpec listenerSpec) { ChannelConfig channelDependencies = new ChannelConfig(); - addChannelDependencies(channelDependencies, listenSpec.addressName()); + addChannelDependencies(channelDependencies, listenerSpec); return channelDependencies; } protected void addChannelDependencies( ChannelConfig channelDeps, - @SuppressWarnings("unused") String listenAddressName) { // listenAddressName is used by subclasses + @SuppressWarnings("unused") String listenAddressName) { // listenAddressName may be overriden by subclasse + channelDeps.set(ZuulDependencyKeys.registry, registry); + + channelDeps.set(ZuulDependencyKeys.applicationInfoManager, applicationInfoManager); + channelDeps.set(ZuulDependencyKeys.serverStatusManager, serverStatusManager); + + channelDeps.set(ZuulDependencyKeys.accessLogPublisher, accessLogPublisher); + + channelDeps.set(ZuulDependencyKeys.sessionCtxDecorator, sessionCtxDecorator); + channelDeps.set(ZuulDependencyKeys.requestCompleteHandler, reqCompleteHandler); + final Counter httpRequestReadTimeoutCounter = registry.counter("server.http.request.read.timeout"); + channelDeps.set(ZuulDependencyKeys.httpRequestReadTimeoutCounter, httpRequestReadTimeoutCounter); + channelDeps.set(ZuulDependencyKeys.filterLoader, filterLoader); + channelDeps.set(ZuulDependencyKeys.filterUsageNotifier, usageNotifier); + + channelDeps.set(ZuulDependencyKeys.eventLoopGroupMetrics, eventLoopGroupMetrics); + + channelDeps.set(ZuulDependencyKeys.sslClientCertCheckChannelHandlerProvider, new NullChannelHandlerProvider()); + channelDeps.set(ZuulDependencyKeys.rateLimitingChannelHandlerProvider, new NullChannelHandlerProvider()); + } + + protected void addChannelDependencies( + ChannelConfig channelDeps, + @SuppressWarnings("unused") ListenerSpec listenerSpec) { // listenerSpec may be overriden by subclasses channelDeps.set(ZuulDependencyKeys.registry, registry); channelDeps.set(ZuulDependencyKeys.applicationInfoManager, applicationInfoManager);