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]: Improved Mechanism for Signalling Message Processing Completion #426

Closed
filipeesch opened this issue Sep 12, 2023 · 0 comments
Assignees
Labels
breaking change enhancement New feature or request
Milestone

Comments

@filipeesch
Copy link
Member

filipeesch commented Sep 12, 2023

Is your request related to a problem you have?

There is currently no standardized and flexible mechanism in the framework to signal when message processing ends for different types of consumers. This inconsistency can lead to message loss, particularly in cases where an application is abruptly terminated or killed. This issue only happens when using custom async processing middlewares or libraries like TPL Dataflow, as it becomes challenging to manage message lifetimes effectively.

Describe the solution you'd like

Leveraging the IConsumerContext interface, I propose the following enhancements to streamline the mechanism for message completion:

1. Method and Property Renaming:

  • Rename the StoreOffset() method to Complete(), which provides more clarity about its function.

2. Handling Message Completion:

The Complete() method should be invoked to signal the end of message processing:

void Complete();

3. New Property: Completion

Introduce a new property named Completion:

Task<TopicPartitionOffset> Completion { get; }

This Completion task will be completed when the Complete() method is called, signaling that message processing has ended. It will allow asynchronous operations to await the end of message processing.

4. Introduce the AutoMessageCompletion Flag

Create a property named AutoMessageCompletion:

bool AutoMessageCompletion { get; set; }

This flag determines whether the framework will automatically signal the completion of a message once it's processed.

This will ensure that message processing is marked as finished and that associated resources are correctly released.

Summary:

With these changes, the framework can offer a more versatile mechanism for managing message lifetimes, especially beneficial for consumers employing unique approaches like TPL Dataflow or the BatchConsume middleware.

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

Yes

Additional context

This enhancement will not only benefit consumers with unique message processing requirements but also simplify core framework code by providing a standardized way to signal the completion of message processing.

@filipeesch filipeesch added the enhancement New feature or request label Sep 12, 2023
@filipeesch filipeesch added this to the v3.0.0 milestone Sep 12, 2023
@filipeesch filipeesch self-assigned this Sep 12, 2023
@gsferreira gsferreira changed the title [Feature Request]:Improved Mechanism for Signaling Message Processing Completion [Feature Request]: Improved Mechanism for Signalling Message Processing Completion Sep 12, 2023
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