From e76e4bb2128b2d31d5851af1bd58f9b6f2351a47 Mon Sep 17 00:00:00 2001 From: Joe DiPol Date: Sat, 16 Nov 2024 09:40:18 -0800 Subject: [PATCH] 3.x: netty 4.1.115, grpc-java 1.65.1 (#9498) * Upgrade dependency check plugin to 11.1.0 * Upgrade Netty to 4.1.115 * Upgrade grpc-java to 1.65.1. Move from protobuf-lite to protobuf * Fix native-image build for Netty 4.1.115 --- dependencies/pom.xml | 4 ++-- grpc/core/pom.xml | 4 ++++ .../io/helidon/grpc/core/MarshallerSupplier.java | 12 ++++++------ grpc/core/src/main/java/module-info.java | 3 +-- .../grpc/server/src/main/java/module-info.java | 3 +-- pom.xml | 2 +- .../helidon-webserver/native-image.properties | 1 + 7 files changed, 16 insertions(+), 13 deletions(-) diff --git a/dependencies/pom.xml b/dependencies/pom.xml index 6c502500ade..38d0a26bccf 100644 --- a/dependencies/pom.xml +++ b/dependencies/pom.xml @@ -61,7 +61,7 @@ 22.1 22.0 2.9.0 - 1.60.0 + 1.65.1 32.0.1-jre 2.1.212 1.3 @@ -128,7 +128,7 @@ 8.2.0 5.12.0.Final 5.12.0 - 4.1.108.Final + 4.1.115.Final 0.0.19.Final 3.46.1 21.15.0.0 diff --git a/grpc/core/pom.xml b/grpc/core/pom.xml index 8024f7e86ab..6ea50e3e7fd 100644 --- a/grpc/core/pom.xml +++ b/grpc/core/pom.xml @@ -57,6 +57,10 @@ io.grpc grpc-inprocess + + io.grpc + grpc-util + io.grpc grpc-netty diff --git a/grpc/core/src/main/java/io/helidon/grpc/core/MarshallerSupplier.java b/grpc/core/src/main/java/io/helidon/grpc/core/MarshallerSupplier.java index 47e14278f76..e1cb03cb5bb 100644 --- a/grpc/core/src/main/java/io/helidon/grpc/core/MarshallerSupplier.java +++ b/grpc/core/src/main/java/io/helidon/grpc/core/MarshallerSupplier.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2022 Oracle and/or its affiliates. + * Copyright (c) 2019, 2024 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,9 +16,9 @@ package io.helidon.grpc.core; -import com.google.protobuf.MessageLite; +import com.google.protobuf.Message; import io.grpc.MethodDescriptor; -import io.grpc.protobuf.lite.ProtoLiteUtils; +import io.grpc.protobuf.ProtoUtils; import jakarta.inject.Named; /** @@ -68,7 +68,7 @@ class DefaultMarshallerSupplier @Override public MethodDescriptor.Marshaller get(Class clazz) { - if (MessageLite.class.isAssignableFrom(clazz)) { + if (Message.class.isAssignableFrom(clazz)) { return proto.get(clazz); } String msg = String.format( @@ -91,9 +91,9 @@ class ProtoMarshallerSupplier public MethodDescriptor.Marshaller get(Class clazz) { try { java.lang.reflect.Method getDefaultInstance = clazz.getDeclaredMethod("getDefaultInstance"); - MessageLite instance = (MessageLite) getDefaultInstance.invoke(clazz); + Message instance = (Message) getDefaultInstance.invoke(clazz); - return (MethodDescriptor.Marshaller) ProtoLiteUtils.marshaller(instance); + return (MethodDescriptor.Marshaller) ProtoUtils.marshaller(instance); } catch (Exception e) { String msg = String.format( "Attempting to use class %s, which is not a valid Protocol buffer message, with a default marshaller", diff --git a/grpc/core/src/main/java/module-info.java b/grpc/core/src/main/java/module-info.java index 93ee54203bd..9d4da6b0663 100644 --- a/grpc/core/src/main/java/module-info.java +++ b/grpc/core/src/main/java/module-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2023 Oracle and/or its affiliates. + * Copyright (c) 2019, 2024 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -33,7 +33,6 @@ requires io.grpc.netty; requires transitive io.grpc.protobuf; - requires io.grpc.protobuf.lite; requires transitive io.grpc.stub; requires transitive io.grpc; requires io.netty.handler; diff --git a/microprofile/grpc/server/src/main/java/module-info.java b/microprofile/grpc/server/src/main/java/module-info.java index 9b28f9214b1..94293912ffd 100644 --- a/microprofile/grpc/server/src/main/java/module-info.java +++ b/microprofile/grpc/server/src/main/java/module-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2023 Oracle and/or its affiliates. + * Copyright (c) 2019, 2024 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -27,7 +27,6 @@ requires io.helidon.microprofile.server; requires io.helidon.config.mp; - requires io.grpc.protobuf.lite; requires com.google.protobuf; requires java.logging; diff --git a/pom.xml b/pom.xml index 6bbd3a48449..3d8498ab908 100644 --- a/pom.xml +++ b/pom.xml @@ -119,7 +119,7 @@ 3.3.0 4.4.2.2 1.11.0 - 10.0.4 + 11.1.0 3.0.0 1.1 2.3 diff --git a/webserver/webserver/src/main/resources/META-INF/native-image/io.helidon.webserver/helidon-webserver/native-image.properties b/webserver/webserver/src/main/resources/META-INF/native-image/io.helidon.webserver/helidon-webserver/native-image.properties index 5c296b9268b..27816cb1f53 100644 --- a/webserver/webserver/src/main/resources/META-INF/native-image/io.helidon.webserver/helidon-webserver/native-image.properties +++ b/webserver/webserver/src/main/resources/META-INF/native-image/io.helidon.webserver/helidon-webserver/native-image.properties @@ -27,6 +27,7 @@ Args=--initialize-at-run-time=io.netty.buffer.UnpooledByteBufAllocator$Instrumen --initialize-at-run-time=io.netty.handler.codec.compression.Lz4FrameDecoder \ --initialize-at-run-time=io.netty.handler.codec.compression.Lz4FrameEncoder \ --initialize-at-run-time=io.netty.handler.codec.compression.LzmaFrameEncoder \ + --initialize-at-run-time=io.netty.handler.codec.compression.Zstd \ --initialize-at-run-time=io.netty.handler.codec.compression.ZstdOptions \ --initialize-at-run-time=io.netty.handler.codec.http.HttpObjectEncoder \ --initialize-at-run-time=io.netty.handler.codec.http2.CleartextHttp2ServerUpgradeHandler \