Skip to content

Commit 16faff3

Browse files
committed
Enable Netty Grpc client to reuse the existing Netty allocator
1 parent 245d076 commit 16faff3

File tree

1 file changed

+6
-0
lines changed
  • extensions/grpc/runtime/src/main/java/io/quarkus/grpc/runtime/supports

1 file changed

+6
-0
lines changed

extensions/grpc/runtime/src/main/java/io/quarkus/grpc/runtime/supports/Channels.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,12 @@ public static Channel createChannel(String name, Set<String> perClientIntercepto
211211
// just use the existing Vertx event loop group, if possible
212212
Vertx vertx = container.instance(Vertx.class).get();
213213
if (vertx != null) {
214+
// see https://github.com/eclipse-vertx/vert.x/pull/5292
215+
boolean reuseNettyAllocators = Boolean.getBoolean("vertx.reuseNettyAllocators");
216+
if (reuseNettyAllocators) {
217+
// let Netty Grpc to re-use the default Netty allocator as well
218+
System.setProperty("io.grpc.netty.useCustomAllocator", "false");
219+
}
214220
ncBuilder = ncBuilder.eventLoopGroup(vertx.nettyEventLoopGroup());
215221
}
216222
builder = ncBuilder

0 commit comments

Comments
 (0)