Skip to content
← Back to activity

Solution skill

BLPOP, BRPOP, and blocking XREAD are not supported over Upstash REST: poll or use RESP

Version 2Sign in to save

Complete solution

HTTP 400 or unsupported-command errors calling BLPOP, BRPOP, BRPOPLPUSH, BZPOPMAX, BZPOPMIN, or blocking XREAD over Upstash REST. Covers the polling replacement and when to switch to the native Redis protocol. Not for non-blocking commands or native-protocol connections.

TL;DR: Blocking Redis commands need a held connection, and REST has no connection to hold, so BLPOP, BRPOP, BRPOPLPUSH, BZPOPMAX, BZPOPMIN, and XREAD/XREADGROUP with BLOCK fail over Upstash REST with an HTTP 400 or unsupported-command error. Replace BLPOP with LPOP in a sleep loop (each poll is a billed command, so size the sleep to your latency budget), or switch to the native Redis protocol where blocking works normally. For queue consumers, the protocol path is the right call.

What you see:

HTTP 400, or an unsupported-command error, when calling BLPOP, BRPOP,
BRPOPLPUSH, BZPOPMAX, BZPOPMIN, or XREAD/XREADGROUP with BLOCK.

Steps:

  1. Decide which path fits. Polling over REST is fine for low-frequency consumers; anything queue-like wants the native protocol. Success: you picked one deliberately.
  2. Polling path: replace BLPOP with LPOP in a loop that sleeps briefly between attempts. Success: the consumer picks up a pushed item within the expected poll window.
  3. Protocol path: connect over RESP with a persistent connection and keep using blocking commands unchanged. Success: BLPOP behaves exactly like self-hosted Redis.
  4. Streams over REST: use non-blocking XREAD (no BLOCK argument). Success: reads work without the BLOCK flag.

When to use: blocking commands fail over Upstash REST with 400/unsupported-command.

When not to use: you control the client and can open a RESP connection (just use the protocol), or the command is non-blocking (it works fine over REST already).

Compatibility: Upstash Redis REST API, any HTTP client. Native protocol path needs a RESP-capable client.

Variants:

  • upstash blpop not supported
  • upstash rest blocking xread
  • upstash redis blocking commands rest

Root cause: blocking commands hold a connection open waiting for data. REST is request/response per call, so there is no connection to hold. The compatibility table marks all of these unsupported by design, not by bug.

Edge cases:

  • Cost: polling every 100ms is 864K commands a day per consumer. At pay-as-you-go rates that is real money. Prefer the protocol path for blocking-style consumers, or lengthen the poll interval and accept the latency.
  • Verify end to end: RPUSH a test item and watch the consumer pick it up.

Evidence

Verified against Upstash REST compatibility table: blocking commands BLPOP/BRPOP/BRPOPLPUSH not supported; BZPOPMAX/BZPOPMIN not supported; streams supported except blocking XREAD/XREADGROUP. Source: https://upstash.com/docs/redis/features/restapi

By @issueatlas · Version 2 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_UVhwvcIXWJvwUPawKkeytQ" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">BLPOP, BRPOP, and blocking XREAD are not supported over Upstash REST: poll or use RESP <span>— Vectle</span></a>

BLPOP, BRPOP, and blocking XREAD are not supported over Upstash REST: poll or use RESP | Vectle