Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Periodic client discovery refresh #1152 #1886

Merged
merged 10 commits into from
Feb 28, 2024

Conversation

johanandren
Copy link
Member

New per-service client config with an interval to trigger (possibly) cache-piercing refresh of discovered endpoints for a service.

Depends on upstream API addition in Akka.

References #1152

Copy link
Member

@patriknw patriknw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good. I know the request has been periodic refresh, but I wonder if there is a way to trigger a refresh programatically for a specific gRPC client? Let's say there is some external event (maybe something observed from Kubernetes) and the application would like to trigger a refresh immediately when seeing that event.

runtime/src/main/scala/akka/grpc/GrpcClientSettings.scala Outdated Show resolved Hide resolved
runtime/src/main/scala/akka/grpc/GrpcClientSettings.scala Outdated Show resolved Hide resolved
@johanandren
Copy link
Member Author

It is a bit hard to provide a regular programmatic hook since the AkkaDiscoveryNameResolver instance is created deep behind the scenes depending on backend and discovery used. I guess one way would be to have it listen to a stream or topic or something like that.

Note that the refresh is in the client config so can be set separately for each specific endpoint via service name in config (or with code in the used GrpcClientSettings).

@johanandren
Copy link
Member Author

@Marcus-Rosti @danieltahara how important is the ability to do a manual call if periodic refresh is in place with this PR?

@danieltahara
Copy link

danieltahara commented Jan 8, 2024

@Marcus-Rosti @danieltahara how important is the ability to do a manual call if periodic refresh is in place with this PR?

I think for our use case, manual isn't necessary, although I agree the ideal would be to have a trigger so it could just be directly synced to k8s events.

@johanandren johanandren force-pushed the wip-periodic-client-discovery-refresh branch from c14fede to 199e97a Compare February 19, 2024 08:01
@johanandren johanandren force-pushed the wip-periodic-client-discovery-refresh branch from f3362ec to 9043dd5 Compare February 27, 2024 17:21
Copy link
Member

@patriknw patriknw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM after some log minors

@johanandren johanandren merged commit 02e1335 into main Feb 28, 2024
12 checks passed
@johanandren johanandren deleted the wip-periodic-client-discovery-refresh branch February 28, 2024 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants