Skip to content

getAttributes() always empty if called from SimpleForwardingClientCall #4118

@maseev

Description

@maseev

What version of gRPC are you using?

1.10.0

What did you expect to see?

Let's say we have the following client interceptor which is attached to our channel:

class LoggingClientInterceptor implements ClientInterceptor {

  private static final Logger log = LoggerFactory.getLogger(LoggingClientInterceptor.class);

  @Override
  public <ReqT, RespT> ClientCall<ReqT, RespT> interceptCall(MethodDescriptor<ReqT, RespT> method,
      CallOptions callOptions, Channel next) {
    return new SimpleForwardingClientCall<ReqT, RespT>(next.newCall(method, callOptions)) {
      @Override
      public void start(Listener<RespT> responseListener, Metadata headers) {
        log.info("grpc request; method: {}, attributes: {}", method.getFullMethodName(),
            getAttributes());

        super.start(responseListener, headers);
      }
    };
  }
}

When calling the getAttributes() method I expected to see a set of attributes which contains at least the information about the server to which the client is going to make a request to. Unfortunately, getAttributes() method always empty.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions