https://issues.apache.org/jira/browse/AMQ-2584 - revisit, make audit optional on dlq stragegy, new attribute enableAudit default true. Set to false if resending to the dlq is required, can be usefull when redelivery from the dlq to the original dest is required and can repeat

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1145092 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Gary Tully 2011-07-11 09:37:40 +00:00
parent d5b604ec58
commit 7877fd5ecd
1 changed files with 10 additions and 2 deletions

View File

@ -34,13 +34,14 @@ public abstract class AbstractDeadLetterStrategy implements DeadLetterStrategy {
private static final Logger LOG = LoggerFactory.getLogger(AbstractDeadLetterStrategy.class);
private boolean processNonPersistent = false;
private boolean processExpired = true;
private ActiveMQMessageAudit audit = new ActiveMQMessageAudit();
private boolean enableAudit = true;
private ActiveMQMessageAudit messageAudit = new ActiveMQMessageAudit();
public boolean isSendToDeadLetterQueue(Message message) {
boolean result = false;
if (message != null) {
result = true;
if (audit.isDuplicate(message)) {
if (enableAudit && messageAudit.isDuplicate(message)) {
result = false;
if (LOG.isDebugEnabled()) {
LOG.debug("Not adding duplicate to DLQ: " + message.getMessageId() + ", dest: " + message.getDestination());
@ -84,4 +85,11 @@ public abstract class AbstractDeadLetterStrategy implements DeadLetterStrategy {
this.processNonPersistent = processNonPersistent;
}
public boolean isEnableAudit() {
return enableAudit;
}
public void setEnableAudit(boolean enableAudit) {
this.enableAudit = enableAudit;
}
}