Passing metadata to service implementation
Nobody has claimed this yet.
- Dominant language
- Kotlin
- Stars
- 4.4k
- Forks
- 627
- Avg merge
- 3d 15m
- Merged PRs (30d)
- 20
Description
I'd like to be able to pass incoming gRPC metadata to a service implementation method - so a request handler can get access to the metadata as part of handling that request. My personal preference would be that it's passed as a parameter to the method, but I'm open to other ideas as well.
Using the sample app as an example, I'd like implementation methods like WhiteboardGrpcAction.Whiteboard() to include the metadata as a parameter:
override fun Whiteboard(
request: MessageSource<WhiteboardCommand>,
- response: MessageSink<WhiteboardUpdate>
+ response: MessageSink<WhiteboardUpdate>,
+ metadata: Metadata
) {
Is this something that is already implemented or could easily be added? Is there an existing way to get access to the incoming request metadata?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the sample implementation at wire-grpc-sample/server/src/main/java/com/squareup/wire/whiteboard/WhiteboardGrpcAction.kt, especially Whiteboard(). Trace how request data reaches the service method and determine whether incoming gRPC metadata is already accessible. Done means service implementations can reliably access that metadata while preserving the existing request and response behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- kotlin
- Domain
- api
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100