[
https://issues.apache.org/jira/browse/ARTEMIS-1497?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16244748#comment-16244748
]
Justin Bertram commented on ARTEMIS-1497:
-----------------------------------------
To clarify, there would be a DLA configured for the related queue and that's
where messages would normally go when they exceed the max delivery attempts,
but in certain cases (e.g. when a special property is set on the message) the
message should not be sent to the DLA when the max delivery attempts is
exceeded and instead should be deleted.
I ask because if there is no DLA for the queue then messages which exceed max
delivery attempts are automatically deleted and a WARN is logged.
> Destroy message instead of sending it to DLQ
> --------------------------------------------
>
> Key: ARTEMIS-1497
> URL: https://issues.apache.org/jira/browse/ARTEMIS-1497
> Project: ActiveMQ Artemis
> Issue Type: New Feature
> Components: Broker
> Affects Versions: 2.3.0
> Environment: ActiveMQ 2.3
> Reporter: Tom Ross
> Priority: Trivial
>
> Customer would like to have an option of destroying certain messages instead
> of sending them to DLQ in case message processing fails.
> Below is an example of what they think could happen:
> {noformat}
> public class HelloMDB implements MessageListener {
> MessageDrivenContext ctx;
> @Override
> public void onMessage(Message message) {
>
> try {
>
> doSomeInsertsButThenFailBecauseOfDataThatMakesNoSense();
>
> } catch (UnableToProcessMessageBecauseOfDataThatMakesNoSense e) {
>
> ctx.setRollbackOnly(); // we do not want to commit, because we do
> not know how many inserts we did before we failed
>
> try {
>
> message.setBooleanProperty("DESTROY_INSTEAD_OF_GOING_TO_ERROR_QUEUE", true);
> } catch (JMSException ex) {
> throw new RuntimeException("unable to set destroy property",
> e);
> }
> }
> }
> {noformat}
> In the case above they would like a message that was a rolled back and tagged
> with DESTROY_INSTEAD_OF_GOING_TO_ERROR_QUEUE property to be destroyed instead
> of send to DLQ. If that happens they would like the broker to log that
> instance in the server log file.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)