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: manual affinity via call options or context #175

Merged
merged 1 commit into from
May 9, 2024
Merged

Conversation

nimf
Copy link
Collaborator

@nimf nimf commented May 9, 2024

This feature allows specifying affinity key via context or call options.

The key from call options takes precedence over key in context if both specified.

Examples:

Using gRPC context:

import io.grpc.Context;

...

Context ctx = Context.current().withValue(GcpManagedChannel.AFFINITY_CTX_KEY, "your-affinity-key");
ctx.run(
    () -> {
      stub.executeStreamingSql(executeSqlRequest, resp);
    });

Using gRPC call options:

stub.withOption(GcpManagedChannel.AFFINITY_KEY, "your-affinity-key")
    .executeStreamingSql(executeSqlRequest, resp);

@nimf nimf requested a review from mohanli-ml May 9, 2024 18:09
@nimf nimf merged commit 40f05f5 into master May 9, 2024
2 checks passed
@nimf nimf deleted the manual-affinity branch May 9, 2024 18:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants