Repository navigation
Add Spring.Scheduling.Quartz4 for Quartz.NET 4.x - #399
Merged
Merged
Conversation
New package Spring.Scheduling.Quartz4, net10.0 only. Types that are the same as in Quartz3 are compiled from the Quartz3 sources by link with a QUARTZ4 define; the others are Quartz4-only files. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LGkLQuAuUjvRjrU1AcTsmk Signed-off-by: Marko Lahma <marko.lahma@gmail.com>
…e solution and the pack list (packet Q4a) Unit tests for the Quartz4 package, ported from the Quartz3 tests where they compile against Quartz 4 and rewritten against the new creation hook where they used SchedulerFactoryType: typed options, precedence, repository exposure, job factory, thread pool, misfire enums, job and trigger keys, JobDetailObject, one-thread registration under a transaction manager, start and shutdown with wait. Fixes found by the tests: Spring's time span converter for the nullable time span options, a null job type is refused, the driver delegate is chosen through a public helper. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LGkLQuAuUjvRjrU1AcTsmk Signed-off-by: Marko Lahma <marko.lahma@gmail.com>
…ep Dependabot's Quartz lines apart (packet Q4a) AGENTS.md architecture rows and the VersionOverride note, BreakingChanges.txt item 14, the package list in README.md, the Quartz3 README and description, a Dependabot rule that keeps Quartz 3.x from moving to 4.x. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LGkLQuAuUjvRjrU1AcTsmk Signed-off-by: Marko Lahma <marko.lahma@gmail.com>
…packet Q4a) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LGkLQuAuUjvRjrU1AcTsmk Signed-off-by: Marko Lahma <marko.lahma@gmail.com>
…converter, cached JobType, nits (review follow-ups)
The default AdaptableJobFactory is registered after the ConfigureQuartz callback, so the callback's job factory wins when JobFactory is not set; an explicit JobFactory still wins over the callback. The time span options are set-only TimeSpan properties over nullable fields, and the static constructor that replaced the TimeSpan? converter is gone. JobDetailObject caches the Quartz JobType. The adapt message names Func<Task>, the start delay log placeholder is {StartDelay}, and a second Dispose is a no-op.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LGkLQuAuUjvRjrU1AcTsmk
Signed-off-by: Marko Lahma <marko.lahma@gmail.com>
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.
Part of #388:
Spring.Scheduling.Quartz4, a new package for Quartz.NET 4.x (4.7.2), shipped alongsideSpring.Scheduling.Quartz3, which becomes maintenance-only. The namespace is the same,Spring.Scheduling.Quartz.The package targets net10.0 only, the only target Quartz 4 supports. It references
Quartz4.7.2 throughVersionOverride, soDirectory.Packages.propskeeps Quartz3 on 3.22.9.This PR doesn't include two pieces:
Both follow once that hook ships, and the README has a placeholder paragraph for the first.
Sources
The types shared with Quartz3 are compiled by link, with a
QUARTZ4define. Three Quartz3 files (QuartzJobObject,DelegatingJob,MethodInvokingJob) gain#if QUARTZ4blocks that keep the original line verbatim in#else; Quartz3's behaviour and tests are unchanged.These have Quartz4-only files:
SchedulerFactoryObject,SchedulerAccessor,SchedulerAccessorObject;JobDetailObject, the trigger objects andMethodInvokingJobDetailFactoryObject;AdaptableJobFactory,SpringObjectJobFactory,LocalTaskExecutorThreadPool,SpringDbProviderAdapter.Design (decided on #388)
SchedulerFactoryObjectbuilds onQuartzSchedulerBuilder, keeps theStandaloneSchedulerFactory, and on dispose shuts the scheduler down first (honouringWaitForJobsToCompleteOnShutdown), then disposes the factory.QuartzPropertiesbag, then typed properties (SchedulerName,InstanceId,MaxConcurrency,MisfireThreshold,TablePrefix,Clustered,IdleWaitTimeand more), then aConfigureQuartzcallback, so later layers win.JobFactory,TaskExecutororDbProviderbeats the callback, and the default job factory is registered after the callback so the callback can replace it.SchedulerRepository.Instance.SchedulerFactoryTypeis gone, and aprotected virtual CreateScheduler(builder)hook takes its place.IJobFactoryusesJobScope: the factory disposes only the job instances it created.IThreadPoolruns over Spring'sITaskExecutorand waits for in-flight work onDrainandShutdown.QuartzJobObject.ExecuteInternalis nowValueTask ExecuteInternal(IJobExecutionContext, CancellationToken), which is source-breaking for subclasses and documented.JobDetailObjectimplementsIJobDetailitself, sinceJobDetailImplis internal in 4.x. Its job type must be anIJob, and a non-IJob type is refused with a pointer toMethodInvokingJobDetailFactoryObject.MisfireInstruction = "DoNothing"in XML). There are noName/Group/JobName/JobGroupor misfire-name compatibility properties.JobSchedulingDataLocationsis dropped. Quartz 4's XML processor is internal and is reachable only throughQuartz.Plugins; the README shows that route throughConfigureQuartz.DbProvidersupplies the connections, andQuartzDbProvidernames Quartz's dialect (SystemDataSqlClient,Npgsqland so on). The store is configured withAcceptEnlistedTransactionsready for the transaction bridge.SchedulerAccessorregisters jobs and triggers synchronously inside itsTransactionManagertransaction. On net10, Spring's transaction state is thread-static, and awaiting Quartz would commit on another thread.LogManager.LoggerFactorywhen one is set.Also in this PR
Spring.Scheduling.Quartz3is marked maintenance-only in its README and package description..github/dependabot.ymlignores Quartz semver-major updates, so Quartz3 is never offered 4.x. Whether Dependabot keeps 4.x minor bumps on theVersionOverridecan only be confirmed by its first Quartz PR.Tests
Spring.Scheduling.Quartz4.Tests(net10.0): 173 tests, all passing. They cover:Spring.Scheduling.Quartz3.Testsis unchanged: 150 tests on two TFMs.A spring-reviewer pass accepted the change. Its follow-ups are in the last commit:
TimeSpan?converter change;BindByNamefor custom providers, which only matters for Oracle and was the same in Quartz3, is carried to the transaction-bridge PR.🤖 Generated with Claude Code
https://claude.ai/code/session_01LGkLQuAuUjvRjrU1AcTsmk