-
Notifications
You must be signed in to change notification settings - Fork 914
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Server fails to start with a grpc service for a proto2 proto that contains an enum. #4020
Comments
First off, I believe this is a regression and we probably want Cause armeria/grpc/src/main/java/com/linecorp/armeria/server/grpc/FramedGrpcService.java Lines 128 to 136 in 21be2a4
Workaround If we don't initialize the server with serialization formats of
For users who don't need json marshalling support, this may be a valid workaround (verified by going through the code + integration tests) Additional notes Additionally, we may look into protobuf-jackson and look for the root cause (and hopefully add support for |
curioswitch/protobuf-jackson#8 Independent of above, we might want to find a way to conditionally ignore |
…ion failure (#4033) Motivation: Currently, armeria server fails to start up while trying to create a `MessageMarshaller` for `proto2` files containing `Enum` definitions. It seems like [protobuf-jackson](curioswitch/protobuf-jackson#8) doesn't support `proto2`. However, it seems like upstream at least partially supports `proto2`. https://developers.google.com/protocol-buffers/docs/reference/java/com/google/protobuf/util/JsonFormat > The JSON format follows Proto3 JSON specification and only proto3 features are supported. Proto2 only features (e.g., extensions and unknown fields) will be discarded in the conversion. That is, when converting proto2 messages to JSON format, extensions and unknown fields will be treated as if they do not exist. This applies to proto2 messages embedded in proto3 messages as well. Modifications: - Introduce a `GsonGrpcJsonMarshaller` which performs JSON marshalling using Gson. - Also introduce a corresponding builder class `GrpcJsonMarshallerBuilder` - Add `GrpcJsonMarshaller#ofJackson`, `GrpcJsonMarshaller#builderForJackson`, `GrpcJsonMarshaller#ofGson`, `GrpcJsonMarshaller#builderForGson` Result: - Closes #4020 - Armeria now provides an easy way to fall back to the upstream `gson` implementation
When starting, the server crashes with a java.lang.NoSuchMethodException
To replicate, use the grpc example in armeria-exemples and modify the hello.proto to:
Run the application and you should get an error message like this:
The handling of enums seems to be incorrect. There should be no error and the service should work.
The text was updated successfully, but these errors were encountered: