Giriş
Şu satırı dahil ederiz
import io.grpc.netty.NettyServerBuilder;
Şöyle yaparız
public void start() throws IOException {
server = NettyServerBuilder.forPort(5001)
.bossEventLoopGroup(new NioEventLoopGroup(1))
.workerEventLoopGroup(new NioEventLoopGroup(5))
.channelType(NioServerSocketChannel.class)
.executor(Executors.newFixedThreadPool(5,
new ThreadFactoryBuilder().setNameFormat("grpc-%d").build()))
.addService(new GrpcApi())
.build()
.start();
}
Hiç yorum yok:
Yorum Gönder