feature/external scheduler support#2
Merged
bugrakosen merged 7 commits intomasterfrom Feb 4, 2026
Merged
Conversation
- Add IsExternal/ExternalJobId fields to jobs/occurrences for external scheduler mapping - Implement ExternalJobTrackerService to upsert and track external jobs via RabbitMQ - Extend Redis scheduler for external job ID mapping and bulk ops - Add Milvasoft.Milvaion.Sdk.Worker.Quartz project: provides Quartz listeners, publisher, and registry for automatic job registration and monitoring in Milvaion - Update DTOs, validation, and UI to display and restrict external jobs/workers (badges, disable edit/trigger/delete) - Add configuration for external scheduler integration - Provide sample worker with Dockerfile, config, and documentation - Improve error handling, logging, and test code for external job support
- Add ExternalOccurrenceId support for precise job tracking - Fix bug: use correct property for external occurrence mapping - NACK failed RabbitMQ messages for reliable processing - Improve logging and debug output for external job tracking - Update UI: label external job ID as "EXTERNAL ID" - Refactor code for readability (multi-line args, cleanup) - Ensure MilvaionExternalSchedulerOptions is properly bound - Add comprehensive Quartz integration documentation - Clean up sample job and scheduling examples - Remove unused usings and improve comments throughout
Remove ConcurrentDictionary for correlation IDs and store/retrieve them directly in JobDataMap. Simplifies code and reduces state management by leveraging existing job context.
Introduce a GitHub Actions workflow to automate building and pushing the SampleQuartzWorker Docker image to Docker Hub. The workflow is triggered on changes to relevant source files or manual dispatch, reads the version from a new VERSION file (initialized to 1.0.0), and tags images with both "latest" and the specific version.
- Introduced full support for Hangfire as an external scheduler in Milvaion, including new documentation, dashboard updates, and Docker workflows. - Added `Milvasoft.Milvaion.Sdk.Worker.Hangfire` package with job filters, publisher, registry, and startup service for seamless Hangfire job monitoring. - Created `SampleHangfireWorker` project with sample jobs, configuration, Dockerfile, and README for demonstration and deployment. - Refactored job registry logic to use a unified `ExternalJobRegistry` for both Quartz and Hangfire integrations. - Improved internal/external job request handling and updated related command handlers and documentation. - Updated solution, build workflows, and project files for NuGet packaging and platform targeting.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Add external scheduler integration support for Quartz.NET and Hangfire. This allows users to keep their existing scheduler while gaining Milvaion's powerful monitoring, dashboards, and alerting capabilities without changing their job execution infrastructure.
Type of Change
Changes Made
New SDK Packages
Milvasoft.Milvaion.Sdk.Worker.Quartz- Quartz.NET integration packageMilvaionJobListener- Tracks job execution lifecycle (start, complete, fail)MilvaionSchedulerListener- Registers jobs when scheduled, manages heartbeatsExternalJobPublisher- Publishes job events to RabbitMQQuartzMilvaionExtensions-AddMilvaionQuartzIntegration()andUseMilvaion()extension methodsMilvasoft.Milvaion.Sdk.Worker.Hangfire- Hangfire integration packageMilvaionJobFilter- ImplementsIServerFilter,IElectStateFilter,IClientFilterfor job trackingHangfireWorkerStartupService- Scans recurring jobs from storage usingIStorageConnectionand registers themExternalJobPublisher- Publishes job events to RabbitMQHangfireMilvaionExtensions-AddMilvaionHangfireIntegration()andUseMilvaion()extension methodsShared Infrastructure
ExternalJobRegistry- Unified job registry used by both Quartz and Hangfire SDKs (consolidated from separate registries)MilvaionExternalSchedulerOptions- Configuration options withSourcepropertySample Workers
SampleQuartzWorker- Demo Quartz worker withSampleLogJobandSendEmailJobSampleHangfireWorker- Demo Hangfire worker withSampleLogJobandSendEmailJobILogPublisherandPerformContext/IJobExecutionContextServer-side Changes
ExternalJobTrackerService- Consumes external job messages from RabbitMQScheduledJobrecords withIsExternal = trueJobOccurrencerecords for each executionRedisSchedulerService- Fixed null value handling inCacheJobDetailsAsyncExternalJobId ?? string.Emptyto preventArgumentExceptionin Redis HashEntryJobNameInWorker ?? string.Emptyfor null safetyJobDispatcherService- Added!j.IsExternalfilter to exclude external jobs from internal dispatchGitHub Actions
quartzworker-docker-build.ymlworkflowhangfireworker-docker-build.ymlworkflowsdk-nuget-publish.ymlwith Quartz and Hangfire SDK publish jobsDocumentation
docs/portaldocs/18-external-scheduler.mdwith complete Hangfire integration guideREADME.mdwith External Scheduler Integration sectionpackagereadme.mdfiles for both SDK packagesTesting
Test Configuration:
Manual Testing:
Checklist
Breaking Changes
None. This is an additive feature that doesn't affect existing Milvaion workers.
Migration Guide
No migration needed. Existing users can optionally add Quartz/Hangfire integration