use of com.linkedin.databus2.core.container.HttpRequestLoggingHandler in project databus by linkedin.
the class HttpServerPipelineFactory method getPipeline.
@Override
public ChannelPipeline getPipeline() throws Exception {
// TODO DDS-305: Rework the netty stats collector to use event-based stats aggregation
/* NettyStats nettyStats = _serverContainer.getNettyStats();
CallCompletion getPipelineCompletion = nettyStats.isEnabled() ?
nettyStats.getPipelineFactory_GetPipelineCallTracker().startCall() :
null;*/
// Create a default pipeline implementation.
ChannelPipeline pipeline = pipeline();
// pipeline.addLast("in traffic",
// new LoggingHandler("in traffic", InternalLogLevel.INFO, true));
pipeline.addLast("auto group register ", new ConnectionChannelRegistrationHandler(_serverContainer.getHttpChannelGroup()));
if (Logger.getRootLogger().isTraceEnabled()) {
pipeline.addLast("netty server traffic", new LoggingHandler("netty server traffic", InternalLogLevel.DEBUG, true));
}
pipeline.addLast("outbound statistics collector", new OutboundContainerStatisticsCollectingHandler(_serverContainer.getContainerStatsCollector()));
pipeline.addLast("decoder", new HttpRequestDecoder());
pipeline.addLast("encoder", new HttpResponseEncoder());
pipeline.addLast("http logger", new HttpRequestLoggingHandler());
ExtendedReadTimeoutHandler readTimeoutHandler = new ExtendedReadTimeoutHandler("server container " + _serverContainer.getContainerStaticConfig().getId(), _serverContainer.getNetworkTimeoutTimer(), _serverContainer.getContainerStaticConfig().getReadTimeoutMs(), true);
HttpRequestHandler reqHandler = new HttpRequestHandler(_serverContainer, readTimeoutHandler);
pipeline.addLast("handler", reqHandler);
if (_serverContainer.getContainerStaticConfig().getEnableHttpCompression()) {
pipeline.addLast("deflater", new HttpContentCompressor());
}
pipeline.addLast("executionHandler", _serverContainer.getNettyExecHandler());
DatabusRequestExecutionHandler dbusRequestHandler = new DatabusRequestExecutionHandler(_serverContainer);
pipeline.addLast("databusRequestRunner", dbusRequestHandler);
// add a handler to deal with write timeouts
pipeline.addLast("server container write timeout handler", new ExtendedWriteTimeoutHandler("server container " + _serverContainer.getContainerStaticConfig().getId(), _serverContainer.getNetworkTimeoutTimer(), _serverContainer.getContainerStaticConfig().getWriteTimeoutMs(), true));
return pipeline;
}
use of com.linkedin.databus2.core.container.HttpRequestLoggingHandler in project databus by linkedin.
the class GenericHttpClientPipelineFactory method getPipeline.
@Override
public ChannelPipeline getPipeline() throws Exception {
// Create a default pipeline implementation.
ChannelPipeline pipeline = pipeline();
if (_channelGroup != null)
pipeline.addLast("auto group register ", new ConnectionChannelRegistrationHandler(_channelGroup));
if (Logger.getRootLogger().isTraceEnabled()) {
LOG.debug("Adding Netty tracing");
pipeline.addLast("netty client traffic", new LoggingHandler("netty client traffic", InternalLogLevel.DEBUG, true));
}
if (null != _containerStatsCollector) {
pipeline.addLast("inbound statistics collector", new InboundContainerStatisticsCollectingHandler(_containerStatsCollector));
}
ExtendedReadTimeoutHandler readTimeoutHandler = new ExtendedReadTimeoutHandler("client call ", _timeoutTimer, _readTimeoutMs, true);
pipeline.addLast(READ_TIMEOUT_HANDLER_NAME, readTimeoutHandler);
pipeline.addLast("codec", new HttpClientCodec());
pipeline.addLast("http logger", new HttpRequestLoggingHandler());
// Remove the following line if you don't want automatic content decompression.
pipeline.addLast("inflater", new HttpContentDecompressor());
// pipeline.addLast("handler", new GenericHttpResponseHandler(_responseProcessor, _keepAlive));
pipeline.addLast("handler", _handler);
// add a handler to deal with write timeouts
pipeline.addLast("client request write timeout handler", new ExtendedWriteTimeoutHandler("netty client traffic", _timeoutTimer, _writeTimeoutMs, true));
return pipeline;
}
Aggregations