Skip to content

Commit

Permalink
Upgrade grpc-java to 1.65.1. Move from protobuf-lite to protobuf
Browse files Browse the repository at this point in the history
  • Loading branch information
barchetta committed Nov 14, 2024
1 parent 8f05c14 commit 7714d0b
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion dependencies/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
<version.lib.graphql-java>22.1</version.lib.graphql-java>
<version.lib.graphql-java.extended.scalars>22.0</version.lib.graphql-java.extended.scalars>
<version.lib.gson>2.9.0</version.lib.gson>
<version.lib.grpc>1.60.0</version.lib.grpc>
<version.lib.grpc>1.65.1</version.lib.grpc>
<version.lib.guava>32.0.1-jre</version.lib.guava>
<version.lib.h2>2.1.212</version.lib.h2>
<version.lib.hamcrest>1.3</version.lib.hamcrest>
Expand Down
4 changes: 4 additions & 0 deletions grpc/core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@
<groupId>io.grpc</groupId>
<artifactId>grpc-inprocess</artifactId>
</dependency>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-util</artifactId>
</dependency>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-netty</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/**
Expand Down Expand Up @@ -68,7 +68,7 @@ class DefaultMarshallerSupplier

@Override
public <T> MethodDescriptor.Marshaller<T> get(Class<T> clazz) {
if (MessageLite.class.isAssignableFrom(clazz)) {
if (Message.class.isAssignableFrom(clazz)) {
return proto.get(clazz);
}
String msg = String.format(
Expand All @@ -91,9 +91,9 @@ class ProtoMarshallerSupplier
public <T> MethodDescriptor.Marshaller<T> get(Class<T> 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<T>) ProtoLiteUtils.marshaller(instance);
return (MethodDescriptor.Marshaller<T>) 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",
Expand Down
1 change: 0 additions & 1 deletion grpc/core/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion microprofile/grpc/server/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 7714d0b

Please sign in to comment.