Skip to content

Commit bd01b27

Browse files
therepaniconobc
authored andcommitted
Avoid deprecated EpollEventLoopGroup usage
Replaces EpollEventLoopGroup with MultiThreadIoEventLoopGroup configured via EpollIoHandler factory. This aligns with the Netty 5 IO handler architecture and avoids usage of deprecated epoll transport APIs. Signed-off-by: Andrey Litvitski <[email protected]>
1 parent ead6016 commit bd01b27

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

spring-grpc-core/src/main/java/org/springframework/grpc/client/NettyGrpcChannelFactory.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,16 @@
2020

2121
import io.grpc.ChannelCredentials;
2222
import io.grpc.netty.NettyChannelBuilder;
23+
import io.netty.channel.MultiThreadIoEventLoopGroup;
2324
import io.netty.channel.epoll.EpollDomainSocketChannel;
24-
import io.netty.channel.epoll.EpollEventLoopGroup;
25+
import io.netty.channel.epoll.EpollIoHandler;
2526
import io.netty.channel.unix.DomainSocketAddress;
2627

2728
/**
2829
* {@link GrpcChannelFactory} that creates Netty-based gRPC channels.
2930
*
3031
* @author Chris Bono
32+
* @author Andrey Litvitski
3133
*/
3234
public class NettyGrpcChannelFactory extends DefaultGrpcChannelFactory<NettyChannelBuilder> {
3335

@@ -48,7 +50,7 @@ protected NettyChannelBuilder newChannelBuilder(String target, ChannelCredential
4850
target = target.substring(5);
4951
return NettyChannelBuilder.forAddress(new DomainSocketAddress(target))
5052
.channelType(EpollDomainSocketChannel.class)
51-
.eventLoopGroup(new EpollEventLoopGroup());
53+
.eventLoopGroup(new MultiThreadIoEventLoopGroup(EpollIoHandler.newFactory()));
5254
}
5355
return NettyChannelBuilder.forTarget(target, credentials);
5456
}

0 commit comments

Comments
 (0)