Skip to content

Question about Spring AMQP, DLQ, and Error Handling #2938

Closed Answered by artembilan
mimparatta asked this question in Q&A
Discussion options

You must be logged in to vote

The behavior is correct.
See ConditionalRejectingErrorHandler Javadocs and its logic:

	/**
	 * Set to false to disable the (now) default behavior of logging and discarding
	 * messages that cause fatal exceptions and have an `x-death` header; which
	 * usually means that the message has been republished after previously being
	 * sent to a DLQ.
	 * @param discardFatalsWithXDeath false to disable.
	 * @since 2.1
	 */
	public void setDiscardFatalsWithXDeath(boolean discardFatalsWithXDeath) {

So, the default is exactly what you have observed: the message is sent to DLX, then it is comes back to the original queue, but it has now that x-death header.
Therefore, when this message fails again,…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@mimparatta
Comment options

Answer selected by mimparatta
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants