-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
API gateway example #202
Comments
Step 2 of this could be adding Zipkin tracing to showcase tracing across these connected services and across different transports... that would be a little more challenging but I might be able to contribute after the above piece has been taken care of |
I am new to go-kit and I am working on this to get to know the library. |
@basvanbeek Sounds good to me. A @marshauf Great! If you'd like, feel free to make a work-in-progress style PR, and ask questions as you go. It's the easiest way to learn :) |
@peterbourgon I am discovering the services on-demand through http requests. Should the services be discovered on startup or demand? I am also not sure how to handle http/json on the frontend and a grpc service like addsvc, since the data requires a conversion. The simple solution would be to import the generated protobuf package and use jsonpb to convert the json data to protobuf messages. Which I don't like, because it would require recompiling the apigateway when a protobuf message changes. Any thoughts? |
@marshauf re: service discovery, definitely defined on startup. I'm still pretty firmly convinced an API gateway that does dynamic service discovery and route wiring is an antipattern. re: transport conversion, since you're doing predefined service wiring, you know what the various endpoints are & what their request/response types should be, so you're free to deterministically unmarshal the specific requests from e.g. HTTP+JSON and re-marshal them to e.g. protobuf. I can't think of a way to build an API gateway that supports this kind of transcoding without this knowledge. An API gateway without request transcoding is I think indistinguishable from a content-agnostic reverse proxy; not the domain of Go kit. |
This is an extension of #91.
My thinking has evolved a bit on this after watching Chris Richardson speak about his work (http://microservices.io/). In particular my understanding of what an API gateway is has shifted, and I think there is definitely a role for Go kit there. I find it pretty straightforward how to create such a thing:
Let's add an example/apigateway that gateways to an example/profilesvc, example/addsvc, and example/stringsvc. Assume:
The text was updated successfully, but these errors were encountered: