Server-side is actually a bigger pain than client-side, but also the
server-side-style approach won't work on client-side.

ClientCall<ReqT, RespT> interceptCall(
    MethodDescriptor<ReqT, RespT> method, CallOptions callOptions, Channel
next) {
  MethodDescriptor isMethod = method.toBuilder()
      .setRequestMarshaller(myInputStreamMarshaller)
      .setResponseMarshaller(myInputStreamMarshaller)
      .build();
  ClientCall<InputStream, InputStream> cc = next.newCall(isMethod,
callOptions);
  // wrap the call to your liking.
  // do things like method.streamRequest(req) to convert between messages
and bytes
}

The MyInputStreamMarshaller itself is trivial; use InputStream as the type
T and just return the argument to each method.

On Mon, Oct 2, 2017 at 3:49 PM, <[email protected]> wrote:

> I am using https://github.com/grpc/grpc-java/blob/
> 45085c3ce40f37c39e2fc630f2d06f052064ee93/core/src/main/java/
> io/grpc/ServerInterceptors.java#L138 on my server, and there doesn't seem
> to be a client-side equivalent to this.
>
> I would like to override the onMessage(RespT resp) in my client-side
> interceptor  (SimpleForwardingClientCallListener) to work with an input
> stream rather than the grpc parsed request object. This is because i am
> sending some additional bytes in the input stream from my server and am
> going to do some additional work, before I manually parse the object and
> send to the handler.
>
> Anyone have alternative suggestions to this?
>
> Thanks!
>
> --
> You received this message because you are subscribed to the Google Groups "
> grpc.io" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/grpc-io.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/grpc-io/e03a3c33-f6bd-4ce1-ab98-65a9609ac455%40googlegroups.com
> <https://groups.google.com/d/msgid/grpc-io/e03a3c33-f6bd-4ce1-ab98-65a9609ac455%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/grpc-io.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/grpc-io/CA%2B4M1oPbjb8ipVxtuy-CXE50in3wHTt%3Dvx0rtp37G83odLkRCg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

Reply via email to