Class QuartzSchedulerOptions
- Namespace
- Quartz
- Assembly
- Quartz.dll
Strongly typed configuration for the scheduler itself.
public sealed class QuartzSchedulerOptions
- Inheritance
-
QuartzSchedulerOptions
- Inherited Members
Remarks
Binds from the Scheduler section of the Quartz configuration, and is the typed
replacement for the quartz.scheduler.* property keys.
Fields
DefaultInstanceId
The value for InstanceId that marks a scheduler as not participating in a cluster.
public const string DefaultInstanceId = "NON_CLUSTERED"
Field Value
DefaultInstanceName
The default value for InstanceName.
public const string DefaultInstanceName = "QuartzScheduler"
Field Value
Properties
BatchTriggerAcquisitionFireAheadTimeWindow
How far past the current time a trigger may fire in order to be included in the current acquisition batch.
public TimeSpan BatchTriggerAcquisitionFireAheadTimeWindow { get; set; }
Property Value
Remarks
The other half of MaxBatchSize; neither batches anything on its own. At the default of Zero a batch holds the triggers due at the same instant and nothing else. Widening it fires triggers early by up to this much, which is what the batching costs.
Context
Values seeded into SchedulerContext when the scheduler is created.
public Dictionary<string, string> Context { get; }
Property Value
Remarks
Replaces the quartz.context.key.* property keys.
GenerateInstanceId
When true, InstanceId is generated at startup by the registered IInstanceIdGenerator instead of being taken from InstanceId.
public bool GenerateInstanceId { get; set; }
Property Value
IdleWaitTime
How long the scheduler waits before re-querying the job store when it finds no triggers to fire.
public TimeSpan IdleWaitTime { get; set; }
Property Value
Remarks
Must be at least one second. Lower values increase job store load for little benefit.
InstanceId
The id of the scheduler, which must be unique within a cluster.
public string InstanceId { get; set; }
Property Value
Remarks
Leave at the default to opt out of clustering. Set GenerateInstanceId instead of assigning a literal id when the id should be derived at startup.
InstanceName
The name of the scheduler, which must be unique within the process.
public string InstanceName { get; set; }
Property Value
MaxBatchSize
The maximum number of triggers the scheduler acquires in a single batch.
public int MaxBatchSize { get; set; }
Property Value
Remarks
Defaults to 1, which is also the point at which a database-backed store needs no cluster-wide
lock to acquire: raising it makes every acquisition cycle take the TRIGGER_ACCESS row
lock, including cycles that acquire nothing. It pays off where triggers genuinely arrive in
bunches, and costs lock traffic where they do not.
This is only the upper bound. What decides the size of a batch is BatchTriggerAcquisitionFireAheadTimeWindow: after the first trigger, only triggers due within that window of it join the batch, and the window defaults to Zero. Raising this alone leaves the effective batch at one trigger for any schedule whose fire times are spread out — the two are one setting in two halves, so move them together.
Must not exceed MaxConcurrency: triggers acquired beyond the number of threads there are to run them on are held by this node, unfireable by any other, until the pool drains.
PropagateTraceContext
Whether the scheduler records the trace context of the call that scheduled a trigger, so that the firing links back to it. On by default.
public bool PropagateTraceContext { get; set; }
Property Value
Remarks
A scheduled job runs minutes, hours or days after the call that asked for it, quite possibly on
another node. With this on, a scheduling call made inside an activity leaves the W3C
traceparent on the trigger — under TraceParent and
TraceState — and the firing's Quartz.Job.Execute span
carries an ActivityLink to it. A link and not a parent: the
firing is its own trace root, because a trace spanning the wait would be a trace nothing could
display.
Turn it off to keep the two reserved keys out of trigger data entirely — for a store whose rows are read by something that does not expect them, or where the extra two entries per trigger are not worth what they buy. Nothing else changes: the execute span is emitted either way.
ShutdownJobInterruption
When a shutting-down scheduler signals cancellation to the jobs still executing.
public ShutdownJobInterruption ShutdownJobInterruption { get; set; }
Property Value
Remarks
This was two independent booleans, one for a shutdown that waits for jobs and one for a shutdown that does not. They were never independent: together they answered a single four-way question, and the pair could be set to a combination — both false — that spelled the default in two ways.