Merged
Conversation
Signed-off-by: Anthony Petrov <anthony@swirldslabs.com>
jsync-swirlds
approved these changes
Mar 31, 2026
Member
jsync-swirlds
left a comment
There was a problem hiding this comment.
Thank you for completing this quickly.
imalygin
approved these changes
Mar 31, 2026
timfn-hg
approved these changes
Mar 31, 2026
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.
Description:
Adding support for passing GRPC metadata from a PBJ GRPC Client to a service and accessing the metadata in a PBJ GRPC Service implementation. Key changes:
Map<String, String> ServiceInterface.RequestOptions.metadata()to hold the metadataServiceInterface.*service methods have overridden versions with the additionalRequestOptionsargument added. Their default implementations delegate to the versions of the methods w/o theRequestOptionsargument. While the latter legacy methods also have default implementations that throwUnsupportedOperationException. This way, the interface change is backward-compatible and existing services don't need to change, until/unless they want to start accessing the metadata.RequestOptionsobject, and also supports the newly introduced overridden versions that accept per-requestRequestOptionsobjects. So the client is free to either create new stubs for new metadata, or simply pass a newRequestOptionsinstance to a service call method.Excerpts from the generated
GreeterInterface.javafor the unary method (streaming methods have similar changes):See the new integration test for usage example.
Related issue(s):
Fixes #765
Notes for reviewer:
Checklist