Class JobEffects

java.lang.Object
com.kingsrook.qqq.backend.core.jobs.effects.JobEffects

public final class JobEffects extends Object
How a process step causes a side effect outside the job's database (spec section 2.13). Never call the external system from a step; emit the effect: JobEffects.emit(runBackendStepInput, "welcomeEmail", customerId, payload); In a durable job, the effect is buffered in the chunk's scope and written to the jobs_effect outbox with the chunk's progress (its transaction, with SAME_TRANSACTION); the dispatcher delivers it. Its idempotency key is jobId:chunkSeq:rowKey:effectName, so a rerun chunk emits the same keys and nothing is doubled. Outside a job, it is delivered at once (with a fresh key; there is no chunk to rerun) and anything but SENT throws.
  • Field Details

    • JOB_LEVEL_CHUNK_SEQ

      public static final int JOB_LEVEL_CHUNK_SEQ
      The chunk sequence in the keys of job-level effects (not from a chunk).
      See Also:
  • Method Details