Skip to content

Conversation

@zhangkun83
Copy link
Contributor

@zhangkun83 zhangkun83 commented Dec 13, 2018

  • Added trailer operations
  • Moved from header to metadata
    • The interceptors now capture received metadata instead of logging them.
    • On the client-side, received metadata is checked by application
    • On the server-side, received headers is injected into Context and checked by application
  • Moved away from mocks in the tests
  • Generate binaries for the example client and server. They have been verified to be working.

@zhangkun83 zhangkun83 requested a review from ejona86 December 13, 2018 00:29
* A simple client method that like {@link io.grpc.examples.helloworld.HelloWorldClient}.
*/
private void greet(String name) {
interceptor.outgoingHeader.set("Value of client->server header");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we should encourage behavior like this. And if we did do behavior like this, we should make a new interceptor each call.

I think we need to have a conversation about what this example should do, because right now I see most of the code being for things I don't want our users doing just "for the sake of example."

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ive been struggling with things implemented in this PR for several days.
Could you please write your opinion on how the following logic should be implemented using the library?

Let's say we have client and a server and we want:

  • enrich each client request to server with unique id(let it be UUID.random())
  • enrich each client request to server with user information, such as security token
  • enrich each server response with arbitrary Map[String, String] with different values for each call
  • read all the data mentioned above on both sides

What is the recommended way for doing this? Can it be added to examples and docs?

For now all I see on the web suggests I should create a new stub, or add interceptors for each call, is it adequate in terms of performance and jvm resources usage(new interceptor instances created for each call)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants