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

Incorrect order of produced messages in transaction #1626

Open
PoteRii opened this issue Dec 20, 2024 · 6 comments
Open

Incorrect order of produced messages in transaction #1626

PoteRii opened this issue Dec 20, 2024 · 6 comments

Comments

@PoteRii
Copy link
Contributor

PoteRii commented Dec 20, 2024

Hello,
Consider a scenario (slightly modified code from sample Sample.Kafka.PostgreSql project):
image

Sometimes we are seeing that produced messages are in incorrect order, meaning that message with less DateTime.Now value has higher offset

image

this happens not always, but quite frequently.
In our scenario even adding await Task.Delay(500); between two messages does not help.

Could it be because there is no await in Flush method? In that case possible solution might be new FlushAsync function

@yang-xiaodong
Copy link
Member

Does using PublishAsync have the same issue?

@PoteRii
Copy link
Contributor Author

PoteRii commented Dec 21, 2024

Yes. In our real scenario we use PublishAsync.

@PoteRii
Copy link
Contributor Author

PoteRii commented Dec 21, 2024

I have tested by adding FlushAsync function and doing await FlushAsync in CommitAsync and it seems to work

@PoteRii
Copy link
Contributor Author

PoteRii commented Dec 26, 2024

should I make a PR with new FlushAsync? At least it won`t break anything

@yang-xiaodong
Copy link
Member

should I make a PR with new FlushAsync? At least it won`t break anything

Sure, Thanks

@PoteRii
Copy link
Contributor Author

PoteRii commented Dec 26, 2024

#1629

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

No branches or pull requests

2 participants