Skip to content

Commit

Permalink
Adding logs
Browse files Browse the repository at this point in the history
  • Loading branch information
clebertsuconic committed May 17, 2011
1 parent 523acae commit fb9bd7b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .classpath
Expand Up @@ -94,7 +94,7 @@
<classpathentry kind="src" path="examples/javaee/servlet-transport/src"/>
<classpathentry kind="src" path="examples/javaee/xarecovery/src"/>
<classpathentry kind="src" path="examples/soak/normal/src"/>
<classpathentry kind="lib" path="thirdparty/junit/lib/junit.jar"/>
<classpathentry kind="lib" path="thirdparty/junit/lib/junit.jar" sourcepath="/home/clebert/.m2/repository/junit/junit/3.8.2/junit-3.8.2-sources.jar"/>
<classpathentry kind="lib" path="thirdparty/apache-logging/lib/commons-logging.jar"/>
<classpathentry kind="lib" path="thirdparty/apache-xerces/lib/xercesImpl.jar"/>
<classpathentry kind="lib" path="thirdparty/sun-jaxb/lib/jaxb-api.jar"/>
Expand Down
21 changes: 12 additions & 9 deletions src/main/org/hornetq/core/server/impl/QueueImpl.java
Expand Up @@ -1671,19 +1671,14 @@ public boolean checkRedelivery(final MessageReference reference, final long time

int maxDeliveries = addressSettings.getMaxDeliveryAttempts();

if (isTrace)
{
log.trace("Checking redelivery for reference = " + reference + " with maxDeliveries = " + maxDeliveries + " on queue " + address);
}

// First check DLA
if (maxDeliveries > 0 && reference.getDeliveryCount() >= maxDeliveries)
{
if (isTrace)
{
log.trace("Sending reference " + reference + " to DLA");
log.trace("Sending reference " + reference + " to DLA = " + addressSettings.getDeadLetterAddress() + " since ref.getDeliveryCount=" + reference.getDeliveryCount() + "and maxDeliveries=" + maxDeliveries + " from queue=" + this.getName());
}
sendToDeadLetterAddress(reference);
sendToDeadLetterAddress(reference, addressSettings.getDeadLetterAddress());

return false;
}
Expand All @@ -1694,6 +1689,10 @@ public boolean checkRedelivery(final MessageReference reference, final long time

if (redeliveryDelay > 0)
{
if (isTrace)
{
log.trace("Setting redeliveryDelay=" + redeliveryDelay + " on reference=" + reference);
}
reference.setScheduledDeliveryTime(timeBase + redeliveryDelay);

if (message.isDurable() && durable)
Expand Down Expand Up @@ -1774,10 +1773,14 @@ private void expire(final Transaction tx, final MessageReference ref) throws Exc
}
}


private void sendToDeadLetterAddress(final MessageReference ref) throws Exception
{
SimpleString deadLetterAddress = addressSettingsRepository.getMatch(address.toString()).getDeadLetterAddress();

sendToDeadLetterAddress(ref, addressSettingsRepository.getMatch(address.toString()).getDeadLetterAddress());
}

private void sendToDeadLetterAddress(final MessageReference ref, final SimpleString deadLetterAddress) throws Exception
{
if (deadLetterAddress != null)
{
Bindings bindingList = postOffice.getBindingsForAddress(deadLetterAddress);
Expand Down
Expand Up @@ -3748,6 +3748,7 @@ public void testExpireLargeMessageOnPaging() throws Exception
clearData();

Configuration config = createDefaultConfig();
config.setMessageExpiryScanPeriod(500);

config.setJournalSyncNonTransactional(false);

Expand Down

0 comments on commit fb9bd7b

Please sign in to comment.