How to access PubSub message delivery attempt count in Encore.ts

3 days ago 5
ARTICLE AD BOX

I'm using Encore.ts PubSub and want to control retry behavior. Specifically, I'd like to either:

Disable retries entirely for a subscription, or

Access the current delivery attempt number so I can implement custom retry logic (e.g., bail out after N attempts).

The Subscription config accepts a maxRetries option, but setting it to 0 defaults to 100 retries, and negative values like -2 throw an error (expected unsigned number literal). The Go SDK has pubsub.NoRetries and pubsub.InfiniteRetries constants, but these don't appear to be exported in the TypeScript SDK.

Read Entire Article