Search in sources :

Example 1 with SimpleBinaryDatabusResponseEncoder

use of com.linkedin.databus2.core.container.request.SimpleBinaryDatabusResponseEncoder in project databus by linkedin.

the class TcpServerPipelineFactory method getPipeline.

@Override
public ChannelPipeline getPipeline() throws Exception {
    // Create a default pipeline implementation.
    ChannelPipeline pipeline = pipeline();
    pipeline.addLast("auto group register ", new ConnectionChannelRegistrationHandler(_serverContainer.getTcpChannelGroup()));
    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()));
    ExtendedWriteTimeoutHandler writeTimeoutHandler = new ExtendedWriteTimeoutHandler("server container " + _serverContainer.getContainerStaticConfig().getId(), _serverContainer.getNetworkTimeoutTimer(), _serverContainer.getContainerStaticConfig().getWriteTimeoutMs(), true);
    ExtendedReadTimeoutHandler readTimeoutHandler = new ExtendedReadTimeoutHandler("server container " + _serverContainer.getContainerStaticConfig().getId(), _serverContainer.getNetworkTimeoutTimer(), _serverContainer.getContainerStaticConfig().getReadTimeoutMs(), true);
    pipeline.addLast("read timeout", readTimeoutHandler);
    //add a handler to deal with write timeouts
    pipeline.addLast("server container write timeout handler", writeTimeoutHandler);
    pipeline.addLast("decoder", new SimpleBinaryDatabusRequestDecoder(_serverContainer.getCommandsRegistry(), readTimeoutHandler, _byteOrder));
    pipeline.addLast("encoder", new SimpleBinaryDatabusResponseEncoder());
    // Fix for DDSDBUS-1000
    //    pipeline.addLast("executionHandler", _serverContainer.getNettyExecHandler());
    //Dummy handler that will be automatically replaced depending on the current command being
    //executed
    pipeline.addLast(SimpleBinaryDatabusRequestDecoder.REQUEST_EXEC_HANDLER_NAME, new LoggingHandler("netty server traffic", InternalLogLevel.DEBUG, true));
    return pipeline;
}
Also used : LoggingHandler(org.jboss.netty.handler.logging.LoggingHandler) ExtendedWriteTimeoutHandler(com.linkedin.databus2.core.container.ExtendedWriteTimeoutHandler) ExtendedReadTimeoutHandler(com.linkedin.databus2.core.container.ExtendedReadTimeoutHandler) SimpleBinaryDatabusRequestDecoder(com.linkedin.databus2.core.container.request.SimpleBinaryDatabusRequestDecoder) SimpleBinaryDatabusResponseEncoder(com.linkedin.databus2.core.container.request.SimpleBinaryDatabusResponseEncoder) ChannelPipeline(org.jboss.netty.channel.ChannelPipeline)

Aggregations

ExtendedReadTimeoutHandler (com.linkedin.databus2.core.container.ExtendedReadTimeoutHandler)1 ExtendedWriteTimeoutHandler (com.linkedin.databus2.core.container.ExtendedWriteTimeoutHandler)1 SimpleBinaryDatabusRequestDecoder (com.linkedin.databus2.core.container.request.SimpleBinaryDatabusRequestDecoder)1 SimpleBinaryDatabusResponseEncoder (com.linkedin.databus2.core.container.request.SimpleBinaryDatabusResponseEncoder)1 ChannelPipeline (org.jboss.netty.channel.ChannelPipeline)1 LoggingHandler (org.jboss.netty.handler.logging.LoggingHandler)1