Author: clebert.suconic(a)jboss.com
Date: 2011-06-03 00:38:31 -0400 (Fri, 03 Jun 2011)
New Revision: 10769
Modified:
branches/Branch_2_2_EAP/src/main/org/hornetq/core/paging/cursor/PagedReferenceImpl.java
branches/Branch_2_2_EAP/src/main/org/hornetq/core/paging/cursor/impl/PageSubscriptionImpl.java
branches/Branch_2_2_EAP/src/main/org/hornetq/core/paging/impl/PageImpl.java
branches/Branch_2_2_EAP/src/main/org/hornetq/core/persistence/impl/journal/LargeServerMessageImpl.java
branches/Branch_2_2_EAP/src/main/org/hornetq/core/server/impl/QueueImpl.java
branches/Branch_2_2_EAP/src/main/org/hornetq/jms/client/HornetQMessageProducer.java
branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/util/UnitTestCase.java
Log:
JBPAPP-6466 / HORNETQ-706 - small tweaks only
Modified:
branches/Branch_2_2_EAP/src/main/org/hornetq/core/paging/cursor/PagedReferenceImpl.java
===================================================================
---
branches/Branch_2_2_EAP/src/main/org/hornetq/core/paging/cursor/PagedReferenceImpl.java 2011-06-02
21:17:51 UTC (rev 10768)
+++
branches/Branch_2_2_EAP/src/main/org/hornetq/core/paging/cursor/PagedReferenceImpl.java 2011-06-03
04:38:31 UTC (rev 10769)
@@ -163,7 +163,7 @@
deliveryCount.incrementAndGet();
if (isTrace)
{
- log.trace("deliveryCount = " + deliveryCount + " for " +
this);
+ log.trace("++deliveryCount = " + deliveryCount + " for " +
this, new Exception ("trace"));
}
}
@@ -174,6 +174,10 @@
public void decrementDeliveryCount()
{
deliveryCount.decrementAndGet();
+ if (isTrace)
+ {
+ log.trace("--deliveryCount = " + deliveryCount + " for " +
this, new Exception ("trace"));
+ }
}
/* (non-Javadoc)
Modified:
branches/Branch_2_2_EAP/src/main/org/hornetq/core/paging/cursor/impl/PageSubscriptionImpl.java
===================================================================
---
branches/Branch_2_2_EAP/src/main/org/hornetq/core/paging/cursor/impl/PageSubscriptionImpl.java 2011-06-02
21:17:51 UTC (rev 10768)
+++
branches/Branch_2_2_EAP/src/main/org/hornetq/core/paging/cursor/impl/PageSubscriptionImpl.java 2011-06-03
04:38:31 UTC (rev 10769)
@@ -106,12 +106,14 @@
// We only store the position for redeliveries. They will be read from the SoftCache
again during delivery.
private final ConcurrentLinkedQueue<PagePosition> redeliveries = new
ConcurrentLinkedQueue<PagePosition>();
+
+
// Static --------------------------------------------------------
// Constructors --------------------------------------------------
- public PageSubscriptionImpl(final PageCursorProvider cursorProvider,
+ public PageSubscriptionImpl(final PageCursorProvider cursorProvider,
final PagingStore pageStore,
final StorageManager store,
final Executor executor,
@@ -299,7 +301,17 @@
tx.commit();
}
+
+ /* (non-Javadoc)
+ * @see java.lang.Object#toString()
+ */
+ @Override
+ public String toString()
+ {
+ return "PageSubscriptionImpl [cursorId=" + cursorId + ",
queue=" + queue + "]";
+ }
+
private PagedReference getReference(PagePosition pos) throws Exception
{
return cursorProvider.newReference(pos, cursorProvider.getMessage(pos), this);
Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/core/paging/impl/PageImpl.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/core/paging/impl/PageImpl.java 2011-06-02
21:17:51 UTC (rev 10768)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/core/paging/impl/PageImpl.java 2011-06-03
04:38:31 UTC (rev 10769)
@@ -43,6 +43,7 @@
private static final Logger log = Logger.getLogger(PageImpl.class);
private static final boolean isTrace = log.isTraceEnabled();
+ private static final boolean isDebug = log.isDebugEnabled();
public static final int SIZE_RECORD = DataConstants.SIZE_BYTE + DataConstants.SIZE_INT
+ DataConstants.SIZE_BYTE;
@@ -106,9 +107,9 @@
public List<PagedMessage> read(StorageManager storage) throws Exception
{
- if (isTrace)
+ if (isDebug)
{
- log.trace("reading page " + this.pageId + " on address = " +
storeName);
+ log.debug("reading page " + this.pageId + " on address = " +
storeName);
}
ArrayList<PagedMessage> messages = new ArrayList<PagedMessage>();
@@ -238,9 +239,9 @@
storageManager.pageDeleted(storeName, pageId);
}
- if (isTrace)
+ if (isDebug)
{
- log.trace("Deleting pageId=" + pageId + " on store " +
storeName);
+ log.debug("Deleting pageId=" + pageId + " on store " +
storeName);
}
if (messages != null)
Modified:
branches/Branch_2_2_EAP/src/main/org/hornetq/core/persistence/impl/journal/LargeServerMessageImpl.java
===================================================================
---
branches/Branch_2_2_EAP/src/main/org/hornetq/core/persistence/impl/journal/LargeServerMessageImpl.java 2011-06-02
21:17:51 UTC (rev 10768)
+++
branches/Branch_2_2_EAP/src/main/org/hornetq/core/persistence/impl/journal/LargeServerMessageImpl.java 2011-06-03
04:38:31 UTC (rev 10769)
@@ -341,7 +341,9 @@
@Override
public String toString()
{
- return "LargeServerMessage[messageID=" + messageID + ",
durable=" + durable + ", address=" + getAddress() +
",properties=" + properties.toString() + "]";
+ return "ServerMessage[messageID=" + messageID + ",priority=" +
this.getPriority() +
+ ",expiration=[" + (this.getExpiration() != 0 ? new
java.util.Date(this.getExpiration()) : "null") + "]" +
+ ", durable=" + durable + ", address=" + getAddress() +
",properties=" + properties.toString() + "]";
}
Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/core/server/impl/QueueImpl.java
===================================================================
---
branches/Branch_2_2_EAP/src/main/org/hornetq/core/server/impl/QueueImpl.java 2011-06-02
21:17:51 UTC (rev 10768)
+++
branches/Branch_2_2_EAP/src/main/org/hornetq/core/server/impl/QueueImpl.java 2011-06-03
04:38:31 UTC (rev 10769)
@@ -1502,7 +1502,7 @@
{
if (isTrace)
{
- log.warn("delivery has been running for too long. Scheduling another
delivery task now");
+ log.trace("delivery has been running for too long. Scheduling another
delivery task now");
}
deliverAsync();
@@ -1530,6 +1530,7 @@
{
ref = null;
}
+
if (ref == null)
{
@@ -1858,13 +1859,13 @@
if (bindingList.getBindings().isEmpty())
{
- QueueImpl.log.warn("Message has exceeded max delivery attempts. No
bindings for Dead Letter Address " + deadLetterAddress +
+ QueueImpl.log.warn("Message " + ref + " has exceeded max
delivery attempts. No bindings for Dead Letter Address " + deadLetterAddress +
" so dropping it");
}
else
{
- QueueImpl.log.warn("Message has reached maximum delivery attempts,
sending it to Dead Letter Address " + deadLetterAddress +
+ QueueImpl.log.warn("Message " + ref + " has reached maximum
delivery attempts, sending it to Dead Letter Address " + deadLetterAddress +
" from " +
name);
move(deadLetterAddress, ref, false, false);
Modified:
branches/Branch_2_2_EAP/src/main/org/hornetq/jms/client/HornetQMessageProducer.java
===================================================================
---
branches/Branch_2_2_EAP/src/main/org/hornetq/jms/client/HornetQMessageProducer.java 2011-06-02
21:17:51 UTC (rev 10768)
+++
branches/Branch_2_2_EAP/src/main/org/hornetq/jms/client/HornetQMessageProducer.java 2011-06-03
04:38:31 UTC (rev 10769)
@@ -314,14 +314,17 @@
private void doSend(final Message message, final long timeToLive, HornetQDestination
destination) throws JMSException
{
- if (timeToLive == 0)
+ if (message.getJMSExpiration() != 0)
{
- message.setJMSExpiration(0);
+ if (timeToLive == 0)
+ {
+ message.setJMSExpiration(0);
+ }
+ else
+ {
+ message.setJMSExpiration(System.currentTimeMillis() + timeToLive);
+ }
}
- else
- {
- message.setJMSExpiration(System.currentTimeMillis() + timeToLive);
- }
if (!disableMessageTimestamp)
{
Modified: branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/util/UnitTestCase.java
===================================================================
--- branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/util/UnitTestCase.java 2011-06-02
21:17:51 UTC (rev 10768)
+++ branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/util/UnitTestCase.java 2011-06-03
04:38:31 UTC (rev 10769)
@@ -957,8 +957,6 @@
{
OperationContextImpl.clearContext();
- deleteDirectory(new File(getTestDir()));
-
int invmSize = InVMRegistry.instance.size();
if (invmSize > 0)
{