13th June 2022, the gRPC has changed a bit. The generated code for services and messages are now in separate folders ending with _grpc.pb.go and .pb.go respectively. Also, 1. At the top of the proto file you need: `option go_package="/currency";` 2. The command for generation can now be something like this: `protoc -I protos/ --go_out=. --go-grpc_out=. protos/currency.proto`
Couple of additional things: Currency struct should be changed to this: type Currency struct { log hclog.Logger protos.UnimplementedCurrencyServer } and also implement this func as well: func (c *Currency) mustEmbedUnimplementedCurrencyServer() {}
Great video, I was able to utilize this for my first GRPC concept build. Really I'm just a hobbyist but I appreciated the method of your approach. Too often people don't take the time to explain the fundamentals of things first (explanation on proto was perfect). If I had time to read the entire documentation I wouldn't be looking for a youtube video to jumpstart me.
Another change is that proto grpc now requires generated servers to have forward compatibility. To fix the error, add protos.Unimplemented*Server to your struct (no field name needed) and also add in your constructor. Or, you can opt out of forward compatibility by adding protos.Unsafe*Server instead, or change your protoc to have this command: --go-grpc_out=require_unimplemented_servers=false:.
19th April 2023, you need to add "UnimplementedCurrencyServer" to the Currency struct for forward compatibility : type Currency struct { protos.UnimplementedCurrencyServer log hclog.Logger } func NewCurrency(l hclog.Logger) *Currency { return &Currency{log: l} }
awesome video, one little detail: for me when i followed the steps i had `Base`, `Destination` and `Rate` in json (PascalCase instead of lowercase) also, i don't have the `[json_name = "xxxxx"]` part when i describe a message. tested it today
message RateRequest { // Base is the base currency code for the rate string Base = 1 [json_name = "base"]; // Destination is the destination currency code for the rate string Destination = 2 [json_name = "destination"]; } With this it works. I don't know why he doesn't have to write it. I will find out eventually.
Such a great series!!! If we were to rewrite REST APIs with grpc would we theoretically be able to handle the same number of concurrent connections? More or less? How does this scale as a REST replacement?
@@NicJackson Hi Nic, sorry for my late response. I know you are busy with your new book, but when you have time, i hope you make another tutorial about Envoy Proxy for gRPC and ReactJs. Thank you Nic. Btw, when will your new book be released?
hmmm.... Make a tutorial in which two microservices talk to each other using grpc and protocol buffers. Use both client and server streaming at the same time. It should be fun.
Has there been some large change in the golang grpc package since the time this video was made? I used the command "protoc --go-grpc_out=. path/to/file.proto" to generate my currency_grpc.pb.go file and it looks drastically different than yours.
@@yeezyyxy2259 Same, I'm going back to Spring Boot, it's the external methods for me. It makes all the functions of a struct or the interfaces it implements difficult to track and that's a 🚩
Hi Nic, great tutorial. Grpccurl looks like a useful tool to quickly test, however for production code one would still need to write structured unit tests. Do you have any tutorials on that?
okei, it breaks my heart when intellisense fails in your .proto file, when generating go modules, you can write `option go_package = "";` some where else in your project you can call stuff from that package. .MyStruct.
Getting error while passing the data through terminal grpcurl --plaintext -d ' { "base" : "INR" , "destination" : "Usd" }' localhost:9092 Currency.RateRequest and error like invalid character b looking for beginning of object key string
13th June 2022, the gRPC has changed a bit. The generated code for services and messages are now in separate folders ending with _grpc.pb.go and .pb.go respectively.
Also,
1. At the top of the proto file you need:
`option go_package="/currency";`
2. The command for generation can now be something like this:
`protoc -I protos/ --go_out=. --go-grpc_out=. protos/currency.proto`
Thank you for the help!
I was going to mention this as well, nice to see someone got there before me :D
Couple of additional things:
Currency struct should be changed to this:
type Currency struct {
log hclog.Logger
protos.UnimplementedCurrencyServer
}
and also implement this func as well:
func (c *Currency) mustEmbedUnimplementedCurrencyServer() {}
Thanks Evans. Also are you the mathematician evans owamoyo?
@@joshuaetim3279 Yes
Great video, I was able to utilize this for my first GRPC concept build. Really I'm just a hobbyist but I appreciated the method of your approach. Too often people don't take the time to explain the fundamentals of things first (explanation on proto was perfect). If I had time to read the entire documentation I wouldn't be looking for a youtube video to jumpstart me.
The tutorials are great, the voice is even better... Kind of like one of those story narrator voices. Keep up the good work mate!
Another change is that proto grpc now requires generated servers to have forward compatibility. To fix the error, add protos.Unimplemented*Server to your struct (no field name needed) and also add in your constructor. Or, you can opt out of forward compatibility by adding protos.Unsafe*Server instead, or change your protoc to have this command:
--go-grpc_out=require_unimplemented_servers=false:.
I’m really happy I found a comprehensive intro to grpc. Thank you!
Protect this kind man at all cost!!
Your voice and tone seems to make the lectures stick . I'm subscribing for that alone. Good work.
beautiful introduction to grpc
Simple and easy to learn Happy I stumbled on this one
Are you also planning to discuss about deployment of docker containers(go microservices)?
Hey Nick, if you put a full IP address and a port on Go's listeners, you avoid making the firewall jump everytime you run a server
This is wonderful! Thank you, I learned a lot :)
Excellent work man ! . Regards from Argentina .
19th April 2023, you need to add "UnimplementedCurrencyServer" to the Currency struct for forward compatibility :
type Currency struct {
protos.UnimplementedCurrencyServer
log hclog.Logger
}
func NewCurrency(l hclog.Logger) *Currency {
return &Currency{log: l}
}
Amazing content! So easy to comprehend. Thank you so much!
First video I've seen from you. Excellen and very helpful.
Sweet and brilliant teaching!
Wonderful as usual!!
Thanks for the video. Great explanation on protobuffer and grpc. 🤙🤙🤙🤙👏
Dear Nic, Absolutely loved your channel the way you explain things is great \o/
thanks for these serials, u just make me love more go language. its really amazing language
awesome video, one little detail: for me when i followed the steps i had `Base`, `Destination` and `Rate` in json (PascalCase instead of lowercase)
also, i don't have the `[json_name = "xxxxx"]` part when i describe a message.
tested it today
message RateRequest {
// Base is the base currency code for the rate
string Base = 1 [json_name = "base"];
// Destination is the destination currency code for the rate
string Destination = 2 [json_name = "destination"];
}
With this it works. I don't know why he doesn't have to write it. I will find out eventually.
Thank you. Easy explanation.
Great tutorial. Thanks!
Great video!
Thanks a lot from Guatemala
Great, man! Love your video
Great tutorial. Any chance you can walk us through using flatbuffers with gRPC?
this is an amazing video thank you so much
Such a great series!!! If we were to rewrite REST APIs with grpc would we theoretically be able to handle the same number of concurrent connections? More or less? How does this scale as a REST replacement?
Hi, not the expert here, but I am pretty sure you would be handle more requests… quite a bit more actually.
Great tutorial. Thank you, Nic!
Thank you, please let me know if there is a specific topic you would like me to cover.
@@NicJackson Hi Nic, sorry for my late response. I know you are busy with your new book, but when you have time, i hope you make another tutorial about Envoy Proxy for gRPC and ReactJs. Thank you Nic. Btw, when will your new book be released?
Great job. You always are a creative programmer
Can you talk about Avro vs gRPC
Can you show us how to use Istio with gRPC in building microservices
Great, keep going
hmmm....
Make a tutorial in which two microservices talk to each other using grpc and protocol buffers. Use both client and server streaming at the same time. It should be fun.
That is coming :), I will be looking at gRPC clients this week and bi-directional streaming in the next episode
Has there been some large change in the golang grpc package since the time this video was made? I used the command "protoc --go-grpc_out=. path/to/file.proto" to generate my currency_grpc.pb.go file and it looks drastically different than yours.
Only difference I made in my code was adding in the line "option go_package = "./currency";
" since it seems to be required now
This is the most I have ever struggled getting something to work. I'm about to just go back to c#. Go package/tooling management is unbearable.
@@yeezyyxy2259 Same, I'm going back to Spring Boot, it's the external methods for me. It makes all the functions of a struct or the interfaces it implements difficult to track and that's a 🚩
Thanks for this, how can I use grpcurl in python? want to build some utility tool for testing
Great one, thank you!
Muchas gracias por tu aporte muy bueno todo !! saludos
Hi Nic, great tutorial. Grpccurl looks like a useful tool to quickly test, however for production code one would still need to write structured unit tests. Do you have any tutorials on that?
Nic, you're amazing!
I love this series
okei, it breaks my heart when intellisense fails
in your .proto file, when generating go modules, you can write `option go_package = "";`
some where else in your project you can call stuff from that package. .MyStruct.
Great one, thank you. Will you show some client frameworks like React or Angular with grpc?
How to implement client in c++ and server in Go using grpc?
Can you please tell me
You should demo Micro next ;)
That is a great idea, if I ran a stream next week would you like to come on as a guest?
Will this series be continued ?
Getting error while passing the data through terminal grpcurl --plaintext -d ' { "base" : "INR" , "destination" : "Usd" }' localhost:9092 Currency.RateRequest and error like invalid character b looking for beginning of object key string
I really like it
great
i am using bloomrpc to test the grpc it's gui
gs, cs are encrypted variable names, not ideal...
I love your training, however, I hat the dark color. It is very hard to read on an iPad. Please us lite style. Thank you.