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

MassTransit Alterations Dispatcher #4547

Merged
merged 2 commits into from
Oct 17, 2023
Merged

Conversation

sfmskywalker
Copy link
Member

@sfmskywalker sfmskywalker commented Oct 17, 2023

This PR adds a MassTransit implementation for the alteration job dispatcher service. This allows the engine to scale out into multiple application containers to increase throughput and resiliency.

=== auto-pr-body ===

Summary
This pull request includes a set of changes and additions related to the MassTransit feature, implemented to allow running alteration jobs in the background. Changes include adding a FindManyIdsAsync method to IAlterationJobStore, refactoring fields such as AlterationPlan.Status and AlterationJob.Status to use strongly typed enums and configuring indexes on selected fields.

List of Changes:

  • Added Elsa.Alterations.MassTransit project to solution file
  • Added a ProjectReference for Elsa.Alterations.MassTransit in the Elsa.WorkflowServer.Web.csproj
  • Adjusted the Sqlite connection string in the appsettings.json to point to the App_Data/elsa.sqlite.db
  • Added RunAlterationJob message to Elsa.Alterations.MassTransit.Messages
  • Added ResumeWorkflowInstance handler
  • Added DispatchWorkflowRequestConsumer to Elsa.Alterations.MassTransit.Features
  • Updated configurations for AlterationJobStore and AlterationPlan
  • Added FindManyIdsAsync method to AlterationJobStore
  • Added MassTransitAlterationsFeature, UseMassTransit and AddMassTransitConsumer methods to ModuleExtensions

Suggested Refactorings/Modifications:

  • Replace hardcoded database names with constants in AlterationPlan and AlterationJob configurations
  • Use strongly typed enums instead of strings to represent the AlterationPlan.Status and AlterationJob.Status fields
  • Add documentation comments to the src/modules/Elsa.Alterations.Core/Contracts/IAlterationJobStore.cs to describe the changes
  • Split the src/modules/Elsa.Alterations.Core/Services/DefaultAlterationJobRunner.cs code into smaller functions to improve readability
  • Add unit or integration tests to validate the changes implemented in the pull request.

@sfmskywalker sfmskywalker merged commit 903486e into v3 Oct 17, 2023
2 checks passed
@sfmskywalker sfmskywalker deleted the alterations-masstransit-dispatcher branch October 17, 2023 06:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant