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 2015/09/25 04:31:39 UTC

[1/3] activemq-artemis git commit: Bringing data print back to artemis_home without instance defined. This is useful to debug data from tests and user's exports.

Repository: activemq-artemis
Updated Branches:
  refs/heads/master d58be06c3 -> 4cdcc618f


Bringing data print back to artemis_home without instance defined.
This is useful to debug data from tests and user's exports.


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

Branch: refs/heads/master
Commit: b0b5ca6896d56bd9c3d2049457180e702f8c7615
Parents: d58be06
Author: Clebert Suconic <cl...@apache.org>
Authored: Thu Sep 24 21:27:14 2015 -0400
Committer: Clebert Suconic <cl...@apache.org>
Committed: Thu Sep 24 22:30:52 2015 -0400

----------------------------------------------------------------------
 .../main/java/org/apache/activemq/artemis/cli/Artemis.java  | 2 ++
 .../activemq/artemis/cli/commands/ActionAbstract.java       | 4 ----
 .../apache/activemq/artemis/cli/commands/Configurable.java  | 3 ++-
 .../activemq/artemis/cli/commands/tools/LockAbstract.java   | 9 ++++++++-
 4 files changed, 12 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b0b5ca68/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/Artemis.java
----------------------------------------------------------------------
diff --git a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/Artemis.java b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/Artemis.java
index a72ee51..ace192e 100644
--- a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/Artemis.java
+++ b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/Artemis.java
@@ -108,6 +108,8 @@ public class Artemis {
          builder = builder.withCommands(Run.class, Stop.class, Kill.class);
       }
       else {
+         builder.withGroup("data").withDescription("data tools group (print) (example ./artemis data print)").
+            withDefaultCommand(HelpData.class).withCommands(PrintData.class);
          builder = builder.withCommand(Create.class);
       }
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b0b5ca68/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/ActionAbstract.java
----------------------------------------------------------------------
diff --git a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/ActionAbstract.java b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/ActionAbstract.java
index d5d68bd..406da24 100644
--- a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/ActionAbstract.java
+++ b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/ActionAbstract.java
@@ -57,10 +57,6 @@ public abstract class ActionAbstract implements Action {
             brokerInstance = brokerInstance.replace("\\", "/");
             System.setProperty("artemis.instance", brokerInstance);
          }
-         if (brokerInstance == null) {
-            // if still null we will try to improvise with "."
-            brokerInstance = ".";
-         }
       }
       return brokerInstance;
    }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b0b5ca68/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Configurable.java
----------------------------------------------------------------------
diff --git a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Configurable.java b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Configurable.java
index c4bd2d4..8caf8c2 100644
--- a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Configurable.java
+++ b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Configurable.java
@@ -126,6 +126,7 @@ public abstract class Configurable extends ActionAbstract {
             fileConfiguration.setJournalDirectory(defaultLocation + "/journal");
             fileConfiguration.setLargeMessagesDirectory(defaultLocation + "/largemessages");
             fileConfiguration.setPagingDirectory(defaultLocation + "/paging");
+            fileConfiguration.setBrokerInstance(new File("."));
          }
          else {
             fileConfiguration = new FileConfiguration();
@@ -135,10 +136,10 @@ public abstract class Configurable extends ActionAbstract {
             FileDeploymentManager fileDeploymentManager = new FileDeploymentManager(serverConfiguration);
             fileDeploymentManager.addDeployable(fileConfiguration).addDeployable(jmsConfiguration);
             fileDeploymentManager.readConfiguration();
+            fileConfiguration.setBrokerInstance(new File(getBrokerInstance()));
          }
       }
 
-      fileConfiguration.setBrokerInstance(new File(getBrokerInstance()));
 
       return fileConfiguration;
    }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b0b5ca68/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/tools/LockAbstract.java
----------------------------------------------------------------------
diff --git a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/tools/LockAbstract.java b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/tools/LockAbstract.java
index 9a6984d..4a2a99f 100644
--- a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/tools/LockAbstract.java
+++ b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/tools/LockAbstract.java
@@ -24,7 +24,14 @@ public abstract class LockAbstract  extends DataAbstract implements Action {
    @Override
    public Object execute(ActionContext context) throws Exception {
       super.execute(context);
-      lockCLI(getLockPlace());
+
+      if (getBrokerInstance() == null) {
+         System.err.println("Warning: You are running a data tool outside of any broker instance. Modifying data on a running server might break the server's data");
+         System.err.println();
+      }
+      else {
+         lockCLI(getLockPlace());
+      }
 
       return null;
    }


[2/3] activemq-artemis git commit: ARTEMIS-231 fixing wrong notification exceptions

Posted by cl...@apache.org.
ARTEMIS-231 fixing wrong notification exceptions


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

Branch: refs/heads/master
Commit: fcdfbdb82e740be876c5672358e9f845b7e766f2
Parents: b0b5ca6
Author: Clebert Suconic <cl...@apache.org>
Authored: Thu Sep 24 21:29:50 2015 -0400
Committer: Clebert Suconic <cl...@apache.org>
Committed: Thu Sep 24 22:31:28 2015 -0400

----------------------------------------------------------------------
 .../core/postoffice/impl/PostOfficeImpl.java    | 33 +++++++++++++-------
 1 file changed, 22 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/fcdfbdb8/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/PostOfficeImpl.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/PostOfficeImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/PostOfficeImpl.java
index 85ac2ef..8b2120d 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/PostOfficeImpl.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/PostOfficeImpl.java
@@ -251,7 +251,8 @@ public class PostOfficeImpl implements PostOffice, NotificationListener, Binding
                SimpleString filterString = props.getSimpleStringProperty(ManagementHelper.HDR_FILTERSTRING);
 
                if (!props.containsProperty(ManagementHelper.HDR_DISTANCE)) {
-                  throw ActiveMQMessageBundle.BUNDLE.distancenotSpecified();
+                  ActiveMQServerLogger.LOGGER.debug("PostOffice notification / BINDING_ADDED: HDR_DISANCE not specified, giving up propagation on notifications");
+                  return;
                }
 
                int distance = props.getIntProperty(ManagementHelper.HDR_DISTANCE);
@@ -266,7 +267,8 @@ public class PostOfficeImpl implements PostOffice, NotificationListener, Binding
                TypedProperties props = notification.getProperties();
 
                if (!props.containsProperty(ManagementHelper.HDR_CLUSTER_NAME)) {
-                  throw new IllegalStateException("No cluster name");
+                  ActiveMQServerLogger.LOGGER.debug("PostOffice notification / BINDING_REMOVED: HDR_CLUSTER_NAME not specified, giving up propagation on notifications");
+                  return;
                }
 
                SimpleString clusterName = props.getSimpleStringProperty(ManagementHelper.HDR_CLUSTER_NAME);
@@ -274,7 +276,8 @@ public class PostOfficeImpl implements PostOffice, NotificationListener, Binding
                QueueInfo info = queueInfos.remove(clusterName);
 
                if (info == null) {
-                  throw new IllegalStateException("Cannot find queue info for queue " + clusterName);
+                  ActiveMQServerLogger.LOGGER.debug("PostOffice notification / BINDING_REMOVED: Cannot find queue info for queue \" + clusterName");
+                  return;
                }
 
                break;
@@ -283,7 +286,8 @@ public class PostOfficeImpl implements PostOffice, NotificationListener, Binding
                TypedProperties props = notification.getProperties();
 
                if (!props.containsProperty(ManagementHelper.HDR_CLUSTER_NAME)) {
-                  throw new IllegalStateException("No cluster name");
+                  ActiveMQServerLogger.LOGGER.debug("PostOffice notification / CONSUMER_CREATED: No clusterName defined");
+                  return;
                }
 
                SimpleString clusterName = props.getSimpleStringProperty(ManagementHelper.HDR_CLUSTER_NAME);
@@ -293,7 +297,8 @@ public class PostOfficeImpl implements PostOffice, NotificationListener, Binding
                QueueInfo info = queueInfos.get(clusterName);
 
                if (info == null) {
-                  throw new IllegalStateException("Cannot find queue info for queue " + clusterName);
+                  ActiveMQServerLogger.LOGGER.debug("PostOffice notification / CONSUMER_CREATED: Could not find queue created on clusterName = " + clusterName);
+                  return;
                }
 
                info.incrementConsumers();
@@ -311,7 +316,8 @@ public class PostOfficeImpl implements PostOffice, NotificationListener, Binding
                }
 
                if (!props.containsProperty(ManagementHelper.HDR_DISTANCE)) {
-                  throw new IllegalStateException("No distance");
+                  ActiveMQServerLogger.LOGGER.debug("PostOffice notification / CONSUMER_CREATED: No distance specified");
+                  return;
                }
 
                int distance = props.getIntProperty(ManagementHelper.HDR_DISTANCE);
@@ -320,7 +326,8 @@ public class PostOfficeImpl implements PostOffice, NotificationListener, Binding
                   SimpleString queueName = props.getSimpleStringProperty(ManagementHelper.HDR_ROUTING_NAME);
 
                   if (queueName == null) {
-                     throw new IllegalStateException("No queue name");
+                     ActiveMQServerLogger.LOGGER.debug("PostOffice notification / CONSUMER_CREATED: No queue defined");
+                     return;
                   }
 
                   Binding binding = getBinding(queueName);
@@ -347,7 +354,8 @@ public class PostOfficeImpl implements PostOffice, NotificationListener, Binding
                SimpleString clusterName = props.getSimpleStringProperty(ManagementHelper.HDR_CLUSTER_NAME);
 
                if (clusterName == null) {
-                  throw new IllegalStateException("No cluster name");
+                  ActiveMQServerLogger.LOGGER.debug("PostOffice notification / CONSUMER_CLOSED: No cluster name");
+                  return;
                }
 
                SimpleString filterString = props.getSimpleStringProperty(ManagementHelper.HDR_FILTERSTRING);
@@ -368,7 +376,8 @@ public class PostOfficeImpl implements PostOffice, NotificationListener, Binding
 
                if (info.getNumberOfConsumers() == 0) {
                   if (!props.containsProperty(ManagementHelper.HDR_DISTANCE)) {
-                     throw new IllegalStateException("No cluster name");
+                     ActiveMQServerLogger.LOGGER.debug("PostOffice notification / CONSUMER_CLOSED: HDR_DISTANCE not defined");
+                     return;
                   }
 
                   int distance = props.getIntProperty(ManagementHelper.HDR_DISTANCE);
@@ -377,13 +386,15 @@ public class PostOfficeImpl implements PostOffice, NotificationListener, Binding
                      SimpleString queueName = props.getSimpleStringProperty(ManagementHelper.HDR_ROUTING_NAME);
 
                      if (queueName == null) {
-                        throw new IllegalStateException("No queue name");
+                        ActiveMQServerLogger.LOGGER.debug("PostOffice notification / CONSUMER_CLOSED: No queue name");
+                        return;
                      }
 
                      Binding binding = getBinding(queueName);
 
                      if (binding == null) {
-                        throw new IllegalStateException("No queue " + queueName);
+                        ActiveMQServerLogger.LOGGER.debug("PostOffice notification / CONSUMER_CLOSED: Could not find queue " + queueName);
+                        return;
                      }
 
                      Queue queue = (Queue) binding.getBindable();


[3/3] activemq-artemis git commit: ARTEMIS-232 Fixing logs

Posted by cl...@apache.org.
ARTEMIS-232 Fixing logs


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

Branch: refs/heads/master
Commit: 4cdcc618ff3dc08db45d696b5c4955abcee23782
Parents: fcdfbdb
Author: Clebert Suconic <cl...@apache.org>
Authored: Thu Sep 24 22:16:47 2015 -0400
Committer: Clebert Suconic <cl...@apache.org>
Committed: Thu Sep 24 22:31:29 2015 -0400

----------------------------------------------------------------------
 .../artemis/core/remoting/server/impl/RemotingServiceImpl.java    | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/4cdcc618/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/server/impl/RemotingServiceImpl.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/server/impl/RemotingServiceImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/server/impl/RemotingServiceImpl.java
index 8c6fcee..5b273c3 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/server/impl/RemotingServiceImpl.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/server/impl/RemotingServiceImpl.java
@@ -422,11 +422,12 @@ public class RemotingServiceImpl implements RemotingService, ConnectionLifeCycle
       ConnectionEntry entry = connections.remove(remotingConnectionID);
 
       if (entry != null) {
+         ActiveMQServerLogger.LOGGER.debug("RemotingServiceImpl::removing connection ID " + remotingConnectionID);
          connectionCountLatch.countDown();
          return entry.connection;
       }
       else {
-         ActiveMQServerLogger.LOGGER.errorRemovingConnection();
+         ActiveMQServerLogger.LOGGER.debug("The connectionID::" + remotingConnectionID + " was already removed by some other module");
 
          return null;
       }