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

[Feature Request]: Evolve IDistributionStrategy Interface for Enhanced Flexibility #448

Closed
filipeesch opened this issue Oct 10, 2023 · 0 comments
Labels
breaking change enhancement New feature or request
Milestone

Comments

@filipeesch
Copy link
Member

filipeesch commented Oct 10, 2023

Is your request related to a problem you have?

The current IDistributionStrategy interface limits the framework and client applications in terms of creating custom distribution strategies. The GetWorkerAsync() method requires more context to make effective worker selection decisions.

Describe the solution you'd like

We propose the following changes to the interface:

  1. Rename the Interface: Change the name of the interface from IDistributionStrategy to IWorkerDistributionStrategy for more clarity.

  2. Enhance GetWorkerAsync() Method: Modify the method to accept a WorkerDistributionStrategyContext object that provides comprehensive details necessary for electing a worker to process the message. The context object should encompass:

    • Topic Name
    • Consumer Name
    • Partition
    • Raw Message Key
public interface IWorkerDistributionStrategy
{
    void Init(IReadOnlyList<IWorker> workers);

    ValueTask<IWorker> GetWorkerAsync(WorkerDistributionStrategyContext context);
}

Are you able to help bring it to life and contribute with a Pull Request?

No

Additional context

By implementing these changes, we aim to grant both the framework and client applications more versatility in devising custom distribution strategies tailored to their specific needs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change enhancement New feature or request
Development

No branches or pull requests

2 participants