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

Elsa 2: Kafka Activity module is preparing consumed message in an asynchronous way #4095

Closed
dao74 opened this issue Jun 1, 2023 · 2 comments · Fixed by #4105
Closed

Elsa 2: Kafka Activity module is preparing consumed message in an asynchronous way #4095

dao74 opened this issue Jun 1, 2023 · 2 comments · Fixed by #4105
Labels

Comments

@dao74
Copy link

dao74 commented Jun 1, 2023

The Elsa.Activities.Kafka.Helpers.Consumer class is using the observer pattern to notificate about received messages from Kafka.
The "notification" process is working asynchronous (fire and forget method) which is causing an issue, if there is a lag in the kafka queue or a bulk processing is intended.

In other words; the consumer is trying to preparing all (outstanding) queue messages in parallel and this can cause in extreme cases the exhausting of all pooled database connections.

To prevent this kind of issues, the process between receiving and preparing should be in an await mode, and the process should stop/retry if preparation of a message will fail. Otherwise, the message which is not processed will be lost.

@sfmskywalker
Copy link
Member

Do you want to submit a PR to fix this?

@dao74
Copy link
Author

dao74 commented Jun 5, 2023

Sure, with pleasure.

sfmskywalker pushed a commit that referenced this issue Jun 8, 2023
…nc (#4095) (#4105)

* Changed consumer/message processing to synchronized  mode (former async).

* Changed consumer/message processing to synchronized  mode - former async (#4095)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants