Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions src/pages/docs/pub-sub/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,28 @@ if err := channel.Publish(context.Background(), "example", "message data"); err
```
</Code>

### REST publish timeouts <a id="rest-timeouts"/>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this should be on a page about basic Pub/Sub.

Also, whilst it makes sense to condense the info from the original article, I think this is missing some key context and info in certain sections.


REST publish operations have a default 10-second timeout. While you may consider reducing this timeout for faster failure feedback, be aware that this can create problems:

Short timeouts can be problematic for the following reasons:

- Most requests that exceed short timeouts, for example < 1s, still succeed with normal latency.
- Retrying typically doesn't speed up message delivery and creates additional system load.
- During high load or scaling operations, retry storms can worsen performance.
- You'll miss important error notifications (rate limits, channel limits) if requests timeout prematurely.

The default 10-second timeout is designed to:

- Account for channel activation latency in multi-region deployments.
- Handle network and processing queue variations.
- Provide reliable error reporting for legitimate failures.

When to consider timeout adjustments:

- Use `httpOpenTimeout` (default 4s) for connection establishment issues, not `httpRequestTimeout` for the full request.
- Only reduce request timeouts if you have robust retry logic and can handle increased system load.

<Aside data-type="further-reading">
You can find out more detail about how [channels](/docs/channels) and [messages](/docs/messages) work.

Expand Down