fs2-grpc icon indicating copy to clipboard operation
fs2-grpc copied to clipboard

Add trailers metadata support in unary response methods

Open TalkingFoxMid opened this issue 1 year ago • 2 comments

Summary

This merge request introduces the capability for servers to send custom metadata (trailers) in responses for unaryToUnary and clientStreaming methods using the fs2.grpc library. Prior to this change, metadata was automatically filled with empty values, with no option for the server to specify or send custom metadata. This enhancement opens up the flexibility for server implementations to include additional information in their responses, providing a richer communication protocol between clients and servers.

Changes

In this Merge Request, the generation of additional traits and objects with the "Trailers" suffix is added, supporting GRPC trailers metadata. In the signature of the newly generated traits, two methods are modified: noStreaming and clientStreaming. This means that, in these two types of GRPC handlers, the server will be able to specify which metadata it wishes to return, and the client will be able to retrieve this metadata

TalkingFoxMid avatar Mar 07 '24 12:03 TalkingFoxMid

@ahjohannessen will check?

TalkingFoxMid avatar Mar 29 '24 07:03 TalkingFoxMid

I do not have the bandwidth to review currently, unfortunately :/ I can take a look when I find the time.

ahjohannessen avatar Apr 05 '24 10:04 ahjohannessen

Hi @ahjohannessen

We are also interested in this feature. Is there any hope that you will do a review soon?

a-khakimov avatar May 28 '24 10:05 a-khakimov

@TalkingFoxMid Can you remove the companion object of Fs2GrpcServicePrinter as the constants are now in the abstract printer's companion.

Edit: Nevermind, I'll merge and remove it.

ahjohannessen avatar May 29 '24 09:05 ahjohannessen

Did a v2.7.15 release - Should be on sonatype soon.

ahjohannessen avatar May 29 '24 09:05 ahjohannessen