Comments (4)
We have no plan for this now, but this is a cool suggestion.
Can you give us some ideas about what needs to do if we support this feature?
from grpc-rs.
Reflection is supported in the Go
and .NET
SDKs for gRPC, I'm not sure about the other SDKs since I don't use them. But it's fairly straightforward - they provide an implementation of the reflection service PROTO and then provide some way for developers to host this reflection service alongside their actual service on the same port. With this in place, we can use tools like grpcurl
to query, identify, and obtain metadata on our services. Having this reflection ability makes our services far more tooling-friendly, which in turn lowers the barrier to resistance of gRPC over something like REST.
The reflection service is basically just this:
service ServerReflection {
rpc ServerReflectionInfo(stream ServerReflectionRequest)
returns (stream ServerReflectionResponse);
}
If you look at the other SDK implementations, you'll see that they basically just do a switch on the request type and return the appropriate data. In the .NET implementation, there is a descriptor
generated into the gRPC C# file which provides access to metadata and the original proto IDL, and these descriptors are then passed to the reflection service implementation that comes with the SDK.
Here is a link to the .NET service implementation of Reflection.
Here is where the Go SDK implements reflection.
from grpc-rs.
Here's a list of the operations that a client can request of a reflection service (you'll see this as an enum in the Reflection proto):
- Ask for a proto file by filename
- Find a proto file that contains the supplied fully-qualified symbol name
- Find a proto file that defines an extension that extends the given message type with the given field number
- Find the tag numbers used by all known extensions of a message type
- List the names of registered services
Some SDKs return StatusCode::NOTIMPLEMENTED
for some of these (.NET doesn't implement "file containing extension" and "all extensions" request types)
from grpc-rs.
TL;DR - if the service implementation has access to a map of filename->proto IDL, then it can support the bare minimum reflection functionality
from grpc-rs.
Related Issues (20)
- Is there a way to set MaxCallRecvMsgSize? HOT 2
- Why returns `Failed to pick subchannel` when sent a backupRequest HOT 1
- grpcio-sys libabsl_bad_optional_access.a: file too small to be an archive HOT 6
- Support code generation for proto definitions utilizing experimental features HOT 1
- failed to build in mac HOT 6
- grpcio-sys-0.8.1 build error HOT 2
- grpcio v0.12.1 failed to build HOT 13
- grpcio-sys-0.12.1+1.46.5-patched compile error on latest `clang` HOT 3
- TiKV runs into Handshake failed with fatal error SSL_ERROR_SSL. HOT 2
- Failed to build on windows
- 0.12.1+1.56.2-patched failed to link systemd HOT 2
- Examples not compiling HOT 2
- add support to measure message delivery's time from the StreamingCallSink's
- Cmake error when trying to use grpcio with 0.13.0 HOT 2
- Don't know how to use TLS. HOT 2
- Bump prost to `0.12` HOT 1
- MetadataBuilder should implement Clone
- observability: improve the observability for every cq running task
- performance: more cost on CPU when upgrading to v0.13.0 HOT 1
- Unable to compile w/ prost-codec, missing proto files in grpcio-sys directory? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from grpc-rs.