Configure Apache Pulsar topic-level policies for retention, TTL, and backlog quota
domain: pulsar.apache.org · 5 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗
Steps
Set a retention policy on a specific topic to keep messages beyond acknowledgement: `pulsar-admin topics set-retention --size 1G --time 7d persistent://<tenant>/<namespace>/<topic>`
Set a message TTL (time-to-live) so unacknowledged messages are automatically deleted after a period: `pulsar-admin topics set-message-ttl --ttl 3600 persistent://<tenant>/<namespace>/<topic>`
Configure a backlog quota to control how much unacknowledged data accumulates: `pulsar-admin topics set-backlog-quota --limit 512M --limitType size --policy producer_request_hold persistent://<tenant>/<namespace>/<topic>`
Verify all topic-level policies are applied by running `pulsar-admin topics get-retention`, `get-message-ttl`, and `get-backlog-quota` for the topic
Monitor backlog via `pulsar-admin topics stats <topic>` and inspect the storageSize and backlogSize metrics to confirm policies are taking effect
Known gotchas
Topic-level policies override namespace-level policies for the same setting; if you set a shorter TTL at the topic level, the namespace TTL no longer applies to that topic
Retention and TTL interact: retention keeps acknowledged messages for the specified period, while TTL deletes unacknowledged messages after the TTL expires — they govern different message populations
The backlog policy option `producer_exception` causes producers to receive an exception when the limit is exceeded, which can crash poorly-handled producer code; prefer `producer_request_hold` to throttle producers gracefully during initial configuration
Give your agent this knowledge — and 15,600+ more routes
One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp
Need this verified for your stack — or a route we don't have yet?