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

Reflection integration #192

Merged
merged 5 commits into from
Apr 25, 2019
Merged

Reflection integration #192

merged 5 commits into from
Apr 25, 2019

Conversation

JamesNK
Copy link
Member

@JamesNK JamesNK commented Apr 1, 2019

Introduces Grpc.AspNetCore.Server.Reflection. It provides a reflection integration with gRPC for ASP.NET.

It is a separate package because it depends on Grpc.Reflection, and Grpc.Reflection has a dependency on Grpc.Core. If we want to avoid an extra package then we could re-implement the server component of Grpc.Reflection, eliminate the dependency and build everything into Grpc.AspNetCore.Server.

Done now to figure out how to access the service descriptor using reflection for grpc/grpc#18484

@@ -40,6 +41,7 @@ public void Configure(IApplicationBuilder app)
routes.MapGrpcService<MailerService>();
routes.MapGrpcService<CounterService>();
routes.MapGrpcService<GreeterService>();
routes.MapGrpcReflectionService();
Copy link
Member Author

Choose a reason for hiding this comment

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

Adding reflection on the server:

services.AddGrpcReflection();

plus

services.MapGrpcReflectionService();

Clean! 😄

Copy link
Contributor

@jtattermusch jtattermusch left a comment

Choose a reason for hiding this comment

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

This is looking good! LGTM after addressing comments.

@JamesNK
Copy link
Member Author

JamesNK commented Apr 19, 2019

I've rewritten this slightly to use endpoints + metadata to get the services instead of a new registry.

@JamesNK
Copy link
Member Author

JamesNK commented Apr 23, 2019

@JunTaoLuo ping. Review please

Copy link
Contributor

@jtattermusch jtattermusch left a comment

Choose a reason for hiding this comment

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

LGTM.

examples/Server/Startup.cs Outdated Show resolved Hide resolved
Copy link
Contributor

@JunTaoLuo JunTaoLuo left a comment

Choose a reason for hiding this comment

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

A few small comments. Also, will there be tests added?

@JamesNK
Copy link
Member Author

JamesNK commented Apr 24, 2019

I'll add a couple of tests, just to sanity check that it still works.

@JamesNK JamesNK merged commit 0701755 into grpc:master Apr 25, 2019
@JamesNK JamesNK mentioned this pull request Apr 25, 2019
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