Repository navigation
feat: Direct consumption of protobuf messages in consumer - #1131
Merged
Merged
Conversation
patriknw
reviewed
Nov 11, 2025
| def decodeJavaProtobuf[T](payload: BytesPayload, cls: Class[T]): T = { | ||
| if (payload.contentType.startsWith(AnySupport.DefaultTypeUrlPrefix)) { | ||
| val parser = | ||
| parserCache.computeIfAbsent(cls, cls => cls.getMethod("parser").invoke(null).asInstanceOf[Parser[AnyRef]]) |
Contributor
There was a problem hiding this comment.
How does this compare to Akka core's ProtobufSerializer that is looking for method "parseFrom" ?
Contributor
Author
There was a problem hiding this comment.
The parser is a static final field PARSER, so this is just picking that up for repeated use, while parseFrom uses that field directly doing PARSER.parseFrom(data). No big difference either way.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Feature to ease integration between existing Kalix services and Akka services, this allows Akka consumers to accept message types generated by protobuf Java, emitted by a Kalix service.