Skip to content

Using InternalMetadata class in Armeria #5788

Open
@anuraaga

Description

@anuraaga

Hi all.

As some of you may have seen, Armeria team mantains a Java implementation of gRPC that runs on top of the Armeria server framework, a generic HTTP/1+2 server framework built on Netty (made by our good friend @trustin himself :) )

We interface with protoc stubs by creating Call objects and starting them - after started, a Call goes through io.grpc business logic as normal in most cases with surprisingly few gotchas. The Call interface is a quite nice plugin point.

https://github.com/line/armeria/blob/master/grpc/src/main/java/com/linecorp/armeria/server/grpc/ArmeriaServerCall.java

We have one major caveat though, no support for the Metadata class

https://github.com/line/armeria/blob/master/grpc/src/main/java/com/linecorp/armeria/server/grpc/GrpcService.java#L77

While Armeria has its own methods for adding response trailers, we're finding more and more users would like to be able to use it so their existing gRPC business logic can run as-is on Armeria, and if possible I'd like to achieve that. It means I need to use InternalMetadata to be able to create and serialize Metadata.

Is it kosher for Armeria to use this class? I understand it is for "specifically supported transport packages" - if Armeria could be considered a specifically supported transport package, that would be great! But if it's not possible to have official support like that, if it's "at your own risk but should be ok" that'd be fine too. For context, the first version of our implementation used a lot of io.grpc.internal classes to try to minimize code duplication - that was naturally a nightmare to maintain and I'm hoping not to repeat my mistake ;)

Also, as an alternative or in addition, any thoughts on making Metadata an interface and letting implementations control the serialization themselves? If that happened, we wouldn't need to use InternalMetadata either.

Thanks!

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions