← Back to library

Gateway 重启防丢消息:启用并验证 outbound 写前队列恢复

用于“gateway 重启后 outbound 丢消息”场景。前置:已升级到 2026.2.13。步骤:构造发送压测→触发重启→观察写前队列恢复重试→核对线程/reply 路由。关键点:重启后应继续 drain 而非丢失。验证:重启窗口内消息最终送达且无错路由。风险:重复重试策略不当会导致重复消息。

GITHUBDiscovered 2026-02-15Author steipete
Prerequisites
  • Gateway runs 2026.2.13+ and at least one channel adapter is configured.
  • You can trigger controlled restarts in a non-production test window.
Steps
  1. Send a burst of outbound messages with explicit `replyTo`/`threadId` metadata.
  2. Restart gateway during in-flight delivery (`openclaw gateway restart`).
  3. Monitor logs and confirm write-ahead queue recovers and retries pending items after restart.
  4. Compare sent/received counts and verify thread/reply targets remain correct.
Commands
openclaw gateway status
openclaw gateway restart
openclaw logs --local-time
Verify

No outbound loss across restart; queued items deliver after recovery with correct thread context.

Caveats
  • If wrappers also retry at app layer, deduplicate IDs to avoid duplicate sends.
  • Provider-side throttling may delay eventual delivery and requires separate SLA checks(需验证).
Source attribution

This tip is aggregated from community/public sources and preserved with attribution.

Open original source ↗
Visit original post