grpc-consul-resolver
grpc-consul-resolver copied to clipboard
Doubt call grpc.Builder some wrong in many connections scenario
Hey, I read the source code and find that already full implement for grpc.Resolver and adaptor the consul api, the functionality is ok. But i doubt this library maybe not work smoothly in production envirnments. According to the example in the document, one connection created is ok, But if i want to create many connections in my concurrency business scenarios like:
conn1, err := grpc.Dial(
"consul://127.0.0.1:8500/whoami?wait=14s&tag=manual",
)
....
conn2, err := grpc.Dial(
"consul://127.0.0.1:8500/whoami?wait=14s&tag=manual",
)
Above codes call two times grpc.Builder inter which be implemented in your code. This will lead twice call of under codes:
go watchConsulService(ctx, cli.Health(), tgt, pipe)
go populateEndpoints(ctx, cc, pipe)
Is this suitable or some logics that i am misunderstanding ? And how to use this libarary in correct way ?
i check the code again and find reason. It's my fault.
I am in a mess that i could not find whether grpc support pessistent connection and how to config it like some params MaxIdleConns in Golang.
I want to use grpc-conn-pool(https://github.com/shimingyah/pool) in grpc client to keep connections persistent, but it seems conflict with grpc-consul-resolver.
Is there any suggestions for that? thanks.
Out dated. Please consider to update to latest version. If question stay let me know. Thanks.