diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueImpl.java index 82524ff3f7..e9031005a5 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueImpl.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueImpl.java @@ -88,7 +88,6 @@ import org.apache.activemq.artemis.utils.Env; import org.apache.activemq.artemis.utils.FutureLatch; import org.apache.activemq.artemis.utils.ReferenceCounter; import org.apache.activemq.artemis.utils.ReusableLatch; -import org.apache.activemq.artemis.utils.collections.ConcurrentHashSet; import org.apache.activemq.artemis.utils.collections.LinkedListIterator; import org.apache.activemq.artemis.utils.collections.PriorityLinkedList; import org.apache.activemq.artemis.utils.collections.PriorityLinkedListImpl; @@ -206,8 +205,6 @@ public class QueueImpl implements Queue { private Redistributor redistributor; - private final Set> futures = new ConcurrentHashSet<>(); - private ScheduledFuture redistributorFuture; private ScheduledFuture checkQueueSizeFuture; @@ -887,8 +884,6 @@ public class QueueImpl implements Queue { DelayedAddRedistributor dar = new DelayedAddRedistributor(executor); redistributorFuture = scheduledExecutor.schedule(dar, delay, TimeUnit.MILLISECONDS); - - futures.add(redistributorFuture); } } else { internalAddRedistributor(executor); @@ -900,8 +895,6 @@ public class QueueImpl implements Queue { redistributorFuture = null; if (future != null) { future.cancel(false); - - futures.remove(future); } } diff --git a/tests/timing-tests/src/test/java/org/apache/activemq/artemis/tests/timing/core/server/impl/QueueImplTest.java b/tests/timing-tests/src/test/java/org/apache/activemq/artemis/tests/timing/core/server/impl/QueueImplTest.java index 121a4b01a5..ed1a4e5de6 100644 --- a/tests/timing-tests/src/test/java/org/apache/activemq/artemis/tests/timing/core/server/impl/QueueImplTest.java +++ b/tests/timing-tests/src/test/java/org/apache/activemq/artemis/tests/timing/core/server/impl/QueueImplTest.java @@ -135,10 +135,7 @@ public class QueueImplTest extends ActiveMQTestBase { @Test public void testScheduled() throws Exception { - QueueImpl queue = - new QueueImpl(1, new SimpleString("address1"), new SimpleString("queue1"), null, null, false, true, - false, scheduledExecutor, null, null, null, - Executors.newSingleThreadExecutor(ActiveMQThreadFactory.defaultThreadFactory()), null); + QueueImpl queue = new QueueImpl(1, new SimpleString("address1"), new SimpleString("queue1"), null, null, false, true, false, scheduledExecutor, null, null, null, Executors.newSingleThreadExecutor(ActiveMQThreadFactory.defaultThreadFactory()), null); FakeConsumer consumer = null; @@ -236,10 +233,7 @@ public class QueueImplTest extends ActiveMQTestBase { public void disconnect() { } }; - QueueImpl queue = - new QueueImpl(1, new SimpleString("address1"), QueueImplTest.queue1, null, null, false, true, false, - scheduledExecutor, null, null, null, - Executors.newSingleThreadExecutor(ActiveMQThreadFactory.defaultThreadFactory()), null); + QueueImpl queue = new QueueImpl(1, new SimpleString("address1"), QueueImplTest.queue1, null, null, false, true, false, scheduledExecutor, null, null, null, Executors.newSingleThreadExecutor(ActiveMQThreadFactory.defaultThreadFactory()), null); MessageReference messageReference = generateReference(queue, 1); queue.addConsumer(consumer); messageReference.setScheduledDeliveryTime(System.currentTimeMillis() + 2000);