Skip to content

Commit 24d2b75

Browse files
committed
Fix
1 parent 9ca02dc commit 24d2b75

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

grpc-server-spring-boot-autoconfigure/src/main/java/net/devh/boot/grpc/server/serverfactory/NettyGrpcServerFactory.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333

3434
import io.grpc.netty.GrpcSslContexts;
3535
import io.grpc.netty.NettyServerBuilder;
36+
import io.netty.channel.epoll.EpollEventLoopGroup;
3637
import io.netty.channel.epoll.EpollServerDomainSocketChannel;
3738
import io.netty.channel.unix.DomainSocketAddress;
3839
import io.netty.handler.ssl.SslContextBuilder;
@@ -66,7 +67,9 @@ protected NettyServerBuilder newServerBuilder() {
6667
if (address.startsWith(GrpcServerProperties.DOMAIN_SOCKET_ADDRESS_PREFIX)) {
6768
return NettyServerBuilder
6869
.forAddress(new DomainSocketAddress(address.substring(GrpcServerProperties.DOMAIN_SOCKET_ADDRESS_PREFIX.length())))
69-
.channelType(EpollServerDomainSocketChannel.class);
70+
.channelType(EpollServerDomainSocketChannel.class)
71+
.bossEventLoopGroup(new EpollEventLoopGroup(1))
72+
.workerEventLoopGroup(new EpollEventLoopGroup());
7073
} else if (GrpcServerProperties.ANY_IP_ADDRESS.equals(address)) {
7174
return NettyServerBuilder.forPort(port);
7275
} else {

grpc-server-spring-boot-autoconfigure/src/main/java/net/devh/boot/grpc/server/serverfactory/ShadedNettyGrpcServerFactory.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333

3434
import io.grpc.netty.shaded.io.grpc.netty.GrpcSslContexts;
3535
import io.grpc.netty.shaded.io.grpc.netty.NettyServerBuilder;
36+
import io.grpc.netty.shaded.io.netty.channel.epoll.EpollEventLoopGroup;
3637
import io.grpc.netty.shaded.io.netty.channel.epoll.EpollServerDomainSocketChannel;
3738
import io.grpc.netty.shaded.io.netty.channel.unix.DomainSocketAddress;
3839
import io.grpc.netty.shaded.io.netty.handler.ssl.SslContextBuilder;
@@ -67,7 +68,9 @@ protected NettyServerBuilder newServerBuilder() {
6768
if (address.startsWith(GrpcServerProperties.DOMAIN_SOCKET_ADDRESS_PREFIX)) {
6869
return NettyServerBuilder
6970
.forAddress(new DomainSocketAddress(address.substring(GrpcServerProperties.DOMAIN_SOCKET_ADDRESS_PREFIX.length())))
70-
.channelType(EpollServerDomainSocketChannel.class);
71+
.channelType(EpollServerDomainSocketChannel.class)
72+
.bossEventLoopGroup(new EpollEventLoopGroup(1))
73+
.workerEventLoopGroup(new EpollEventLoopGroup());
7174
} else if (GrpcServerProperties.ANY_IP_ADDRESS.equals(address)) {
7275
return NettyServerBuilder.forPort(port);
7376
} else {

0 commit comments

Comments
 (0)