Skip to main content

Queues

Queues are the core building block of Rinda. A queue holds messages until they are consumed by your application.

Creating a Queue​

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);

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​

OptionDefaultDescription
namerequiredUnique name within the project
regionrequiredRegion the queue runs in (us-east-1, eu-west-1, etc.)
isFifofalseCreate a FIFO queue for strict ordering
encryptedtrueEnable server-side encryption
dlqEnabledfalseEnable dead-letter queue
maxReceiveCount5Max delivery attempts before sending to DLQ
visibilityTimeoutSecs30Seconds a message stays invisible after being received
messageRetentionDays4Days to retain unprocessed messages
delaySeconds0Default 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​

danger

Deleting a queue permanently removes all its messages. This action cannot be undone.

await rinda.queues.delete('QUEUE_ID');

Regions​

RegionLocation
us-east-1N. Virginia
us-west-2Oregon
eu-west-1Ireland
eu-central-1Frankfurt
ap-southeast-1Singapore

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.