You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a service that listens to N Kafka topics. We'd like to put this service behind a gRPC "gateway", where callers send us the message to write to Kafka and a header for which topic to write to. This service handles a lot of load, so we need to make this gateway as efficient as possible. Given that, we don't want to waste resources decoding a message that is just going to be re-encoded right away. Is it possible to use codegen and receive a Request<Bytes> in the handler?
I tried writing a custom codec that effectively passes through the bytes. But it seems the input type generation is based on the gRPC file.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I have a service that listens to N Kafka topics. We'd like to put this service behind a gRPC "gateway", where callers send us the message to write to Kafka and a header for which topic to write to. This service handles a lot of load, so we need to make this gateway as efficient as possible. Given that, we don't want to waste resources decoding a message that is just going to be re-encoded right away. Is it possible to use codegen and receive a
Request<Bytes>
in the handler?I tried writing a custom codec that effectively passes through the bytes. But it seems the input type generation is based on the gRPC file.
Codec:
proto file:
build.rs
:And here is what I was hoping the trait would look like:
but the
request
type isRequest<ImportNotificationEvent>
. Is there anyway to do this save writing aService
manually?Beta Was this translation helpful? Give feedback.
All reactions