Skip to content

How to use the partitioning strategy with the http client? #953

@gabrielgiussi

Description

@gabrielgiussi

Is your feature request related to a problem? Please describe.
I want to perform load balancing based on the request to g et affinity with servers that have a hot cache for the data each request will access.
Currently this can't be done in the Load Balancer layer because the pick method doesn't have access to the request.

Describe the solution you'd like
I think having a partitioning aware client could be the solution, but I wonder why the service ConsistentHashPartitioningService is private, which makes it impossible to reuse with an Http Client.
Even if that class wasn't private, I'm not sure how the wiring should be done, it seems I need to use the Stack API.

Describe alternatives you've considered
Using a ServiceFactory to instantiate a service per partition (since it performs LB only once), but this makes using the client much harder since now I have to maintaining this mapping of key to service.
Besides that, I don't have a way to achieve the affinity, aka telling that service instance which is the subset of nodes that should use to load balance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions