abpframework/abp · error · AbpException

TickerQ does not support dynamic background worker registrat

Error message

TickerQ does not support dynamic background worker registration at runtime. Please use Hangfire or Quartz provider for dynamic background workers.

What it means

Thrown unconditionally by TickerQDynamicBackgroundWorkerManager.RemoveAsync because TickerQ's function table is frozen at startup and cannot be modified at runtime. Removing a worker dynamically is not supported; the error message points to Hangfire or Quartz, whose dynamic managers support runtime removal.

Source

Thrown at framework/src/Volo.Abp.BackgroundWorkers.TickerQ/Volo/Abp/BackgroundWorkers/TickerQ/TickerQDynamicBackgroundWorkerManager.cs:24

[Dependency(ReplaceServices = true)]
public class TickerQDynamicBackgroundWorkerManager : IDynamicBackgroundWorkerManager, ISingletonDependency
{
    public virtual Task AddAsync(
        string workerName,
        DynamicBackgroundWorkerSchedule schedule,
        DynamicBackgroundWorkerHandler handler,
        CancellationToken cancellationToken = default)
    {
        throw new AbpException(
            "TickerQ does not support dynamic background worker registration at runtime. " +
            "TickerQ uses FrozenDictionary for function registration, which requires all functions to be registered before the application starts. " +
            "Please use Hangfire or Quartz provider for dynamic background workers.");
    }

    public virtual Task<bool> RemoveAsync(string workerName, CancellationToken cancellationToken = default)
    {
        throw new AbpException(
            "TickerQ does not support dynamic background worker registration at runtime. " +
            "Please use Hangfire or Quartz provider for dynamic background workers.");
    }

    public virtual Task<bool> UpdateScheduleAsync(
        string workerName,
        DynamicBackgroundWorkerSchedule schedule,
        CancellationToken cancellationToken = default)
    {
        throw new AbpException(
            "TickerQ does not support dynamic background worker registration at runtime. " +
            "Please use Hangfire or Quartz provider for dynamic background workers.");
    }

    public virtual bool IsRegistered(string workerName)
    {
        // TickerQ does not support runtime registration, so there are never any registered workers.
        return false;

View on GitHub (pinned to 7ed43b1931)

Solutions

  1. Use the Hangfire or Quartz provider if you need runtime worker removal.
  2. With TickerQ, control whether a worker executes by gating its DoWork logic (feature flags, settings) rather than removing the worker itself.
  3. Restart the application after changing the static worker registrations rather than removing at runtime.

Example fix

// before — runtime removal under TickerQ (throws)
await dynamicManager.RemoveAsync("legacy-worker", cancellationToken);

// after — gate the worker body with a feature check
protected override async Task DoWorkAsync(PeriodicBackgroundWorkerContext context)
{
    if (!await FeatureChecker.IsEnabledAsync("LegacyWorkerEnabled")) return;
    // ... actual work
}
Defensive patterns

Strategy: try-catch

Validate before calling

if (dynamicManager is Volo.Abp.BackgroundWorkers.TickerQ.TickerQDynamicBackgroundWorkerManager)
{
    throw new NotSupportedException("TickerQ does not support dynamic RemoveAsync; gate the worker logic instead.");
}

Type guard

static bool SupportsDynamicRemoval(IDynamicBackgroundWorkerManager mgr) => mgr is not Volo.Abp.BackgroundWorkers.TickerQ.TickerQDynamicBackgroundWorkerManager;

Try / catch

try { await dynamicManager.RemoveAsync(name, ct); }
catch (AbpException ex) when (ex.Message.Contains("does not support dynamic background worker registration"))
{
    logger.LogWarning(ex, "Cannot remove worker at runtime under TickerQ; gate the worker body with a flag instead.");
}

Prevention

When it happens

Trigger: Calling IDynamicBackgroundWorkerManager.RemoveAsync(workerName) at runtime when the TickerQ provider is the active implementation. Occurs in code paths that tear down or reconfigure workers dynamically (e.g. disabling a feature at runtime).

Common situations: Application logic that removes workers based on feature flags or tenant deactivation, run under the TickerQ provider. Reusing dynamic-manager calls from a Hangfire-based codebase after switching to TickerQ.

Related errors


AI-assisted analysis of abpframework/abp@7ed43b1931 (2026-08-13). Data as JSON: /api/errors/ed74302f9042b76b. Report an issue: GitHub.