Enhanced Streams

Enhanced Streams Errors and Reconnects

Handle gRPC failures, stale topics, duplicate events, and stream restarts.

Common status codes

CodeCauseYour action
UNAUTHENTICATEDMissing or invalid keyReplace the credential
PERMISSION_DENIEDTopic blocked by account accessReview plan access
NOT_FOUNDTopic name does not existCall ListTopics
RESOURCE_EXHAUSTEDStream or traffic limit reachedClose unused streams
UNAVAILABLETemporary transport failureReconnect with backoff
INTERNALProcessing failureRetry once, then log details

Reconnect

Enhanced Streams do not accept an offset in SubscribeRequest.

After a disconnect:

  1. Wait with exponential backoff and jitter.
  2. Call ListTopics after a NOT_FOUND response.
  3. Open a new subscription.
  4. Deduplicate events in your storage layer.
  5. Alert after repeated failures.

Deduplicate

Store these envelope fields:

  • topic
  • partition
  • offset
  • timestamp_ms

Use a unique database key over topic, partition, and offset.

Parse JSON once

Python protobuf clients return payload as bytes.

event = json.loads(message.payload)

JavaScript proto loaders often return a Buffer.

const event = JSON.parse(message.payload.toString("utf8"))

Do not base64-decode either value.