Comments (4)
Ah, so you've actually run into two interesting edge cases.
The first issue is that your Protobuf file is defining methods using camelCase instead of PascalCase (ie setFoo
instead of SetFoo
). This is causing YARPC's protoc
plugin to generate private methods on the interface, which are unimplementable if generated into a separate package. At Uber, we don't run into this issue since we have linters than enforce methods to be PascalCase.
Next, internally some services use an Fx layer that enables the gRPC reflection protocol. Since you are not hooking up the reflection server manually, you'll need to use protoc
and pass the FileDescriptorSet
using -F
(I do not recall if this works with yab-YAML files)
$ yab --help
...
-F, --file-descriptor-set-bin= A binary file containing a compiled protobuf FileDescriptorSet.
from yarpc-go.
thank you very much! Swapping to pascal case and adding that flag fixed both issues.
from yarpc-go.
Hey @zebralight, we do have gRPC examples that already exist here:
- https://github.com/yarpc/yarpc-go/tree/dev/internal/examples/protobuf
- https://github.com/yarpc/yarpc-go/tree/dev/internal/examples/streaming
It's hard to tell what's happening without the full context of the generated code, but it seems like your Server
does not implement the generated YARPC interface.
- You have one private method,
getValue
which should be public:GetValue
- You're missing the
SetValue
, the second method defined in your Protobuf file - Double check that the server implements exactly the interface generated by YARPC.
Please check out the examples and re-open if you have any questions!
from yarpc-go.
hi @AlexAPB. thank you for the response. I made the advised change of setting getValue
to be public but am seeing the same error issued which was:
server/main.go:89:62: cannot use server (type *Server) as type keyvalue.KeyValueYARPCServer in argument to keyvalue.BuildKeyValueYARPCProcedures:
*Server does not implement keyvalue.KeyValueYARPCServer (missing keyvalue.getValue method)
have GetValue(context.Context, *keyvalue.GetValueRequest) (*keyvalue.GetValueResponse, error)
want keyvalue.getValue(context.Context, *keyvalue.GetValueRequest) (*keyvalue.GetValueResponse, error)
. I've also added SetValue
and didn't include it in the original ticket since the error was only alerting me about getValue
.
I just tried out the protobuf example and tried running it and then calling it with this yab:
service: example
method: EchoIn
peer: grpc://127.0.0.1:34111
timeout: 1000ms
request:
message: "foo"
num_responses: 3
and am getting this response:
Failed while parsing input: rpc error: code = Unimplemented desc = unrecognized procedure "grpc.reflection.v1alpha.ServerReflection::ServerReflectionInfo" for service "example"
thanks again!
from yarpc-go.
Related Issues (20)
- Transient failure in unary panic handler test.
- Switch case fall through requires `fallthrough` keyword HOT 2
- gRPC: Support introspection
- http: Set default IdleConnTimeout to avoid holding on to connections forever
- 'thriftrw-plugin-yarpc' server handler throws UnexpectedError in certain cases of bad request
- Documentation example does not work HOT 1
- http outbound doesn't return response for !2XX status
- Allow wraping application error with yarpcerrors.Status to access error chain in middleware HOT 1
- codahale/hdrhistogram repo url has been transferred under the github HdrHstogram umbrella HOT 1
- Compatibility with native gRPC HOT 4
- `unexpected EOF` when gRPC inbound returns error with details HOT 2
- Ability to set http headers without allocations HOT 5
- Log the original context deadline for assisted debugging HOT 1
- Thrift package has vulnerabilities
- [YARPCERRORS] Why do we use `code.String()` instead of `.Name()`? HOT 4
- Caller Procedure not being populated for inbound/outbound middlewares
- Unclean shutdown when using single-peer with gRPC HOT 1
- Allow peer address to be accessible to the server handler function
- Changing headers filtering and value setting conditions
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 yarpc-go.