Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request for DLQ strategy. #1913

Closed
javadevmtl opened this issue Sep 26, 2022 · 0 comments · Fixed by #1928
Closed

Feature request for DLQ strategy. #1913

javadevmtl opened this issue Sep 26, 2022 · 0 comments · Fixed by #1928

Comments

@javadevmtl
Copy link

As per my conversation with @cescoffier here: https://quarkusio.zulipchat.com/#narrow/stream/294206-smallrye/topic/Suggestion.20for.20DLQ.20strategy.2E/near/300863081

Currently when a message is DLQ, the headers contain the following info as an example:

{
	"dead-letter-reason": "Connection refused: localhost/127.0.0.1:18080",
	"dead-letter-offset": "98",
	"dead-letter-partition": "124",
	"dead-letter-cause": "Connection refused",
	"dead-letter-topic": "webhook-push-dlr-dev"
}

When creating consumers to read the dead letter topic and you want to create some sort of processing logic, you need to compare string messages. This is isn't the most ideal situation because you need to compare string text and you also need to know the exact text coming from the the exception.

That said it would be nice to have an additional header, with the class name of the exception. This makes it easier/safer to compare and also deal with.

{
	"dead-letter-exception": "com.java.net.ConnectionException.class",
	"dead-letter-reason": "Connection refused: localhost/127.0.0.1:18080",
	"dead-letter-offset": "98",
	"dead-letter-partition": "124",
	"dead-letter-cause": "Connection refused",
	"dead-letter-topic": "webhook-push-dlr-dev"
}

Which means now we can do this:

if("com.java.net.ConnectionException".equals(Headers.get("dead-letter-exception"))

or

if("com.abc.MyCustomRetriableException".equals(Headers.get("dead-letter-exception"))

instead of

if("Connection refused".equalsIgnoreCase(Headers.get("dead-letter-cause"))
ozangunalp added a commit to ozangunalp/smallrye-reactive-messaging that referenced this issue Oct 3, 2022
ozangunalp added a commit to ozangunalp/smallrye-reactive-messaging that referenced this issue Oct 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant