Repository: activemq Updated Branches: refs/heads/master d54e21b2f -> 01cfa7727
AMQ-6361 - fix additional test regression on topic sub expiry AMQ4083Test,MessageEvictionTest Project: http://git-wip-us.apache.org/repos/asf/activemq/repo Commit: http://git-wip-us.apache.org/repos/asf/activemq/commit/01cfa772 Tree: http://git-wip-us.apache.org/repos/asf/activemq/tree/01cfa772 Diff: http://git-wip-us.apache.org/repos/asf/activemq/diff/01cfa772 Branch: refs/heads/master Commit: 01cfa7727dfb6e680e3a94789fd0798c36dbc87c Parents: d54e21b Author: gtully <gary.tu...@gmail.com> Authored: Tue Jul 26 13:45:41 2016 +0100 Committer: gtully <gary.tu...@gmail.com> Committed: Tue Jul 26 13:45:41 2016 +0100 ---------------------------------------------------------------------- .../org/apache/activemq/broker/region/TopicSubscription.java | 8 +++++--- .../test/java/org/apache/activemq/MessageEvictionTest.java | 1 - 2 files changed, 5 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/activemq/blob/01cfa772/activemq-broker/src/main/java/org/apache/activemq/broker/region/TopicSubscription.java ---------------------------------------------------------------------- diff --git a/activemq-broker/src/main/java/org/apache/activemq/broker/region/TopicSubscription.java b/activemq-broker/src/main/java/org/apache/activemq/broker/region/TopicSubscription.java index e1c8a95..eff2393 100755 --- a/activemq-broker/src/main/java/org/apache/activemq/broker/region/TopicSubscription.java +++ b/activemq-broker/src/main/java/org/apache/activemq/broker/region/TopicSubscription.java @@ -232,12 +232,14 @@ public class TopicSubscription extends AbstractSubscription { while (matched.hasNext()) { MessageReference node = matched.next(); node.decrementReferenceCount(); - if (broker.isExpired(node)) { + if (node.isExpired()) { matched.remove(); getSubscriptionStatistics().getDispatched().increment(); node.decrementReferenceCount(); - ((Destination)node.getRegionDestination()).getDestinationStatistics().getExpired().increment(); - broker.messageExpired(getContext(), node, this); + if (broker.isExpired(node)) { + ((Destination) node.getRegionDestination()).getDestinationStatistics().getExpired().increment(); + broker.messageExpired(getContext(), node, this); + } break; } } http://git-wip-us.apache.org/repos/asf/activemq/blob/01cfa772/activemq-unit-tests/src/test/java/org/apache/activemq/MessageEvictionTest.java ---------------------------------------------------------------------- diff --git a/activemq-unit-tests/src/test/java/org/apache/activemq/MessageEvictionTest.java b/activemq-unit-tests/src/test/java/org/apache/activemq/MessageEvictionTest.java index b079070..567e319 100644 --- a/activemq-unit-tests/src/test/java/org/apache/activemq/MessageEvictionTest.java +++ b/activemq-unit-tests/src/test/java/org/apache/activemq/MessageEvictionTest.java @@ -202,7 +202,6 @@ public class MessageEvictionTest { for (int i=0; i< numMessages; i++) { producer.send(session.createTextMessage(payload)); sent.incrementAndGet(); - TimeUnit.MILLISECONDS.sleep(10); } producer.close(); sendDone.countDown();