use of net.devh.boot.grpc.server.serverfactory.GrpcServerConfigurer in project hedera-mirror-node by hashgraph.
the class GrpcConfiguration method grpcServerConfigurer.
@Bean
GrpcServerConfigurer grpcServerConfigurer(GrpcProperties grpcProperties) {
NettyProperties nettyProperties = grpcProperties.getNetty();
Executor executor = new ThreadPoolExecutor(nettyProperties.getExecutorCoreThreadCount(), nettyProperties.getExecutorMaxThreadCount(), nettyProperties.getThreadKeepAliveTime().toSeconds(), TimeUnit.SECONDS, new SynchronousQueue<>(), new ThreadFactoryBuilder().setDaemon(true).setNameFormat("grpc-executor-%d").build());
return serverBuilder -> ((NettyServerBuilder) serverBuilder).executor(executor).maxConnectionIdle(nettyProperties.getMaxConnectionIdle().toSeconds(), TimeUnit.SECONDS).maxConcurrentCallsPerConnection(nettyProperties.getMaxConcurrentCallsPerConnection()).maxInboundMessageSize(nettyProperties.getMaxInboundMessageSize()).maxInboundMetadataSize(nettyProperties.getMaxInboundMetadataSize());
}
Aggregations