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

fix: out of order production issue #567

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

filipeesch
Copy link
Contributor

Description

Fix an issue that the messages are published in the wrong order when we call ProduceAsync() many times without awaiting.

How Has This Been Tested?

Please describe the tests that you ran to verify your changes.

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have added tests to cover my changes
  • I have made corresponding changes to the documentation

Disclaimer

By sending us your contributions, you are agreeing that your contribution is made subject to the terms of our Contributor Ownership Statement

@@ -62,6 +62,7 @@ public interface IMessageProducer
/// <param name="headers">The message headers</param>
/// <param name="deliveryHandler">A handler with the operation result</param>
/// <param name="partition">The partition where the message will be produced, if no partition is provided it will be calculated using the message key</param>
[Obsolete("This method will be remove in the next major release, please use ProduceAsync() instead")]
Copy link
Contributor

Choose a reason for hiding this comment

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

Why are we marking the Produce methods as obsolete? In scenarios where the message throughput is high, the non async producer can produce at a significant higher rate since it doesn't need to wait for the report.

Why can't the framework support this?

@joelfoliveira
Copy link
Contributor

Sorry, a bit confused here. If the issue is related to calling the ProduceAsync without await, isn't expected that the Task execution order cannot be guaranteed?

In .NET ecosystem, this is expected since it is the way that .NET handles task execution. If the caller does not want to wait for the delivery report, as an alternative, can use the non-async producer or set the aks to 0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants