Version v1.x · .NET

Advanced Options

Advanced runtime tuning for retention, eventing, and registration behavior.

Advanced Options

Advanced options are useful once the baseline runtime is stable and observed under real workload.

Eventing options

Use these when connecting to hosted observability or tuning ingestion behavior:

  • Eventing.TenantId
  • Eventing.ClientSecret
  • Eventing.IngestionApiBaseUrl
  • Eventing.IngestionPath
  • Eventing.IngestionMaxBatchSize
  • Eventing.IngestionMaxRequestBodyBytes
  • Eventing.IngestionMaxRetryAttempts
  • Eventing.IngestionFlushIntervalSeconds
  • Eventing.IncludeErrorDetail
  • Eventing.MaxErrorDetailLength
  • Eventing.RuntimeControlEnabled
  • Eventing.RuntimeControlSyncPath
  • Eventing.RuntimeControlSyncIntervalSeconds
  • Eventing.RuntimeControlMaxReceiptUpload
  • Eventing.RuntimeControlCommandLeaseDurationSeconds

Event ingestion is automatically enabled when both TenantId and ClientSecret are set. Runtime command sync uses the same credential pair and API base URL.

Retention options

Use these to control terminal run cleanup behavior:

  • Retention.Enabled
  • Retention.RunRetentionSeconds
  • Retention.SweepIntervalSeconds
  • Retention.DeleteBatchSize

Registration options

  • JobRegistration.AutoDiscoverJobsFromAssembly: auto-discover public job types.
  • Recurring.RegistrationSync.*: reconcile code definitions with stored recurring records.

Example

builder.Services.AddDurableStackPostgres(connectionString, options =>
{
    options.Eventing.IngestionFlushIntervalSeconds = 5;
    options.Eventing.IncludeErrorDetail = false;

    options.Retention.Enabled = true;
    options.Retention.RunRetentionSeconds = 7 * 24 * 60 * 60;
    options.Retention.SweepIntervalSeconds = 300;
    options.Retention.DeleteBatchSize = 1000;

    options.JobRegistration.AutoDiscoverJobsFromAssembly = true;
});

Guidance

  • Change advanced options intentionally and validate impact in staging.
  • Keep sensitive settings (tenant/client secret) in secure secret storage.
  • Avoid enabling verbose error detail unless required for controlled environments.