Queues
Queues are the core building block of Rinda. A queue holds messages until they are consumed by your application.
Creating a Queue
- Node.js SDK
- REST API
import { Rinda } from '@rindahq/sdk';
const rinda = new Rinda({ apiKey: 'rk_prod_your_api_key' });
const queue = await rinda.queues.create({
name: 'order-events',
region: 'us-east-1',
});
console.log('Queue created:', queue.id, queue.name);
curl -X POST https://api.rinda.dev/v1/queues \
-H "Authorization: Bearer $RINDA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "order-events",
"region": "us-east-1"
}'
Queue Types
Standard Queues
Best for high-throughput workloads where strict ordering is not required:
- Messages delivered at least once
- Best-effort ordering
- Nearly unlimited throughput
FIFO Queues
Best for workflows that require strict message ordering:
- Messages delivered in exact order
- Exactly-once processing via deduplication
- Message groups for parallel ordered processing
const fifoQueue = await rinda.queues.create({
name: 'payment-events',
region: 'us-east-1',
isFifo: true,
dlqEnabled: true,
maxReceiveCount: 3,
});
See the FIFO Queues Guide for details.
Configuration Options
| Option | Default | Description |
|---|---|---|
name | required | Unique name within the project |
region | required | Region the queue runs in (us-east-1, eu-west-1, etc.) |
isFifo | false | Create a FIFO queue for strict ordering |
encrypted | true | Enable server-side encryption |
dlqEnabled | false | Enable dead-letter queue |
maxReceiveCount | 5 | Max delivery attempts before sending to DLQ |
visibilityTimeoutSecs | 30 | Seconds a message stays invisible after being received |
messageRetentionDays | 4 | Days to retain unprocessed messages |
delaySeconds | 0 | Default delay for messages in this queue |
Listing Queues
const queues = await rinda.queues.list();
for (const q of queues) {
console.log(`${q.name} (${q.isFifo ? 'FIFO' : 'standard'}) — ${q.region}`);
}
Getting a Queue
const queue = await rinda.queues.get('QUEUE_ID');
console.log(queue.name, queue.isFifo, queue.region);
Queue Statistics
const q = rinda.queue('QUEUE_ID');
const stats = await q.stats();
console.log('Messages available:', stats.approximateMessageCount);
console.log('Messages in flight:', stats.approximateNotVisible);
console.log('Messages delayed:', stats.approximateDelayed);
Deleting a Queue
Deleting a queue permanently removes all its messages. This action cannot be undone.
await rinda.queues.delete('QUEUE_ID');
Regions
| Region | Location |
|---|---|
us-east-1 | N. Virginia |
us-west-2 | Oregon |
eu-west-1 | Ireland |
eu-central-1 | Frankfurt |
ap-southeast-1 | Singapore |
Backlog alerts
A queue filling faster than it drains is invisible until something downstream breaks, and by then the backlog is hours old. Set a threshold and the account owners are emailed when it is crossed:
await rinda.queues.update('QUEUE_ID', { depthAlertThreshold: 1000 });
Or from the queue's Settings page in the dashboard.
The count includes messages being retried, not just ones waiting to be picked up — a queue whose consumer keeps failing has everything in flight, and counting only what is visible would call it empty.
One email per backlog
You get one email when the queue crosses the threshold, and no more until it drops back under and rises again. An alert that repeats every fifteen minutes until someone fixes it is one people build a mail filter for, and then the next one goes unread too.
Recovery is not emailed either. A queue draining is the expected outcome, and mail nobody has to act on trains people to ignore the mail they do.
Turning it off
await rinda.queues.update('QUEUE_ID', { depthAlertThreshold: null });
There is no default threshold. What counts as backed up depends entirely on the queue — ten messages is an emergency on one that is normally empty and unremarkable on one that batches overnight — so nothing is watched until you say what to watch for.