You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by cl...@apache.org on 2017/12/21 01:48:35 UTC
activemq-artemis git commit: NO-JIRA fixing checkstyle on example
Repository: activemq-artemis
Updated Branches:
refs/heads/master 6822bad0c -> 24876d3fd
NO-JIRA fixing checkstyle on example
Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/24876d3f
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/24876d3f
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/24876d3f
Branch: refs/heads/master
Commit: 24876d3fd199b16bac0c866b40a4719401e818d3
Parents: 6822bad
Author: Clebert Suconic <cl...@apache.org>
Authored: Wed Dec 20 20:48:08 2017 -0500
Committer: Clebert Suconic <cl...@apache.org>
Committed: Wed Dec 20 20:48:23 2017 -0500
----------------------------------------------------------------------
.../artemis/jms/example/KillSlowConsumerExample.java | 9 +++------
.../artemis/jms/example/NotifySlowConsumerExample.java | 8 ++------
2 files changed, 5 insertions(+), 12 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/24876d3f/examples/features/standard/slow-consumer/src/main/java/org/apache/activemq/artemis/jms/example/KillSlowConsumerExample.java
----------------------------------------------------------------------
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 fde6fe8..3b0f683 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
@@ -36,7 +36,6 @@ import org.apache.activemq.artemis.api.core.ActiveMQObjectClosedException;
* - starts a consumer BUT does not consume any messages.
* - waits for 8 seconds and tries to consume a message.
* - receive an exception as the connection should already be closed.
- *
*/
public class KillSlowConsumerExample {
@@ -88,16 +87,14 @@ public class KillSlowConsumerExample {
messageConsumer.receive(TimeUnit.SECONDS.toMillis(1));
//messageConsumer.receive() should throw exception - we should not get to here.
- throw new RuntimeException("SlowConsumerExample.slowConsumerKill() FAILED - expected " +
- "connection to be shutdown by Slow Consumer policy");
+ throw new RuntimeException("SlowConsumerExample.slowConsumerKill() FAILED - expected " + "connection to be shutdown by Slow Consumer policy");
} catch (JMSException ex) {
if (ex.getCause() instanceof ActiveMQObjectClosedException) {
//received exception - as expected
- System.out.println("SUCCESS! Received EXPECTED exception: " + ex );
+ System.out.println("SUCCESS! Received EXPECTED exception: " + ex);
} else {
- throw new RuntimeException("SlowConsumerExample.slowConsumerKill() FAILED - expected " +
- "ActiveMQObjectClosedException BUT got " + ex.getCause());
+ throw new RuntimeException("SlowConsumerExample.slowConsumerKill() FAILED - expected " + "ActiveMQObjectClosedException BUT got " + ex.getCause());
}
}
}
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/24876d3f/examples/features/standard/slow-consumer/src/main/java/org/apache/activemq/artemis/jms/example/NotifySlowConsumerExample.java
----------------------------------------------------------------------
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 b476bf8..cc713a7 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
@@ -18,7 +18,6 @@ package org.apache.activemq.artemis.jms.example;
import javax.jms.Connection;
import javax.jms.ConnectionFactory;
-import javax.jms.JMSException;
import javax.jms.MessageConsumer;
import javax.jms.MessageProducer;
import javax.jms.Queue;
@@ -73,9 +72,7 @@ public class NotifySlowConsumerExample {
// Step 8. create a consumer on the broker's management-notification-address
Session notifSession = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
- MessageConsumer notificationConsumer = notifSession.createConsumer(notificationTopic,
- ManagementHelper.HDR_NOTIFICATION_TYPE + " = '" +
- CoreNotificationType.CONSUMER_SLOW + "'");
+ MessageConsumer notificationConsumer = notifSession.createConsumer(notificationTopic, ManagementHelper.HDR_NOTIFICATION_TYPE + " = '" + CoreNotificationType.CONSUMER_SLOW + "'");
// Step 9. add a message listener to consumer listening to broker's management-notification-address,
// when it receives notification it signals main thread.
@@ -104,8 +101,7 @@ public class NotifySlowConsumerExample {
// Step 14. ensure CONSUMER_SLOW notification was received and "waitForSlowConsumerNotif" did not timeout
if (!isNotified) {
- throw new RuntimeException("SlowConsumerExample.demoSlowConsumerNotify() FAILED; timeout occurred before" +
- " - slow consumer notification was received. ");
+ throw new RuntimeException("SlowConsumerExample.demoSlowConsumerNotify() FAILED; timeout occurred before" + " - slow consumer notification was received. ");
}
}