He-Pin commented on code in PR #3651:
URL: https://github.com/apache/pekko/pull/3651#discussion_r4355862927
##########
remote/src/main/resources/reference.conf:
##########
@@ -42,6 +42,8 @@ pekko {
# This com.google.protobuf serialization binding is only used if the
class can be loaded,
# i.e. com.google.protobuf dependency has been added in the application
project.
"com.google.protobuf.GeneratedMessage" = proto
+ # optional binding, only used if the ScalaPB dependency has been added
in the application project
+ "scalapb.GeneratedMessage" = proto
Review Comment:
The default binding currently serializes real ScalaPB messages but fails to
deserialize them. `ProtobufSerializer.scala:41-44` requires a static
`parseFrom(byte[])` returning the concrete message class; ScalaPB's forwarder
returns erased `scalapb.GeneratedMessage` (confirmed in 0.11.4, 0.11.17, and
0.11.21).
Against this head, `com.google.protobuf.empty.Empty` selects serializer id 2
and encodes, then decoding throws `NoSuchMethodException: ...
Empty.parseFrom(byte[])Empty/invokeStatic`. The added test only checks the
absent-runtime path.
Please resolve the actual parser return type while retaining existing
protobuf access behavior, and test a real generated-message round trip. Move
the absent-runtime check to an isolated classpath once ScalaPB is a test
dependency. An incremental fix based on this PR is prepared; all 15 focused
tests pass and its final review is in progress.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]