activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clebertsuco...@apache.org
Subject [1/2] activemq-artemis git commit: [ARTEMIS-1475] Fix NPE in ActiveMQMessageHandler#setup
Date Mon, 23 Oct 2017 18:59:13 GMT
Repository: activemq-artemis
Updated Branches:
  refs/heads/1.x e42433f70 -> 459e5976c


[ARTEMIS-1475] Fix NPE in ActiveMQMessageHandler#setup

* initialize ActiveMQActivationSpec#shareSubscriptions to false
* i18n of the exception thrown by ActiveMQMessageHandler if it is not
  possible to create a non-shared subscriber

JIRA: https://issues.apache.org/jira/browse/ARTEMIS-1475


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/79e307e9
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/79e307e9
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/79e307e9

Branch: refs/heads/1.x
Commit: 79e307e9f98396fa69fea0a8582e540f1f719f82
Parents: e42433f
Author: Jeff Mesnil <jmesnil@gmail.com>
Authored: Mon Oct 23 14:01:30 2017 +0200
Committer: Jeff Mesnil <jmesnil@gmail.com>
Committed: Mon Oct 23 15:31:27 2017 +0200

----------------------------------------------------------------------
 .../java/org/apache/activemq/artemis/ra/ActiveMQRALogger.java   | 5 +++++
 .../activemq/artemis/ra/inflow/ActiveMQActivationSpec.java      | 2 +-
 .../activemq/artemis/ra/inflow/ActiveMQMessageHandler.java      | 2 +-
 3 files changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/79e307e9/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRALogger.java
----------------------------------------------------------------------
diff --git a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRALogger.java
b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRALogger.java
index 32316f0..ff2c743 100644
--- a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRALogger.java
+++ b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRALogger.java
@@ -24,6 +24,8 @@ import org.jboss.logging.annotations.LogMessage;
 import org.jboss.logging.annotations.Message;
 import org.jboss.logging.annotations.MessageLogger;
 
+import javax.jms.IllegalStateException;
+
 /**
  * Logger Code 15
  * <br>
@@ -132,4 +134,7 @@ public interface ActiveMQRALogger extends BasicLogger {
    @LogMessage(level = Logger.Level.DEBUG)
    @Message(id = 153001, value = "using different ActiveMQRAConnectionFactory", format =
Message.Format.MESSAGE_FORMAT)
    void warnDifferentConnectionfactory();
+
+   @Message(id = 153002, value = "Cannot create a subscriber on the durable subscription
since it already has subscriber(s)")
+   IllegalStateException canNotCreatedNonSharedSubscriber();
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/79e307e9/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/inflow/ActiveMQActivationSpec.java
----------------------------------------------------------------------
diff --git a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/inflow/ActiveMQActivationSpec.java
b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/inflow/ActiveMQActivationSpec.java
index d3ef9b2..5358215 100644
--- a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/inflow/ActiveMQActivationSpec.java
+++ b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/inflow/ActiveMQActivationSpec.java
@@ -96,7 +96,7 @@ public class ActiveMQActivationSpec extends ConnectionFactoryProperties
implemen
    /**
     * If this is true, a durable subscription could be shared by multiple MDB instances
     */
-   private Boolean shareSubscriptions;
+   private Boolean shareSubscriptions = false;
 
    /**
     * The user

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/79e307e9/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/inflow/ActiveMQMessageHandler.java
----------------------------------------------------------------------
diff --git a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/inflow/ActiveMQMessageHandler.java
b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/inflow/ActiveMQMessageHandler.java
index 698ab6a..efba8d0 100644
--- a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/inflow/ActiveMQMessageHandler.java
+++ b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/inflow/ActiveMQMessageHandler.java
@@ -122,7 +122,7 @@ public class ActiveMQMessageHandler implements MessageHandler, FailoverEventList
             // As a deployed MDB could set up multiple instances in order to process messages
in parallel.
             if (sessionNr == 0 && subResponse.getConsumerCount() > 0) {
                if (!spec.isShareSubscriptions()) {
-                  throw new javax.jms.IllegalStateException("Cannot create a subscriber on
the durable subscription since it already has subscriber(s)");
+                  throw ActiveMQRALogger.LOGGER.canNotCreatedNonSharedSubscriber();
                } else if (ActiveMQRALogger.LOGGER.isDebugEnabled()) {
                   logger.debug("the mdb on destination " + queueName + " already had " +
                                                    subResponse.getConsumerCount() +


Mime
View raw message