Search in sources :

Example 1 with InboundContainerStatisticsCollectingHandler

use of com.linkedin.databus2.core.container.netty.InboundContainerStatisticsCollectingHandler 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;
}
Also used : ConnectionChannelRegistrationHandler(com.linkedin.databus2.core.container.netty.ConnectionChannelRegistrationHandler) LoggingHandler(org.jboss.netty.handler.logging.LoggingHandler) HttpRequestLoggingHandler(com.linkedin.databus2.core.container.HttpRequestLoggingHandler) ExtendedReadTimeoutHandler(com.linkedin.databus2.core.container.ExtendedReadTimeoutHandler) ExtendedWriteTimeoutHandler(com.linkedin.databus2.core.container.ExtendedWriteTimeoutHandler) HttpClientCodec(org.jboss.netty.handler.codec.http.HttpClientCodec) HttpRequestLoggingHandler(com.linkedin.databus2.core.container.HttpRequestLoggingHandler) ChannelPipeline(org.jboss.netty.channel.ChannelPipeline) InboundContainerStatisticsCollectingHandler(com.linkedin.databus2.core.container.netty.InboundContainerStatisticsCollectingHandler) HttpContentDecompressor(org.jboss.netty.handler.codec.http.HttpContentDecompressor)

Aggregations

ExtendedReadTimeoutHandler (com.linkedin.databus2.core.container.ExtendedReadTimeoutHandler)1 ExtendedWriteTimeoutHandler (com.linkedin.databus2.core.container.ExtendedWriteTimeoutHandler)1 HttpRequestLoggingHandler (com.linkedin.databus2.core.container.HttpRequestLoggingHandler)1 ConnectionChannelRegistrationHandler (com.linkedin.databus2.core.container.netty.ConnectionChannelRegistrationHandler)1 InboundContainerStatisticsCollectingHandler (com.linkedin.databus2.core.container.netty.InboundContainerStatisticsCollectingHandler)1 ChannelPipeline (org.jboss.netty.channel.ChannelPipeline)1 HttpClientCodec (org.jboss.netty.handler.codec.http.HttpClientCodec)1 HttpContentDecompressor (org.jboss.netty.handler.codec.http.HttpContentDecompressor)1 LoggingHandler (org.jboss.netty.handler.logging.LoggingHandler)1