非事务性消息是否会被投毒?文档暗示不会但无明确说明
Do Non-Transactional Messages Become Poison Messages?
Great question — this is one of those areas where docs often hint at the answer without spelling it out directly. Let’s cut through the ambiguity clearly:
Yes, non-transactional messages absolutely can become poison messages.
Here’s the breakdown:
- A poison message is defined by its behavior, not whether it’s tied to a transaction. At its core, it’s any message that repeatedly fails to be processed successfully by a consumer, no matter how many times the queue re-delivers it.
- Non-transactional messages lack the rollback mechanism that transactional ones have, but most message brokers don’t lock their retry/poison message logic to transactions alone. If your consumer throws an unhandled error every time it tries to process a non-transactional message, the broker will keep re-sending it. Once it hits the configured retry limit, that message gets flagged as poison (usually routed to a dead-letter queue or marked for manual review).
- Docs might underemphasize this because transactional message workflows tend to have more formalized poison handling (like rolling back the transaction to trigger re-delivery), but the core problem of unprocessable messages applies equally to non-transactional ones.
For example: If you have a non-transactional message referencing a deleted database record, your consumer will throw a "record not found" error every time it runs. Without a fix, the broker will keep re-delivering until it hits the retry threshold — at that point, it’s a poison message, plain and simple.
内容的提问来源于stack exchange,提问作者InteXX
相关产品推荐
相关产品推荐

