# Job queues

> BullMQ-ready Redis with a scoped ACL for background jobs.

Source: https://gheima.ma/docs/managed-queues

A managed queue is a Redis user set up for BullMQ. ACLs limit your keys and pub/sub channels to a private prefix, and destructive commands such as FLUSHALL, CONFIG, and KEYS are denied. You enqueue and process background jobs without running your own Redis.

### Create a queue

Open Queues and click "New queue". When it's running, click "Reveal connection" to get the connection string and the key prefix. Link the queue to your service under Linked resources and every deploy injects them as REDIS_URL and QUEUE_PREFIX (or store them yourself), then pass the prefix to BullMQ so every key it writes stays in your namespace. Run the worker as a WORKER service on Gheima (no HTTP port), or anywhere that can reach the Redis host.

```ts
import { Queue, Worker } from 'bullmq';
const connection = { url: process.env.REDIS_URL };
const prefix = process.env.QUEUE_PREFIX; // required: keys are ACL-scoped
const queue = new Queue('jobs', { connection, prefix });
new Worker('jobs', async (job) => { /* handle */ }, { connection, prefix });
await queue.add('task', { hello: 'world' });
```

Enqueue and process jobs with BullMQ, using the revealed credentials.

> Note: Always pass the key prefix to BullMQ. Without it, writes fall outside your ACL scope and Redis rejects them.

> Result: Your app runs background jobs on an isolated, BullMQ-ready Redis with revocable credentials.

---

All docs: https://gheima.ma/docs.md
