better-effect
Integrations and adaptersMQ storage adapters

MQ storage adapters

Keep one Queue, Job, Worker and Runtime model while choosing durable storage.

better-effect-mq is the core queue and worker package. Each adapter on this page is an extension: it supplies a persistent JobStore (and optional event, schedule, flow, or outbox capabilities) through a Layer. Your Queue.define, Job descriptor, Worker.handle, Worker.service, and Runtime composition stay the same.

Keep validation in the application boundary: define Zod 4 schemas and use Codec.standardSchema, optionally with better-effect-schema for schema-backed classes and normalized failures. The trusted JSON escape hatch is for trusted JSON values, not the default adapter example.

The adapter boundary

The application owns job identity and handler behavior. The adapter owns its connection, schema, transactions, and storage-specific wake or recovery details. Read the MQ introduction for the core model, then use one adapter's quick start to provide the same JobStore Service.

For an outbox handoff, prepare the request and record before the domain write, then call the selected adapter's transaction helper. The callback performs the domain write; the adapter appends the record automatically and owns commit, rollback, and cleanup. See the outbox guide and the adapter page for the exact resource and options shape.

On this page