Skip to main content

Configuration

Global options

All options are set via AddZeridionFlare() in Program.cs. Only ApiKey is required — everything else has sensible defaults.

builder.Services.AddZeridionFlare(options =>
{
options.ApiKey = "zf_live_sk_..."; // Required
options.ApiBaseUrl = "https://api.zeridion.com"; // Default
options.ConcurrencyLimit = 10; // Max parallel jobs
options.PollInterval = TimeSpan.FromSeconds(2); // Poll frequency
});

Options reference

PropertyTypeDefaultDescription
ApiKeystring(required)API key from the Zeridion Flare dashboard. Throws ArgumentException if not set.
ApiBaseUrlstringhttps://api.zeridion.comCloud API base URL. Override to http://localhost:5000 for local dev.
DefaultQueuestring"default"Declared but not currently consumed by the enqueue path. Use [JobConfig] or JobOptions instead.
DefaultMaxAttemptsint3Declared but not currently consumed by the enqueue path. Use [JobConfig] or JobOptions instead.
DefaultTimeoutTimeSpan30 minutesDeclared but not currently consumed by the enqueue path. Use [JobConfig] or JobOptions instead.
ConcurrencyLimitint10Max parallel jobs the worker processes simultaneously. Higher values improve throughput but use more memory and CPU.
PollIntervalTimeSpan2 secondsInterval between poll cycles when no jobs are available. Lower values increase responsiveness but make more API calls.
JobAssembliesAssembly[]?null (entry assembly)Assemblies to scan for IJob<T> and IRecurringJob implementations. If null, the entry assembly is scanned automatically.

Per-job configuration with [JobConfig]

Apply the JobConfigAttribute to a job class to set defaults that apply every time the job runs:

[JobConfig(Queue = "critical", MaxAttempts = 5, TimeoutSeconds = 600)]
public class ProcessPayment : IJob<PaymentRequest>
{
public async Task ExecuteAsync(PaymentRequest payload, JobContext ctx)
{
// Runs on the "critical" queue with 5 retries and a 10-minute timeout
}
}

For recurring jobs, add CronSchedule to set the execution interval:

[JobConfig(CronSchedule = "0 3 * * *", Queue = "maintenance")]
public class CleanupExpiredSessions : IRecurringJob
{
public async Task ExecuteAsync(JobContext ctx)
{
// Runs daily at 3:00 AM UTC
}
}
PropertyTypeDefaultDescription
Queuestring"default"Default queue for this job.
MaxAttemptsint3Default max retry attempts.
TimeoutSecondsint1800Default job timeout in seconds.
CronSchedulestring?nullCron expression for recurring jobs (5-field format, e.g. "0 3 * * *"). Only applicable to IRecurringJob implementations.

Per-call configuration with JobOptions

Override any default at enqueue time by passing a JobOptions instance. Properties left as null fall through to the [JobConfig] or global default.

await jobs.EnqueueAsync<ProcessPayment>(payload, new JobOptions
{
Queue = "urgent",
MaxAttempts = 10,
Timeout = TimeSpan.FromMinutes(5),
IdempotencyKey = $"payment-{payload.OrderId}",
Tags = new() { ["order_id"] = payload.OrderId }
});
PropertyTypeDefaultDescription
Queuestring?nullOverride the queue for this enqueue call.
MaxAttemptsint?nullOverride max retry attempts.
TimeoutTimeSpan?nullOverride the job timeout.
TagsDictionary<string, string>?nullCustom metadata tags visible in the dashboard.
IdempotencyKeystring?nullPrevents duplicate jobs — a second enqueue with the same key returns a 409 Conflict.

Option precedence

Settings resolve in a two-level cascade with hardcoded fallbacks. The most specific value wins:

For example, given this configuration:

  • [JobConfig(MaxAttempts = 5)] on the job class
  • new JobOptions { MaxAttempts = 10 } at enqueue time

The job gets 10 attempts, because JobOptions has the highest priority.

If the JobOptions.MaxAttempts were left as null, the job would get 5 attempts from the [JobConfig] attribute. If neither were set, it would fall back to the hardcoded default of 3.

note

ZeridionFlareOptions has DefaultQueue, DefaultMaxAttempts, and DefaultTimeout properties, but they are not currently consumed by the SDK's enqueue path. The effective cascade is JobOptions > [JobConfig] > hardcoded defaults. See Option Precedence for details.