Vercel Queues, drained by cron

Do the Vercel setup first.

Devices
one reading each
HTTPS
Vercel function
POST /api/readings/queue
send
Vercel Queues
readings
every minute
Cron job
/api/cron/drain
commit
Tigris bucket
Iceberg tables

When every device sends its own readings, one commit per message would be too many. Here nothing is pushed: once a minute a cron job claims messages, up to 10 per request, for at most 50 seconds or 10,000 messages. It appends them all in one commit, then acknowledges them. If the append fails, nothing is acknowledged, and the messages return to the queue when their 120-second lease runs out.

Two settings on the polled client matter. Messages can only be received in the region they were sent to, so the client names a fixed region (iad1). And topics are separate per deployment by default; ALL_DEPLOYMENTS lets the cron job of a new deployment drain what an earlier deployment received.

Try it:

curl -X POST $URL/api/readings/queue -H "authorization: Bearer $INGEST_TOKEN" -H "content-type: application/json" \
  -d '{"time": "2026-01-05T10:10:00Z", "device_id": "pump-3", "temp": 60.1, "humidity": 42}'

The reading reaches the table at the next minute.