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-992 deal w/bad connector-ref in cluster-cxn
Date Thu, 23 Feb 2017 22:08:51 GMT
Repository: activemq-artemis
Updated Branches:
  refs/heads/1.x 1f054f04a -> 20d627f2b


ARTEMIS-992 deal w/bad connector-ref in cluster-cxn

(cherry picked from commit c7e0a921819cd39896e11bbfa008432633a88581)


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

Branch: refs/heads/1.x
Commit: 2b18db6a1cf39d9ca46e64962ff34a3d305edd4d
Parents: 1f054f0
Author: Justin Bertram <jbertram@apache.org>
Authored: Thu Feb 23 14:41:07 2017 -0600
Committer: Clebert Suconic <clebertsuconic@apache.org>
Committed: Thu Feb 23 16:53:56 2017 -0500

----------------------------------------------------------------------
 .../artemis/core/deployers/impl/FileConfigurationParser.java    | 5 +++++
 .../activemq/artemis/core/server/ActiveMQServerLogger.java      | 3 +++
 .../activemq/artemis/core/server/cluster/ClusterController.java | 4 ++++
 3 files changed, 12 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/2b18db6a/artemis-server/src/main/java/org/apache/activemq/artemis/core/deployers/impl/FileConfigurationParser.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/deployers/impl/FileConfigurationParser.java
b/artemis-server/src/main/java/org/apache/activemq/artemis/core/deployers/impl/FileConfigurationParser.java
index bfb9f84..087a6fb 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/deployers/impl/FileConfigurationParser.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/deployers/impl/FileConfigurationParser.java
@@ -1268,6 +1268,11 @@ public final class FileConfigurationParser extends XMLConfigurationUtil
{
 
       String connectorName = getString(e, "connector-ref", null, Validators.NOT_NULL_OR_EMPTY);
 
+      if (!mainConfig.getConnectorConfigurations().containsKey(connectorName)) {
+         ActiveMQServerLogger.LOGGER.connectorRefNotFound(connectorName, name);
+         return;
+      }
+
       boolean duplicateDetection = getBoolean(e, "use-duplicate-detection", ActiveMQDefaultConfiguration.isDefaultClusterDuplicateDetection());
 
       MessageLoadBalancingType messageLoadBalancingType;

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/2b18db6a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQServerLogger.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQServerLogger.java
b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQServerLogger.java
index 7e219c6..332e890 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQServerLogger.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQServerLogger.java
@@ -1283,6 +1283,9 @@ public interface ActiveMQServerLogger extends BasicLogger {
       format = Message.Format.MESSAGE_FORMAT)
    void negativeGlobalAddressSize(long size);
 
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222217, value = "Cannot find connector-ref {0}. The cluster-connection {1}
will not be deployed.", format = Message.Format.MESSAGE_FORMAT)
+   void connectorRefNotFound(String connectorRef, String clusterConnection);
 
    @LogMessage(level = Logger.Level.ERROR)
    @Message(id = 224000, value = "Failure in initialisation", format = Message.Format.MESSAGE_FORMAT)

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/2b18db6a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/ClusterController.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/ClusterController.java
b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/ClusterController.java
index 15595f8..b47dca9 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/ClusterController.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/ClusterController.java
@@ -317,6 +317,10 @@ public class ClusterController implements ActiveMQComponent {
 
       @Override
       public void handlePacket(Packet packet) {
+         if (!isStarted()) {
+            return;
+         }
+
          if (!authorized) {
             if (packet.getType() == PacketImpl.CLUSTER_CONNECT) {
                ClusterConnection clusterConnection = acceptorUsed.getClusterConnection();


Mime
View raw message