I was following the examples like the addsvc and at the same time applying that example into my micro service but I haven't found a way to properly return those codes to the client and I'm always getting the UNKNOWNerror. I'm wondering what's the best practice to integrate the use of https://godoc.org/google.golang.org/grpc/status in go-kit, how can I link these codes with my bussines logic, which layer should take care of return the official gRPC codes and if you guys recommend the use of the status package. Any insights will really appreciate it.
Other than that go-kit is an amazing toolkit that has been perfect and useful to quickly start a micro service. Thanks.
Bas Van Beek
unread,
Sep 22, 2018, 1:39:40 PM9/22/18
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Go kit
Hi there,
Good question. Yes it is possible but unfortunately we haven't really provided a good example in the Go kit repository for it. There is one item that needs addressing to make it easier which is the Go kit gRPC transport client. It will treat any gRPC code other than OK as a hard transport error. The trick is to catch the gRPC return details in an endpoint middleware and separate out business from transport / hard errors. Otherwise you'll end up tripping things like circuit breakers and retry logic.