ExuluQueues.register() is the sole configuration entry point. Call it once per queue, typically in the same file where you define your contexts or your initdb script. The call is synchronous and registers the queue internally; you get back a { use } object whose .use() method connects to Redis and returns the live queue configuration.
Parameters
Unique queue name. Passed directly to BullMQ as the queue name, stored in
ExuluQueues.list, and injected into the GraphQL QueueEnum at boot. Use lowercase with hyphens or underscores — the name appears in Redis keys and the platform UI.Two-tier concurrency configuration. Both values must be positive integers.
How many jobs a single worker process handles in parallel. IMP passes this value to the BullMQ
Worker concurrency option when it creates the worker at app startup.Global maximum active jobs across all worker processes, enforced by BullMQ via
queue.setGlobalConcurrency(). A queue with concurrency.queue: 10 will never have more than 10 jobs in the active state system-wide, regardless of how many workers are running.Maximum jobs per second that any single worker process processes from this queue. IMP applies this as a BullMQ
Worker rate limiter ({ max: ratelimit, duration: 1000 }). Rate limiting is implemented at the worker level, not the queue level, because BullMQ’s global rate limit lives on workers. Defaults to 1 job per second.Maximum wall-clock time a single job may run before BullMQ marks it failed. Stored on the registration and passed to the worker as
lockDuration. Defaults to 180 seconds (3 minutes).Return value
register() returns { use: () => Promise<ExuluQueueConfig> }.
.use()
.use() the first time:
- Verifies that
REDIS_HOSTandREDIS_PORTare set; throws if either is empty. - Creates a BullMQ
QueuewithenableOfflineQueue: falseso jobs are never silently buffered when Redis is down. - Races
queue.waitUntilReady()against a 60-second timeout (hard abort with a descriptive error). - Sets
queue.setGlobalConcurrency(concurrency.queue). - Returns
ExuluQueueConfigand stores the instance inExuluQueues.queues.
.use() calls for the same name return the cached instance immediately (reconciling concurrency.queue if it changed).
ExuluQueueConfig
The live BullMQ
Queue instance. Use it to add jobs, inspect counts, pause/resume, or drain — see API reference.The value passed to
register(), stored here so the worker creation logic can read it without access to the original registration closure.The value passed to
register() (default 180). Workers use this as the job lock duration.The resolved concurrency values, after clamping to at least 1 for both keys.
Optional. Set by the ExuluContext source or processor config that receives
ExuluQueueConfig; not set by register() itself.Optional. Same as
retries — set by the consumer, not by register().Configuration examples
Embedder queue
Document processing queue
Data-source sync queue
Eval queue
Rate-limit sizing
Theratelimit parameter controls tokens-per-minute consumption for embedding queues. Use this formula as a starting point:
5_000_000 / 1_024 / 60 ≈ 81 requests per second. Set ratelimit: 80 to stay safely below the cap, then observe your error rate and adjust.
Next steps
API reference
register(), queue(), .list, and .queues — full signatures and queue inspection.ExuluContext
Pass the queue config to an embedder, source, or processor.