From b638748ae366d613b1635a89df71c911ea704e61 Mon Sep 17 00:00:00 2001 From: Justin Bertram Date: Tue, 6 Mar 2018 11:29:24 -0600 Subject: [PATCH 1/2] NO-JIRA ignore exception when deleting temp queue --- .../artemis/core/server/impl/TransientQueueManagerImpl.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/TransientQueueManagerImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/TransientQueueManagerImpl.java index ab14479fac..4985a7ec45 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/TransientQueueManagerImpl.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/TransientQueueManagerImpl.java @@ -17,6 +17,7 @@ package org.apache.activemq.artemis.core.server.impl; import org.apache.activemq.artemis.api.core.ActiveMQException; +import org.apache.activemq.artemis.api.core.ActiveMQNonExistentQueueException; import org.apache.activemq.artemis.api.core.SimpleString; import org.apache.activemq.artemis.core.server.ActiveMQServer; import org.apache.activemq.artemis.core.server.ActiveMQServerLogger; @@ -40,6 +41,8 @@ public class TransientQueueManagerImpl extends ReferenceCounterUtil implements T try { server.destroyQueue(queueName, null, false); + } catch (ActiveMQNonExistentQueueException e) { + // ignore } catch (ActiveMQException e) { ActiveMQServerLogger.LOGGER.errorOnDeletingQueue(queueName.toString(), e); } From e9991838c88a62dd5e567d633bddea7fe89c99d4 Mon Sep 17 00:00:00 2001 From: Justin Bertram Date: Tue, 6 Mar 2018 11:31:25 -0600 Subject: [PATCH 2/2] NO-JIRA Adjust slow consumer example timing --- .../artemis/jms/example/KillSlowConsumerExample.java | 5 ++--- .../artemis/jms/example/NotifySlowConsumerExample.java | 2 -- .../src/main/resources/activemq/server0/broker.xml | 4 ++-- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/examples/features/standard/slow-consumer/src/main/java/org/apache/activemq/artemis/jms/example/KillSlowConsumerExample.java b/examples/features/standard/slow-consumer/src/main/java/org/apache/activemq/artemis/jms/example/KillSlowConsumerExample.java index 3b0f6834d3..867b87d50b 100644 --- a/examples/features/standard/slow-consumer/src/main/java/org/apache/activemq/artemis/jms/example/KillSlowConsumerExample.java +++ b/examples/features/standard/slow-consumer/src/main/java/org/apache/activemq/artemis/jms/example/KillSlowConsumerExample.java @@ -34,12 +34,12 @@ import org.apache.activemq.artemis.api.core.ActiveMQObjectClosedException; * * - sends messages to a queue "slow.consumer.kill". * - starts a consumer BUT does not consume any messages. - * - waits for 8 seconds and tries to consume a message. + * - waits for 10 seconds and tries to consume a message. * - receive an exception as the connection should already be closed. */ public class KillSlowConsumerExample { - public static final int WAIT_TIME = 7; + public static final int WAIT_TIME = 10; public static void main(final String[] args) throws Exception { @@ -98,7 +98,6 @@ public class KillSlowConsumerExample { } } } - } } diff --git a/examples/features/standard/slow-consumer/src/main/java/org/apache/activemq/artemis/jms/example/NotifySlowConsumerExample.java b/examples/features/standard/slow-consumer/src/main/java/org/apache/activemq/artemis/jms/example/NotifySlowConsumerExample.java index cc713a7f99..22c2ba9052 100644 --- a/examples/features/standard/slow-consumer/src/main/java/org/apache/activemq/artemis/jms/example/NotifySlowConsumerExample.java +++ b/examples/features/standard/slow-consumer/src/main/java/org/apache/activemq/artemis/jms/example/NotifySlowConsumerExample.java @@ -103,8 +103,6 @@ public class NotifySlowConsumerExample { if (!isNotified) { throw new RuntimeException("SlowConsumerExample.demoSlowConsumerNotify() FAILED; timeout occurred before" + " - slow consumer notification was received. "); } - } - } } \ No newline at end of file diff --git a/examples/features/standard/slow-consumer/src/main/resources/activemq/server0/broker.xml b/examples/features/standard/slow-consumer/src/main/resources/activemq/server0/broker.xml index c8c927ae72..ec8797c69b 100644 --- a/examples/features/standard/slow-consumer/src/main/resources/activemq/server0/broker.xml +++ b/examples/features/standard/slow-consumer/src/main/resources/activemq/server0/broker.xml @@ -52,13 +52,13 @@ under the License. 10 KILL - 5 + 3 10 NOTIFY - 5 + 3