@camunda8/sdk
    Preparing search index...

    Class ZBStreamWorker

    Implements

    Index

    Constructors

    Methods

    • Type Parameters

      • WorkerInputVariables
      • CustomHeaderShape
      • WorkerOutputVariables

      Parameters

      • req: StreamActivatedJobsRequest & {
            customHeadersDto: new (...args: any[]) => Readonly<CustomHeaderShape>;
            inputVariableDto: new (...args: any[]) => Readonly<WorkerInputVariables>;
            jitter?: number;
            maxJobsActive?: number;
            pollInterval?: number;
            pollMaxJobsToActivate?: number;
            taskHandler: ZBWorkerTaskHandler<
                WorkerInputVariables,
                CustomHeaderShape,
                WorkerOutputVariables,
            >;
        } & StreamJobsRecoveryOptions
        • customHeadersDto: new (...args: any[]) => Readonly<CustomHeaderShape>
        • inputVariableDto: new (...args: any[]) => Readonly<WorkerInputVariables>
        • Optionaljitter?: number

          Optional jitter in milliseconds. When provided, the worker will wait a random period up to this value before polling and opening the stream. Useful for staggering multiple stream workers.

        • OptionalmaxJobsActive?: number

          Maximum number of jobs this registration handles concurrently, counting jobs from the stream and from backlog polls. Stream jobs that arrive while the worker is at capacity are buffered and started as handlers settle, so both delivery paths share the limit. Polls never activate more than the free capacity, and while a backlog exists the worker polls again as soon as fewer than 30% of this many jobs are in flight, rather than waiting for a whole batch to finish (like the Java client's maxJobsActive). Defaults to pollMaxJobsToActivate.

        • OptionalpollInterval?: number

          Interval in milliseconds between sidecar poll cycles. The sidecar poll is a low-frequency safety net that picks up jobs the stream may have missed (e.g. jobs re-queued after a timeout). Each poll is a command on the broker, so keep this value high to minimise load.

          Defaults to 30000 (30 seconds). Set to 0 or -1 to disable recurring polling (the initial backfill poll still runs).

        • OptionalpollMaxJobsToActivate?: number

          Maximum number of jobs to activate per poll cycle (both the initial backfill and the recurring sidecar polls). Defaults to 32.

        • taskHandler: ZBWorkerTaskHandler<
              WorkerInputVariables,
              CustomHeaderShape,
              WorkerOutputVariables,
          >

      Returns Promise<StreamHandle>