Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add server-reflection-tutorial.md #937

Merged
merged 2 commits into from Nov 30, 2016
Merged

Conversation

menghanl
Copy link
Contributor

No description provided.

Copy link

@hsaliak hsaliak left a comment

Choose a reason for hiding this comment

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

Looks mostly good, just a couple of minor comments to signify the walkthrough. Thanks for doing this.

### Enable server reflection in gRPC-go servers

gRPC-go Server Reflection is implemented in package [reflection](https://github.com/grpc/grpc-go/tree/master/reflection). To enable server reflection, you need to import this package and register reflection service on your gRPC server.

Copy link

Choose a reason for hiding this comment

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

Instead of the hypothetical example below, do you want to state that this example walks through how server reflection can be enabled on the hello world example?

We can then use real code such as
pb.RegisterGreeterServer(s, &server{}) instead of the functions below.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I changed it to the diff I made in helloworld example.

After enabling Server Reflection in a server application, you can use gRPC CLI
to test its services. We don't have a gRPC CLI implemented in go, the only available CLI is in c++.

Here we use `examples/helloworld` as an example to show the use of gRPC
Copy link

Choose a reason for hiding this comment

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

We can move this statement up.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@menghanl
Copy link
Contributor Author

Thanks for the review. All fixed. PTAL.

Copy link

@hsaliak hsaliak left a comment

Choose a reason for hiding this comment

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

L(really)GTM!

gRPC Server Reflection provides information about publicly-accessible gRPC
services on a server, and assists clients at runtime to construct RPC
requests and responses without precompiled service information. It is used by
gRPC CLI, which can be used to introspect server protos and send/receive test
Copy link
Contributor

Choose a reason for hiding this comment

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

add a link to CLI


gRPC-go Server Reflection is implemented in package [reflection](https://github.com/grpc/grpc-go/tree/master/reflection). To enable server reflection, you need to import this package and register reflection service on your gRPC server.

For example, to enable server reflection in `example/helloworld`, the change needed is:
Copy link
Contributor

Choose a reason for hiding this comment

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

s/the change needed is/we need to make the following changes/

## Test services using Server Reflection

After enabling Server Reflection in a server application, you can use gRPC CLI
to test its services. We don't have a gRPC CLI implemented in go, the only available CLI is in c++.
Copy link
Contributor

Choose a reason for hiding this comment

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

s/test/check

the last sentence should be replaced by

"gRPC CLI is only available in C++."

then give a link including the corresponding instructions on installation and execution (are there?).


Instructions on how to use gRPC CLI can be found at
[command_line_tool.md](https://github.com/grpc/grpc/blob/master/doc/command_line_tool.md), or using `grpc_cli help` command.

Copy link
Contributor

Choose a reason for hiding this comment

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

ok, move the above to the place I suggested.


```sh
$ go run examples/helloworld/greeter_server/main.go
```
Copy link
Contributor

Choose a reason for hiding this comment

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

from 48 to 55, it should be

Run a hello world server

$ go run examples/helloworld/greeter_server/main.go

other things are not needed.

@menghanl menghanl merged commit cc3363f into grpc:master Nov 30, 2016
@menghanl menghanl deleted the reflection_tutorial branch November 30, 2016 01:57
@lock lock bot locked as resolved and limited conversation to collaborators Jan 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants