Closed gzhhong closed 2 months ago
Thanks for reporting this! We should definitely look into this. Are there any tests, non specific to your system that you could provide that we could test with?
Hey @gzhhong / James,
just switch the clients DefaultContentType to "application/proto". I would as well switch server AND client to gRPC.
Let me know when you need help.
Kind Regards, René
@Davincible , Hello David, I upload a test project at https://github.com/gzhhong/test-grpc. I hope I made it clear in the readme and the code. @jochumdev , Hello Rene, could you please help to correct my sample code if possible?
Thanks both of you.
James
@gzhhong hmm the request is never actually reaching the server on the second one.. interesting. This is gonna take some debugging.
Thanks for the example!
Hey @gzhhong / James,
just switch the clients DefaultContentType to "application/proto". I would as well switch server AND client to gRPC.
Let me know when you need help.
Kind Regards, René
Hello @jochumdev / René ,
How to set DefaultContentType to "application/proto", can you give an example, thank you very much.
It's not okay to write like this
client.DefaultContentType = "application/protobuf"
Then I wrote it like this, and it always feels weird.
client.DefaultContentType = "application/protobuf"
client.DefaultClient = client.NewClient(client.ContentType(client.DefaultContentType))
Thank you !
Hi @tttao7 ,
I recommend something like (untested):
package main
import (
"go-micro.dev/v4"
grpcClient "github.com/go-micro/plugins/v4/client/grpc"
grpcServer "github.com/go-micro/plugins/v4/server/grpc"
)
func main() {
service := micro.NewService(
micro.Name("greeter"),
micro.Server(grpcServer.NewServer()),
micro.Client(grpcClient.NewClient(client.ContentType("application/protobuf"))),
)
}
Switching Server & Client to grpc will boost your application a lot AND it will work with protobuf.
Describe the bug
How to reproduce the bug
My message structure in proto file
The golang structure created by protoc
When I assign value to meeting.Start, the code like:
There is no such value if I continue using go micro v4.5. I am using libprotoc 3.21.6 and protoc-gen-go v1.27.1
Go Version output:
The go env output:
Any suggestions welcomed, thanks,
James