Table of Contents

Class SchedulerConstants

Namespace
Quartz
Assembly
Quartz.dll

Scheduler constants.

public static class SchedulerConstants
Inheritance
SchedulerConstants
Inherited Members

Remarks

The default group a job or trigger belongs to is DefaultGroup — spelled JobKey.DefaultGroup or TriggerKey.DefaultGroup at a call site — which is where the name of the thing it names lives.

Fields

DefaultFailOverGroup

A constant ITrigger group name used internally by the scheduler - clients should not use the value of this constant ("FAILED_OVER_JOBS") for the name of a ITrigger's group.

public const string DefaultFailOverGroup = "FAILED_OVER_JOBS"

Field Value

string

DefaultRecoveryGroup

A constant ITrigger group name used internally by the scheduler - clients should not use the value of this constant ("RECOVERING_JOBS") for the name of a ITrigger's group.

public const string DefaultRecoveryGroup = "RECOVERING_JOBS"

Field Value

string

FailedJobOriginalTriggerFireTime

A constant JobDataMap key that can be used to retrieve the fire time of the original ITrigger from a recovery trigger's data map in the case of a job recovering after a failed scheduler instance.

public const string FailedJobOriginalTriggerFireTime = "QRTZ_FAILED_JOB_ORIG_TRIGGER_FIRETIME_AS_STRING"

Field Value

string

Remarks

Note that this is the time the original firing actually occurred, which may be different from the scheduled fire time - as a trigger doesn't always fire exactly on time.

See Also

FailedJobOriginalTriggerGroup

A constant JobDataMap key that can be used to retrieve the group of the original ITrigger from a recovery trigger's data map in the case of a job recovering after a failed scheduler instance.

public const string FailedJobOriginalTriggerGroup = "QRTZ_FAILED_JOB_ORIG_TRIGGER_GROUP"

Field Value

string
See Also

FailedJobOriginalTriggerName

A constant JobDataMap key that can be used to retrieve the name of the original ITrigger from a recovery trigger's data map in the case of a job recovering after a failed scheduler instance.

public const string FailedJobOriginalTriggerName = "QRTZ_FAILED_JOB_ORIG_TRIGGER_NAME"

Field Value

string
See Also

FailedJobOriginalTriggerScheduledFireTime

A constant 
JobDataMap

key that can be used to retrieve the scheduled fire time of the original

Trigger

from a recovery trigger's data map in the case of a job recovering after a failed scheduler instance.

public const string FailedJobOriginalTriggerScheduledFireTime = "QRTZ_FAILED_JOB_ORIG_TRIGGER_SCHEDULED_FIRETIME_AS_STRING"

Field Value

string

Remarks

Note that this is the time the original firing was scheduled for, which may be different from the actual firing time - as a trigger doesn't always fire exactly on time.

ForceJobDataMapDirty

Signals Quartz not to consider job data map as clean when deserialized - used in scenarios where data format needs to be converted.

public const string ForceJobDataMapDirty = "QRTZ_FORCE_JOB_DATAMAP_DIRTY"

Field Value

string

JobInput

The JobDataMap key an IJob<TInput>'s input is carried under, on the job's own map or — overriding it — on the trigger's.

public const string JobInput = "QRTZ_JOB_INPUT"

Field Value

string

Remarks

The stored value is always a string: the scheduler serializes anything else with the scheduler's IJobInputSerializer as the job or trigger is stored. A string is what survives every path the value can take afterwards — AdoJobStore's StoreJobDataAsStrings mode, the JSON write gate that refuses a job data value no reader can produce, the Newtonsoft serializer, the binary blob column and the HTTP wire — so the round trip does not depend on which of them the value went through.

Set it with UsingInput on a job or trigger builder rather than by spelling this key.

See Also
IJob<TInput>

ScheduledJobGroup

The IJobDetail group the one-call ScheduleJob<TJob, TInput>(IScheduler, TInput, DateTimeOffset, OneOffJobOptions, CancellationToken) overloads keep their durable jobs in — one per job type, named after the type.

public const string ScheduledJobGroup = "QRTZ_SCHEDULED"

Field Value

string

Remarks

Clients should not build jobs of their own in this group: it is the scheduler's, and what is in it is one job per job type that the one-call overloads maintain. It is named here so that a dashboard, a query or a clean-up can say which jobs it means without spelling the string.

Addressing the job that is in it — to point a trigger of one's own at it, or to look it up — is ScheduledJobKey<TJob>(), which spells the whole key so nothing has to re-derive it.

TraceParent

The JobDataMap key carrying the W3C traceparent of the activity that scheduled a trigger, so that the firing can be linked back to it however much later it happens.

public const string TraceParent = "QRTZ_TRACEPARENT"

Field Value

string

Remarks

Written onto the trigger's map by the scheduler, on every entry point that stores a trigger, whenever Current is a W3C activity and PropagateTraceContext is on. Read back when the firing's span is opened, where it becomes an ActivityLink rather than a parent — a job scheduled for next Tuesday is its own trace, and a trace that stays open for a week is not a trace.

A trigger scheduled outside an activity has the key removed rather than left alone, because the scheduler stores the trigger object it was handed rather than a copy of it: a trigger re-scheduled outside an activity would otherwise keep pointing at the trace that scheduled it the first time.

This is the trigger's map, never the job's, so PersistJobDataAfterExecutionAttribute — which writes back only the job's map — never sees it and the two cannot interact.

See Also

TraceState

The JobDataMap key carrying the W3C tracestate that accompanies TraceParent, present only when the scheduling activity had one.

public const string TraceState = "QRTZ_TRACESTATE"

Field Value

string
See Also

Methods

ScheduledJobKey<TJob>()

The key of the single durable job every firing of TJob scheduled by the one-call ScheduleJob<TJob, TInput> overloads hangs off.

public static JobKey ScheduledJobKey<TJob>() where TJob : IJob

Returns

JobKey

The key of the durable job the one-call overloads ensure.

Type Parameters

TJob

The job whose durable detail to name.

Remarks

One durable job per job type, named after the type and kept in ScheduledJobGroup. Named here, beside the group it is in, because that group is reserved: an integration with a second scheduling path of its own — a recurring trigger built by hand, say, for the same job — needs to point that trigger at the job the one-liner ensures, and asking is better than re-deriving the key against the advice not to build jobs in the group.

The key is derived from the type, not looked up, so it answers whether or not anything has been scheduled yet. The job itself appears in the store the first time one of the one-call overloads is used on a scheduler.

See Also