How can we add a new property to a message before sending it to DLQ
Issue
- When a message goes to DLQ, we want to check the possible exception details of that failed message. To fulfill this need, we add an interceptor on MDB, and when error happens, we catch this exception and set this exception as string property to the message body. Because the message is in read-only state, then we use below ways to do that :
msg.clearProperties();
msg.setStringProperty("ERROR_MSG", MyExceptionUtil.getException(e));
restoreProperties(msg,properties);
- But when the message goes to DLQ, and check this message again, I find the property "ERROR_MSG" we added in interceptor is gone. This looks HornetQ has a copy of that?
- Do we have a way to setting those extra properties for a message?
Environment
- Red Hat JBoss Enterprise Application Platform (EAP)
- 6
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
