General template for polling/processing messages out of a variety of message stores.
Repo features:
- Initialisation script for quick namespace adjustment.
- Configuration is based on environment variables.
- Message polling with:
For configuration examples, see the worker section of the test/local/docker-compose.yaml file.
"Loader" mode is a new implementation of the handling of jobs pulled from the job source. Compared to the original "Batch" mode, it features:
- Automatic backlog population for fewer delays between job executions.
- Better separation of concerns for maintainability.
"Loader" mode is currently marked as experimental until it can be tested more in deployed environments, while the original "Batch" mode is the default. To enable "Loader" mode, either:
- Set the
JOBS__LOADER__ENABLEDenvironment variable to1. - Adjust the logic in
RedShirt.Example.JobWorker.qCoreproject'sExtensions/ServiceCollectionExtensions.cs(as part of initializing this template)
Recommended steps when using this as a template:
-
To change the namespace of this solution en-masse for your purposes, use the
init-repo.shscript:bash init-repo.sh New.Namespace.Here
-
In the
RedShirt.Example.JobWorker.Coreproject, updateIJobDataModelinterface andJobDataModelimplementation to reflect the need of your project. -
In the
RedShirt.Example.JobWorker.Coreproject, updateSourceMessageConverterandSourceMessageSorterto fit your needs for your project. -
Update the
RedShirt.Example.JobWorker.Core.Logicproject to handleIJobDataModeljobs as needed by your project. -
Select a message source type and remove the projects for the sources that you are not using.
For local testing, see the test/local/ folder.