Skip to content

Best practices ​

  • Make handlers idempotent. Delivery is at least once: a worker killed before its outcome was acknowledged has the task run again. A unique_key stops a duplicate enqueue, not a second run. The context's dedupe_key (dedupeKey, DedupeKey; not in PHP) is <workflow or job id>:<step or job name>:<attempt>: a key for side effects that must happen once per attempt.
  • Declare retries on workflow steps that may hit a crash. A step runs again after its worker dies only if it declares retries; list the errors that must not be retried in retry.non_retryable.
  • Give long steps a heartbeat. Set heartbeat_ms and call ctx.heartbeat() inside the work, so a hung handler is timed out instead of holding the step for timeout_ms (24 h by default).
  • Use the right limit. Throttle a queue to protect workers; rate-limit a key to protect what your code calls. See Comparisons.
  • Seal what is sensitive, and reach the gateway over HTTPS. Sealed fields travel in plain text from your app to the gateway.
  • Keep secrets out of keys and names. Values with secret-looking keys are masked in the console; a search attribute whose name looks secret cannot be searched.
  • Upgrade every engine together. Every process that conducts joobq-pro workflows on the same Redis runs joobq-pro 0.4.1 or later; upgrade every process before the first build promote.
  • Size the database pool for every instance. Instances x JOOBQUI_DB_POOL_SIZE must stay under PostgreSQL's max_connections.
  • Use a Redis that does not evict (noeviction or volatile-*) and persists (AOF or RDB).
  • Set CRYSTAL_ENV=production on every real deployment, and JOOBQUI_CLIENT_IP_HEADER behind a proxy.

JoobQ Core is MIT licensed. JoobQ Pro needs a licence key.