Appearance
Quickstart
Spooler is a simple, fully managed message queue. Send bytes, receive them in a worker, and acknowledge the work once it is done. Receiving leases a message; it does not delete it – the message survives a worker crash and can be retried later.
Set up the environment
To follow the examples below you need either an API key from the console or the local image, which runs the same API in memory and accepts any key.
For the local image, run it with Docker:
sh
docker run --rm -p 127.0.0.1:8080:8080 spoolersh/memspoolerdFor the convenience of the code examples below, set up these environment variables:
sh
export SPOOLER_API=http://127.0.0.1:8080/v1
export SPOOLER_KEY='local'Against the hosted service, set SPOOLER_API to https://api.spooler.sh/v1 and SPOOLER_KEY to your API key from the console.
Every account starts with a spool named default, as does the local image. The queues in these examples live there.
Create a queue
sh
curl -X PUT "$SPOOLER_API/spools/default/queues/test" \
-H "Authorization: Bearer $SPOOLER_KEY"Returns 201 and the queue as created, with the server's default settings.
Send a message
sh
curl -si -X POST "$SPOOLER_API/spools/default/queues/test/send" \
-H "Authorization: Bearer $SPOOLER_KEY" \
--data-binary 'hello, world'http
HTTP/2 201
spooler-message-id: 1-1The body you send is the message payload – bytes in, bytes out, no envelope. The new message's id comes back as a header. It is for logs only: no operation takes a message id.
On the hosted service 201 means the message is stored: written and synced to disk, and confirmed by the copies the spool's replication requires, before the response. The local image keeps it in memory.
Receive it
sh
curl -si -X POST "$SPOOLER_API/spools/default/queues/test/recv" \
-H "Authorization: Bearer $SPOOLER_KEY"http
HTTP/2 200
spooler-lease: dGhpcyBpcyBub3QgYSByZWFsIGxlYXNl
spooler-lease-expires-at: 2026-08-12T10:00:30Z
spooler-message-created-at: 2026-08-12T09:55:29Z
spooler-message-retries: 0
spooler-message-id: 1-1
hello, worldReceiving does not delete the message – it leases it. While the lease is live, no other receiver gets the message. If you never settle it – acknowledge, for example – the lease times out, per the queue's leaseTimeoutSeconds, and the message is redelivered.
The optional waitSecondsrequest parameter controls how long the call waits for a visible message. If omitted, the server's default applies; waitSeconds=0 does not wait. When the wait elapses, the call returns 204.
Acknowledge it
sh
curl -X POST "$SPOOLER_API/spools/default/ack" \
-H "Authorization: Bearer $SPOOLER_KEY" \
-H "Spooler-Lease: <the spooler-lease header value>"Returns 204. The message is acknowledged and removed from the queue. That is the whole loop: send, receive, ack.
Further reading
- What a delivery guarantees, and what it doesn't – Delivery.
- Give up on a delivery instead of acking it – nack returns it for redelivery; after the queue's
maxRetriesit is failed, where a listing finds it. - A pipeline stage acks its input and sends the next message in one atomic call – ack-and-send.
- Tune a queue – lease timeout, retries, retention, dedup window – with Update queue settings; read the applied settings back with List queues.
- Retry sends safely with deduplication.
- What the server enforces: limits and errors.
- Every operation, generated from the spec – API reference.
- Run it yourself, in memory – Running locally.
- What Spooler deliberately is not – non-goals and alternatives.