Open pawelwan opened 4 years ago
Hmm, I'm not aware of a way to do this.
You could perhaps achieve this from the client side via the withChannelBuilderOverrides
escape hatch (https://github.com/akka/akka-grpc/blob/1c7e655ac9a495468cfdfe486f9270db0aac9515/runtime/src/main/scala/akka/grpc/GrpcClientSettings.scala#L236)?
Thanks for the quick answer. Did you mean any particular option available in NettyChannelBuilder? I was browsing through the options available there, but I don't see one that will allow me to achieve the same behavior as maxConnectionAge
on the server-side.
Ah, sorry - I assumed such an option would be available, but I guess I was wrong...
I was also looking for something like that.
GRPC_MAX_CONNECTION_AGE
forces clients to reconnect, thus giving them the opportunity to reach a different backend. This is also done transparently for the application code (https://github.com/grpc/proposal/blob/master/A9-server-side-conn-mgt.md; https://github.com/grpc/proposal/blob/master/A6-client-retries.md#transparent-retries).
For example, with kubernetes cluster ip services this is a very easy way to have some kind of load balancing.
Is there any way to replicate this behavior with the current akka-grpc API, or any plans to provide such a feature?
For example, with kubernetes cluster ip services this is a very easy way to have some kind of load balancing.
Is there any way to replicate this behavior with the current akka-grpc API
I think the most common way to approach this currently is to use DNS to discover the individual IP's of the target services, and use the 'round-robin' loadbalancing to balance the load over them.
any plans to provide such a feature
I don't think there is anyone planning on working on this right now.
On the client side, currently we're building on top of the grpc-java client, so anything that is possible there should be possible to expose in Akka gRPC.
In the longer term we might want to allow building the client based on Akka HTTP instead, but Akka HTTP does not yet have HTTP/2 support at the client side. Contributions there are definitely welcome, see https://github.com/akka/akka-http/issues/3226 .
I think it would be great if (either based on grpc-java or akka-http) it would be possible to:
On the server side we are already based on Akka HTTP, so possibly we could add something like (GRPC_)MAX_CONNECTION_AGE
there - though it feels like solving this at the server side might be less elegant than doing it at the client side.
Hi, in netty-based grpc-java it is possible to define the parameter maxConnectionAge on the server like this:
Is it possible to get the same functionality with akka-grpc? It's needed to perform client-side load balancing as shown here: https://github.com/jtattermusch/grpc-loadbalancing-kubernetes-examples#example-1-round-robin-loadbalancing-with-grpcs-built-in-loadbalancing-policy (setting GRPC_MAX_CONNECTION_AGE on server)