use of com.jim.framework.rpc.keepalive.ServerHeartbeatHandler in project jim-framework by jiangmin168168.
the class RpcServerInitializer method initChannel.
@Override
protected void initChannel(SocketChannel socketChannel) throws Exception {
// logger.info("RpcServerInitializer.initChannel");
ChannelPipeline pipeline = socketChannel.pipeline();
;
Executor executor = this.rpcThreadPoolFactory.getThreadPool(ConstantConfig.DEFAULT_THREAD_POOL_NAME).getExecutor(1, 1);
pipeline.addLast(new RpcEncoder(RpcResponse.class)).addLast(new RpcDecoder(RpcRequest.class)).addLast(new IdleStateHandler(Constants.READER_TIME_SECONDS, 0, 0)).addLast(new ServerHeartbeatHandler()).addLast(new RpcServerInvoker(this.handlerMap, this.filterMap, executor));
}
Aggregations