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

Support BINARY format

Open carlosalberto opened this issue 5 years ago • 4 comments

As per this only TEXT_MAP format is supported.

I think support for BINARY could be added as an option for the user to explicitly specify, and keep TEXT_MAP as the default.

carlosalberto avatar Mar 05 '20 19:03 carlosalberto

cc @spiliopoulos

carlosalberto avatar Mar 05 '20 19:03 carlosalberto

I don't see how we can add support for Binary. Binary adapters requires ByteBuffer. We inject/extract context to/from Metadata. But Metadata doesn't provide access to byte array or byte buffer.

malafeev avatar Mar 06 '20 08:03 malafeev

What about https://github.com/grpc/grpc-java/blob/master/api/src/main/java/io/grpc/Metadata.java#L76 ? Would that help? Let me know. If it's truly not possible, lets close this item.

Else we can keep it as a potential enhancement ;) (not an urgent thing, that is)

carlosalberto avatar Apr 13 '20 15:04 carlosalberto

I think I need more time to evaluate how binary context can be injected. I didn't see usage of it in java instrumentations.

malafeev avatar Apr 14 '20 15:04 malafeev