Skip to content

Commit

Permalink
wire new listener spec through channel deps
Browse files Browse the repository at this point in the history
  • Loading branch information
argha-c committed Oct 3, 2024
1 parent 76b2dac commit 85ffa0d
Showing 1 changed file with 26 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 85ffa0d

Please sign in to comment.