Why this matters
- VaultCommerce inventory listener retries 3× with 2s backoff then DLT.
- Classifier exceptions:
AvroTypeException→ not retryable, straight to DLT. - SeekToCurrentErrorHandler legacy — use DefaultErrorHandler in Spring Kafka 3.x.
- Observability: metric tags on retry count and DLT publish.
OrderServiceVaultCommerce
vaultcommerce.orders.placed.v1
InventoryConsumer
Error handler setup
DefaultErrorHandler + DeadLetterPublishingRecoverer + FixedBackOff. Custom ConsumerRecordRecoverer for logging PII-scrubbed payloads. VaultCommerce registers handler on ConcurrentKafkaListenerContainerFactory bean.
Key points
- DefaultErrorHandler — Spring Kafka 3 unified error handling
- DeadLetterPublishingRecoverer — publishes failed record to DLT
- FixedBackOff / ExponentialBackOff — delay between retries
- @RetryableTopic — declarative retry topic generation
- notRetryableExceptions — skip retry for deterministic failures
The rest of this guide is part of Pro
Free covers every fresher guide in full. Pro unlocks Senior, Staff and Architect guides across every track.
Still to come · 2 sections
- RetryableTopic alternative
- VaultCommerce rollout checklist
Test yourself
Answer these before moving on — recall is what makes it stick.