What's Actually Happening
Apache Pulsar topic backlog is growing. Messages are not being consumed.
The Error You'll See
```bash $ pulsar-admin topics stats persistent://public/default/mytopic
backlogSize: 1073741824 # 1GB backlog! subscriptions: {} ```
Why This Happens
- 1.Consumer down - No active consumers
- 2.Slow consumer - Cannot keep up with rate
- 3.Subscription stuck - Subscription not advancing
- 4.Consumer crash - Consumer keeps crashing
Step 1: Check Topic Stats
```bash # Check topic backlog: pulsar-admin topics stats persistent://public/default/mytopic
# Check subscriptions: pulsar-admin topics subscriptions persistent://public/default/mytopic ```
Step 2: Check Consumer Status
```bash # List consumers: pulsar-admin topics consumers persistent://public/default/mytopic
# Check consumer health: pulsar-admin topics stats persistent://public/default/mytopic | jq '.subscriptions[].consumers' ```
Step 3: Reset Subscription
```bash # Reset to latest: pulsar-admin topics reset-cursor persistent://public/default/mytopic -s mysub -t now
# Or clear backlog: pulsar-admin topics skip-all persistent://public/default/mytopic -s mysub ```
Step 4: Scale Consumers
# Increase consumer instances
# Check partition count matches consumer countPulsar Backlog Checklist
| Check | Command | Expected |
|---|---|---|
| Backlog size | topics stats | Low |
| Consumers | consumers | Active |
| Subscriptions | subscriptions | Advancing |
Verify the Fix
pulsar-admin topics stats persistent://public/default/mytopic
# Output: backlogSize: 0Related Issues
- [Fix Kafka Consumer Lag](/articles/fix-kafka-consumer-lag)
- [Fix RabbitMQ Consumer Stuck](/articles/fix-rabbitmq-consumer-stuck)