From 7714d0b61e8d91fbb99d7de18cb0ba0db31e3a63 Mon Sep 17 00:00:00 2001 From: Joe Di Pol Date: Wed, 13 Nov 2024 16:48:41 -0800 Subject: [PATCH] Upgrade grpc-java to 1.65.1. Move from protobuf-lite to protobuf --- dependencies/pom.xml | 2 +- grpc/core/pom.xml | 4 ++++ .../java/io/helidon/grpc/core/MarshallerSupplier.java | 10 +++++----- grpc/core/src/main/java/module-info.java | 1 - .../grpc/server/src/main/java/module-info.java | 1 - 5 files changed, 10 insertions(+), 8 deletions(-) diff --git a/dependencies/pom.xml b/dependencies/pom.xml index b57e39d12fa..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 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..4f48fa532ea 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 @@ -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..8c68f292753 100644 --- a/grpc/core/src/main/java/module-info.java +++ b/grpc/core/src/main/java/module-info.java @@ -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..798a8501730 100644 --- a/microprofile/grpc/server/src/main/java/module-info.java +++ b/microprofile/grpc/server/src/main/java/module-info.java @@ -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;