use of com.netflix.zuul.netty.ratelimiting.NullChannelHandlerProvider in project zuul by Netflix.
the class BaseServerStartup method addChannelDependencies.
protected void addChannelDependencies(ChannelConfig channelDeps, @SuppressWarnings("unused") String listenAddressName) {
// listenAddressName is used by subclasses
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());
}
use of com.netflix.zuul.netty.ratelimiting.NullChannelHandlerProvider in project zuul by Netflix.
the class BaseZuulChannelInitializerTest method tcpHandlersAdded_withProxyProtocol.
@Test
public void tcpHandlersAdded_withProxyProtocol() {
ChannelConfig channelConfig = new ChannelConfig();
channelConfig.set(CommonChannelConfigKeys.withProxyProtocol, true);
ChannelConfig channelDependencies = new ChannelConfig();
channelDependencies.set(ZuulDependencyKeys.registry, new NoopRegistry());
channelDependencies.set(ZuulDependencyKeys.rateLimitingChannelHandlerProvider, new NullChannelHandlerProvider());
channelDependencies.set(ZuulDependencyKeys.sslClientCertCheckChannelHandlerProvider, new NullChannelHandlerProvider());
ChannelGroup channelGroup = new DefaultChannelGroup(GlobalEventExecutor.INSTANCE);
BaseZuulChannelInitializer init = new BaseZuulChannelInitializer("1234", channelConfig, channelDependencies, channelGroup) {
@Override
protected void initChannel(Channel ch) {
}
};
EmbeddedChannel channel = new EmbeddedChannel();
init.addTcpRelatedHandlers(channel.pipeline());
assertNotNull(channel.pipeline().context(SourceAddressChannelHandler.class));
assertNotNull(channel.pipeline().context(PerEventLoopMetricsChannelHandler.Connections.class));
assertNotNull(channel.pipeline().context(ElbProxyProtocolChannelHandler.NAME));
assertNotNull(channel.pipeline().context(MaxInboundConnectionsHandler.class));
}
use of com.netflix.zuul.netty.ratelimiting.NullChannelHandlerProvider in project zuul by Netflix.
the class BaseZuulChannelInitializerTest method tcpHandlersAdded.
@Test
public void tcpHandlersAdded() {
ChannelConfig channelConfig = new ChannelConfig();
ChannelConfig channelDependencies = new ChannelConfig();
channelDependencies.set(ZuulDependencyKeys.registry, new NoopRegistry());
channelDependencies.set(ZuulDependencyKeys.rateLimitingChannelHandlerProvider, new NullChannelHandlerProvider());
channelDependencies.set(ZuulDependencyKeys.sslClientCertCheckChannelHandlerProvider, new NullChannelHandlerProvider());
ChannelGroup channelGroup = new DefaultChannelGroup(GlobalEventExecutor.INSTANCE);
BaseZuulChannelInitializer init = new BaseZuulChannelInitializer("1234", channelConfig, channelDependencies, channelGroup) {
@Override
protected void initChannel(Channel ch) {
}
};
EmbeddedChannel channel = new EmbeddedChannel();
init.addTcpRelatedHandlers(channel.pipeline());
assertNotNull(channel.pipeline().context(SourceAddressChannelHandler.class));
assertNotNull(channel.pipeline().context(PerEventLoopMetricsChannelHandler.Connections.class));
assertNotNull(channel.pipeline().context(ElbProxyProtocolChannelHandler.NAME));
assertNotNull(channel.pipeline().context(MaxInboundConnectionsHandler.class));
}
use of com.netflix.zuul.netty.ratelimiting.NullChannelHandlerProvider in project zuul by Netflix.
the class BaseZuulChannelInitializerTest method serverStateHandlerAdded.
@Test
public void serverStateHandlerAdded() {
ChannelConfig channelConfig = new ChannelConfig();
ChannelConfig channelDependencies = new ChannelConfig();
channelDependencies.set(ZuulDependencyKeys.registry, new NoopRegistry());
channelDependencies.set(ZuulDependencyKeys.rateLimitingChannelHandlerProvider, new NullChannelHandlerProvider());
channelDependencies.set(ZuulDependencyKeys.sslClientCertCheckChannelHandlerProvider, new NullChannelHandlerProvider());
ChannelGroup channelGroup = new DefaultChannelGroup(GlobalEventExecutor.INSTANCE);
BaseZuulChannelInitializer init = new BaseZuulChannelInitializer("1234", channelConfig, channelDependencies, channelGroup) {
@Override
protected void initChannel(Channel ch) {
}
};
EmbeddedChannel channel = new EmbeddedChannel();
init.addPassportHandler(channel.pipeline());
assertNotNull(channel.pipeline().context(ServerStateHandler.InboundHandler.class));
assertNotNull(channel.pipeline().context(ServerStateHandler.OutboundHandler.class));
}
Aggregations