You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by jb...@apache.org on 2016/11/23 17:43:02 UTC

[01/48] activemq-artemis git commit: added missing managament methods

Repository: activemq-artemis
Updated Branches:
  refs/heads/ARTEMIS-780 a25a8c481 -> 219886931


added missing managament methods


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

Branch: refs/heads/ARTEMIS-780
Commit: d4a54afa568e18b5fd0e5b63c95c65418d264c84
Parents: dca82a6
Author: Andy Taylor <an...@gmail.com>
Authored: Mon Nov 14 12:26:29 2016 +0000
Committer: Andy Taylor <an...@gmail.com>
Committed: Tue Nov 15 10:47:04 2016 +0000

----------------------------------------------------------------------
 .../core/management/ActiveMQServerControl.java  | 13 +++++-
 .../impl/ActiveMQServerControlImpl.java         | 45 ++++++++++++++++++++
 .../artemis/core/postoffice/PostOffice.java     |  2 +-
 .../core/postoffice/impl/PostOfficeImpl.java    | 10 ++---
 .../artemis/core/server/ActiveMQServer.java     |  2 +-
 .../core/server/impl/ActiveMQServerImpl.java    |  5 +--
 .../ActiveMQServerControlUsingCoreTest.java     | 10 +++++
 7 files changed, 76 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/d4a54afa/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/ActiveMQServerControl.java
----------------------------------------------------------------------
diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/ActiveMQServerControl.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/ActiveMQServerControl.java
index f10eb9b..7772459 100644
--- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/ActiveMQServerControl.java
+++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/ActiveMQServerControl.java
@@ -297,6 +297,14 @@ public interface ActiveMQServerControl {
    String getManagementAddress();
 
    /**
+    * Returns the node ID of this server.
+    * <br>
+    * Clients can send management messages to this address to manage this server.
+    */
+   @Attribute(desc = "Node ID of this server")
+   String getNodeID();
+
+   /**
     * Returns the management notification address of this server.
     * <br>
     * Clients can bind queues to this address to receive management notifications emitted by this server.
@@ -430,7 +438,7 @@ public interface ActiveMQServerControl {
                       @Parameter(name = "defaultDeleteOnNoConsumers", desc = "Whether or not a queue with this address is deleted when it has no consumers") boolean defaultDeleteOnNoConsumers,
                       @Parameter(name = "defaultMaxConsumers", desc = "The maximim number of consumer a queue with this address can have") int defaultMaxConsumers) throws Exception;
 
-   @Operation(desc = "create an address", impact = MBeanOperationInfo.ACTION)
+   @Operation(desc = "delete an address", impact = MBeanOperationInfo.ACTION)
    void deleteAddress(@Parameter(name = "name", desc = "The name of the address") String name) throws Exception;
 
    /**
@@ -890,5 +898,8 @@ public interface ActiveMQServerControl {
 
    @Operation(desc = "force the server to stop and to scale down to another server", impact = MBeanOperationInfo.UNKNOWN)
    void scaleDown(@Parameter(name = "name", desc = "The connector to use to scale down, if not provided the first appropriate connector will be used") String connector) throws Exception;
+
+   @Operation(desc = "List the Network Topology", impact = MBeanOperationInfo.INFO)
+   String listNetworkTopology() throws Exception;
 }
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/d4a54afa/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/ActiveMQServerControlImpl.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/ActiveMQServerControlImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/ActiveMQServerControlImpl.java
index 4f91317..a183187 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/ActiveMQServerControlImpl.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/ActiveMQServerControlImpl.java
@@ -50,6 +50,8 @@ import org.apache.activemq.artemis.api.core.management.BridgeControl;
 import org.apache.activemq.artemis.api.core.management.CoreNotificationType;
 import org.apache.activemq.artemis.api.core.management.DivertControl;
 import org.apache.activemq.artemis.api.core.management.QueueControl;
+import org.apache.activemq.artemis.core.client.impl.Topology;
+import org.apache.activemq.artemis.core.client.impl.TopologyMemberImpl;
 import org.apache.activemq.artemis.core.config.BridgeConfiguration;
 import org.apache.activemq.artemis.core.config.Configuration;
 import org.apache.activemq.artemis.core.config.ConnectorServiceConfiguration;
@@ -75,6 +77,8 @@ import org.apache.activemq.artemis.core.server.JournalType;
 import org.apache.activemq.artemis.core.server.Queue;
 import org.apache.activemq.artemis.core.server.ServerConsumer;
 import org.apache.activemq.artemis.core.server.ServerSession;
+import org.apache.activemq.artemis.core.server.cluster.ClusterConnection;
+import org.apache.activemq.artemis.core.server.cluster.ClusterManager;
 import org.apache.activemq.artemis.core.server.cluster.ha.HAPolicy;
 import org.apache.activemq.artemis.core.server.cluster.ha.LiveOnlyPolicy;
 import org.apache.activemq.artemis.core.server.cluster.ha.ScaleDownPolicy;
@@ -1975,6 +1979,42 @@ public class ActiveMQServerControlImpl extends AbstractControl implements Active
 
    }
 
+
+   @Override
+   public String listNetworkTopology() throws Exception {
+      checkStarted();
+
+      clearIO();
+      try {
+         JsonArrayBuilder brokers = JsonLoader.createArrayBuilder();
+         ClusterManager clusterManager = server.getClusterManager();
+         if (clusterManager != null) {
+            Set<ClusterConnection> clusterConnections = clusterManager.getClusterConnections();
+            for (ClusterConnection clusterConnection : clusterConnections) {
+               Topology topology = clusterConnection.getTopology();
+               Collection<TopologyMemberImpl> members = topology.getMembers();
+               for (TopologyMemberImpl member : members) {
+
+                  JsonObjectBuilder obj = JsonLoader.createObjectBuilder();
+                  TransportConfiguration live = member.getLive();
+                  if (live != null) {
+                     obj.add("nodeID", member.getNodeId()).add("live", live.getParams().get("host") + ":" + live.getParams().get("port"));
+                     TransportConfiguration backup = member.getBackup();
+                     if (backup != null) {
+                        obj.add("backup", backup.getParams().get("host") + ":" + backup.getParams().get("port"));
+                     }
+                  }
+                  brokers.add(obj);
+               }
+            }
+         }
+         return brokers.build().toString();
+      } finally {
+         blockOnIO();
+      }
+   }
+
+
    // NotificationEmitter implementation ----------------------------
 
    @Override
@@ -2071,6 +2111,11 @@ public class ActiveMQServerControlImpl extends AbstractControl implements Active
    }
 
    @Override
+   public String getNodeID() {
+      return server.getNodeID().toString();
+   }
+
+   @Override
    public String getManagementNotificationAddress() {
       return configuration.getManagementNotificationAddress().toString();
    }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/d4a54afa/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/PostOffice.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/PostOffice.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/PostOffice.java
index 0abd708..f1225c1 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/PostOffice.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/PostOffice.java
@@ -46,7 +46,7 @@ public interface PostOffice extends ActiveMQComponent {
 
    AddressInfo addOrUpdateAddressInfo(AddressInfo addressInfo);
 
-   AddressInfo removeAddressInfo(SimpleString address);
+   AddressInfo removeAddressInfo(SimpleString address) throws Exception;
 
    AddressInfo getAddressInfo(SimpleString address);
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/d4a54afa/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 135597f..52abcdb 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
@@ -439,12 +439,12 @@ public class PostOfficeImpl implements PostOffice, NotificationListener, Binding
    }
 
    @Override
-   public AddressInfo removeAddressInfo(SimpleString address) {
-      try {
-         getServer().getManagementService().unregisterAddress(address);
-      } catch (Exception e) {
-         e.printStackTrace();
+   public AddressInfo removeAddressInfo(SimpleString address) throws Exception {
+      Bindings bindingsForAddress = getBindingsForAddress(address);
+      if (bindingsForAddress.getBindings().size() > 0) {
+         throw new IllegalStateException("Address has bindings");
       }
+      managementService.unregisterAddress(address);
       return addressManager.removeAddressInfo(address);
    }
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/d4a54afa/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQServer.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQServer.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQServer.java
index 89af2a1..5dc22d6 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQServer.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQServer.java
@@ -445,7 +445,7 @@ public interface ActiveMQServer extends ActiveMQComponent {
 
    AddressInfo createOrUpdateAddressInfo(AddressInfo addressInfo) throws Exception;
 
-   AddressInfo removeAddressInfo(SimpleString address) throws Exception;
+   void removeAddressInfo(SimpleString address) throws Exception;
 
    String getInternalNamingPrefix();
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/d4a54afa/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
index d119891..28622a5 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
@@ -2263,15 +2263,14 @@ public class ActiveMQServerImpl implements ActiveMQServer {
    }
 
    @Override
-   public AddressInfo removeAddressInfo(SimpleString address) throws Exception {
-      AddressInfo result = postOffice.removeAddressInfo(address);
+   public void removeAddressInfo(SimpleString address) throws Exception {
+      postOffice.removeAddressInfo(address);
 
       // TODO: is this the right way to do this?
 //      long txID = storageManager.generateID();
 //      storageManager.deleteAddressBinding(txID, getAddressInfo(address).getID());
 //      storageManager.commitBindings(txID);
 
-      return result;
    }
 
    @Override

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/d4a54afa/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlUsingCoreTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlUsingCoreTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlUsingCoreTest.java
index b606261..ad36598 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlUsingCoreTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlUsingCoreTest.java
@@ -279,6 +279,11 @@ public class ActiveMQServerControlUsingCoreTest extends ActiveMQServerControlTes
          }
 
          @Override
+         public String getNodeID() {
+            return (String) proxy.retrieveAttributeValue("nodeID");
+         }
+
+         @Override
          public String getManagementAddress() {
             return (String) proxy.retrieveAttributeValue("managementAddress");
          }
@@ -622,6 +627,11 @@ public class ActiveMQServerControlUsingCoreTest extends ActiveMQServerControlTes
          }
 
          @Override
+         public String listNetworkTopology() throws Exception {
+            return (String) proxy.invokeOperation("listNetworkTopology");
+         }
+
+         @Override
          public void removeAddressSettings(String addressMatch) throws Exception {
             proxy.invokeOperation("removeAddressSettings", addressMatch);
          }


[31/48] activemq-artemis git commit: Add deleteAddress role

Posted by jb...@apache.org.
Add deleteAddress role


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

Branch: refs/heads/ARTEMIS-780
Commit: b7e7492bc270b4e494e2c8d9bbad09f4413a1377
Parents: ffeaf48
Author: jbertram <jb...@apache.com>
Authored: Thu Nov 17 21:42:25 2016 -0600
Committer: jbertram <jb...@apache.com>
Committed: Wed Nov 23 09:04:35 2016 -0600

----------------------------------------------------------------------
 .../artemis/cli/commands/etc/broker.xml         |   2 +
 .../core/management/ActiveMQServerControl.java  |   3 +-
 .../activemq/artemis/core/security/Role.java    |  23 ++++-
 .../artemis/utils/SecurityFormatter.java        |   7 +-
 .../impl/ActiveMQServerControlImpl.java         |   9 +-
 .../core/persistence/config/PersistedRoles.java |  29 +++++-
 .../core/server/impl/ActiveMQServerImpl.java    |   2 +-
 .../core/server/impl/ServerSessionImpl.java     |   1 -
 .../artemis/core/security/RoleTest.java         |  20 ++--
 .../artemis/core/settings/RepositoryTest.java   |  14 +--
 .../main/resources/activemq/server0/broker.xml  |   4 +-
 .../client/AutoCreateJmsDestinationTest.java    |   4 +-
 .../cluster/failover/SecurityFailoverTest.java  |   2 +-
 .../management/ActiveMQServerControlTest.java   |   4 +-
 .../ActiveMQServerControlUsingCoreTest.java     |   5 +-
 .../management/AddressControlTest.java          |   4 +-
 .../management/AddressControlUsingCoreTest.java |   2 +-
 ...tyManagementWithConfiguredAdminUserTest.java |   4 +-
 .../management/SecurityNotificationTest.java    |   4 +-
 .../integration/openwire/OpenWireTestBase.java  |   8 +-
 .../RolesConfigurationStorageTest.java          |  10 +-
 .../ra/ActiveMQMessageHandlerSecurityTest.java  |   2 +-
 .../tests/integration/ra/JMSContextTest.java    |   2 +-
 .../integration/ra/OutgoingConnectionTest.java  |   2 +-
 .../ra/OutgoingConnectionTestJTA.java           |   2 +-
 .../integration/security/LDAPSecurityTest.java  |   4 +-
 .../integration/security/SecurityTest.java      | 102 +++++++++----------
 .../integration/server/ResourceLimitTest.java   |   2 +-
 .../integration/ssl/DualAuthenticationTest.java |   4 +-
 .../tests/integration/stomp/StompTestBase.java  |   2 +-
 .../impl/ActiveMQSecurityManagerImplTest.java   |  28 ++---
 31 files changed, 179 insertions(+), 132 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b7e7492b/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/broker.xml
----------------------------------------------------------------------
diff --git a/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/broker.xml b/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/broker.xml
index 0dc70c7..62a82ec 100644
--- a/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/broker.xml
+++ b/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/broker.xml
@@ -73,6 +73,8 @@ ${cluster-security.settings}${cluster.settings}${replicated.settings}${shared-st
             <permission type="deleteNonDurableQueue" roles="${role}"/>
             <permission type="createDurableQueue" roles="${role}"/>
             <permission type="deleteDurableQueue" roles="${role}"/>
+            <permission type="createAddress" roles="${role}"/>
+            <permission type="deleteAddress" roles="${role}"/>
             <permission type="consume" roles="${role}"/>
             <permission type="browse" roles="${role}"/>
             <permission type="send" roles="${role}"/>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b7e7492b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/ActiveMQServerControl.java
----------------------------------------------------------------------
diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/ActiveMQServerControl.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/ActiveMQServerControl.java
index 0654dbf..b658508 100644
--- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/ActiveMQServerControl.java
+++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/ActiveMQServerControl.java
@@ -811,7 +811,8 @@ public interface ActiveMQServerControl {
                             @Parameter(desc = "a comma-separated list of roles allowed to delete non durable queues", name = "deleteNonDurableQueueRoles") String deleteNonDurableQueueRoles,
                             @Parameter(desc = "a comma-separated list of roles allowed to send management messages messages", name = "manage") String manageRoles,
                             @Parameter(desc = "a comma-separated list of roles allowed to browse queues", name = "browse") String browseRoles,
-                            @Parameter(desc = "a comma-separated list of roles allowed to create addresses", name = "createAddressRoles") String createAddressRoles) throws Exception;
+                            @Parameter(desc = "a comma-separated list of roles allowed to create addresses", name = "createAddressRoles") String createAddressRoles,
+                            @Parameter(desc = "a comma-separated list of roles allowed to delete addresses", name = "deleteAddressRoles") String deleteAddressRoles) throws Exception;
 
    @Operation(desc = "Remove security settings for an address", impact = MBeanOperationInfo.ACTION)
    void removeSecuritySettings(@Parameter(desc = "an address match", name = "addressMatch") String addressMatch) throws Exception;

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b7e7492b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/security/Role.java
----------------------------------------------------------------------
diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/security/Role.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/security/Role.java
index 2792d52..a3b4c21 100644
--- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/security/Role.java
+++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/security/Role.java
@@ -36,6 +36,8 @@ public class Role implements Serializable {
 
    private final boolean createAddress;
 
+   private final boolean deleteAddress;
+
    private final boolean createDurableQueue;
 
    private final boolean deleteDurableQueue;
@@ -49,7 +51,7 @@ public class Role implements Serializable {
    private final boolean browse;
 
    public JsonObject toJson() {
-      return JsonLoader.createObjectBuilder().add("name", name).add("send", send).add("consume", consume).add("createDurableQueue", createDurableQueue).add("deleteDurableQueue", deleteDurableQueue).add("createNonDurableQueue", createNonDurableQueue).add("deleteNonDurableQueue", deleteNonDurableQueue).add("manage", manage).add("browse", browse).add("createAddress", createAddress).build();
+      return JsonLoader.createObjectBuilder().add("name", name).add("send", send).add("consume", consume).add("createDurableQueue", createDurableQueue).add("deleteDurableQueue", deleteDurableQueue).add("createNonDurableQueue", createNonDurableQueue).add("deleteNonDurableQueue", deleteNonDurableQueue).add("manage", manage).add("browse", browse).add("createAddress", createAddress).add("deleteAddress", deleteAddress).build();
    }
 
    /**
@@ -87,8 +89,8 @@ public class Role implements Serializable {
                final boolean manage,
                final boolean browse) {
       // This constructor exists for version compatibility on the API. If either createDurableQueue or createNonDurableQueue
-      // is true then createAddress will be true.
-      this(name, send, consume, createDurableQueue, deleteDurableQueue, createNonDurableQueue, deleteNonDurableQueue, manage, browse, createDurableQueue || createNonDurableQueue);
+      // is true then createAddress will be true. If either deleteDurableQueue or deleteNonDurableQueue is true then deleteAddress will be true.
+      this(name, send, consume, createDurableQueue, deleteDurableQueue, createNonDurableQueue, deleteNonDurableQueue, manage, browse, createDurableQueue || createNonDurableQueue, deleteDurableQueue || deleteNonDurableQueue);
    }
 
    public Role(final String name,
@@ -100,7 +102,8 @@ public class Role implements Serializable {
                final boolean deleteNonDurableQueue,
                final boolean manage,
                final boolean browse,
-               final boolean createAddress) {
+               final boolean createAddress,
+               final boolean deleteAddress) {
       if (name == null) {
          throw new NullPointerException("name is null");
       }
@@ -108,6 +111,7 @@ public class Role implements Serializable {
       this.send = send;
       this.consume = consume;
       this.createAddress = createAddress;
+      this.deleteAddress = deleteAddress;
       this.createDurableQueue = createDurableQueue;
       this.deleteDurableQueue = deleteDurableQueue;
       this.createNonDurableQueue = createNonDurableQueue;
@@ -132,6 +136,10 @@ public class Role implements Serializable {
       return createAddress;
    }
 
+   public boolean isDeleteAddress() {
+      return deleteAddress;
+   }
+
    public boolean isCreateDurableQueue() {
       return createDurableQueue;
    }
@@ -161,6 +169,9 @@ public class Role implements Serializable {
       if (createAddress) {
          stringReturn.append(" createAddress ");
       }
+      if (deleteAddress) {
+         stringReturn.append(" deleteAddress ");
+      }
       if (createDurableQueue) {
          stringReturn.append(" createDurableQueue ");
       }
@@ -202,6 +213,9 @@ public class Role implements Serializable {
       if (createAddress != role.createAddress) {
          return false;
       }
+      if (deleteAddress != role.deleteAddress) {
+         return false;
+      }
       if (createDurableQueue != role.createDurableQueue) {
          return false;
       }
@@ -237,6 +251,7 @@ public class Role implements Serializable {
       result = 31 * result + (send ? 1 : 0);
       result = 31 * result + (consume ? 1 : 0);
       result = 31 * result + (createAddress ? 1 : 0);
+      result = 31 * result + (deleteAddress ? 1 : 0);
       result = 31 * result + (createDurableQueue ? 1 : 0);
       result = 31 * result + (deleteDurableQueue ? 1 : 0);
       result = 31 * result + (createNonDurableQueue ? 1 : 0);

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b7e7492b/artemis-core-client/src/main/java/org/apache/activemq/artemis/utils/SecurityFormatter.java
----------------------------------------------------------------------
diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/utils/SecurityFormatter.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/utils/SecurityFormatter.java
index 7e9ff32..08c414d 100644
--- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/utils/SecurityFormatter.java
+++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/utils/SecurityFormatter.java
@@ -33,7 +33,8 @@ public class SecurityFormatter {
                                           String deleteNonDurableQueueRoles,
                                           String manageRoles,
                                           String browseRoles,
-                                          String createAddressRoles) {
+                                          String createAddressRoles,
+                                          String deleteAddressRoles) {
       List<String> createDurableQueue = toList(createDurableQueueRoles);
       List<String> deleteDurableQueue = toList(deleteDurableQueueRoles);
       List<String> createNonDurableQueue = toList(createNonDurableQueueRoles);
@@ -43,6 +44,7 @@ public class SecurityFormatter {
       List<String> manage = toList(manageRoles);
       List<String> browse = toList(browseRoles);
       List<String> createAddress = toList(createAddressRoles);
+      List<String> deleteAddress = toList(deleteAddressRoles);
 
       Set<String> allRoles = new HashSet<>();
       allRoles.addAll(createDurableQueue);
@@ -54,10 +56,11 @@ public class SecurityFormatter {
       allRoles.addAll(manage);
       allRoles.addAll(browse);
       allRoles.addAll(createAddress);
+      allRoles.addAll(deleteAddress);
 
       Set<Role> roles = new HashSet<>(allRoles.size());
       for (String role : allRoles) {
-         roles.add(new Role(role, send.contains(role), consume.contains(role), createDurableQueue.contains(role), deleteDurableQueue.contains(role), createNonDurableQueue.contains(role), deleteNonDurableQueue.contains(role), manageRoles.contains(role), browse.contains(role), createAddressRoles.contains(role)));
+         roles.add(new Role(role, send.contains(role), consume.contains(role), createDurableQueue.contains(role), deleteDurableQueue.contains(role), createNonDurableQueue.contains(role), deleteNonDurableQueue.contains(role), manageRoles.contains(role), browse.contains(role), createAddressRoles.contains(role), deleteAddressRoles.contains(role)));
       }
       return roles;
    }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b7e7492b/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/ActiveMQServerControlImpl.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/ActiveMQServerControlImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/ActiveMQServerControlImpl.java
index e7900f2..0458fa4 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/ActiveMQServerControlImpl.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/ActiveMQServerControlImpl.java
@@ -1598,7 +1598,7 @@ public class ActiveMQServerControlImpl extends AbstractControl implements Active
                                    final String deleteNonDurableQueueRoles,
                                    final String manageRoles,
                                    final String browseRoles) throws Exception {
-      addSecuritySettings(addressMatch, sendRoles, consumeRoles, createDurableQueueRoles, deleteDurableQueueRoles, createNonDurableQueueRoles, deleteNonDurableQueueRoles, manageRoles, browseRoles, "");
+      addSecuritySettings(addressMatch, sendRoles, consumeRoles, createDurableQueueRoles, deleteDurableQueueRoles, createNonDurableQueueRoles, deleteNonDurableQueueRoles, manageRoles, browseRoles, "", "");
    }
 
    @Override
@@ -1611,16 +1611,17 @@ public class ActiveMQServerControlImpl extends AbstractControl implements Active
                                    final String deleteNonDurableQueueRoles,
                                    final String manageRoles,
                                    final String browseRoles,
-                                   final String createAddressRoles) throws Exception {
+                                   final String createAddressRoles,
+                                   final String deleteAddressRoles) throws Exception {
       checkStarted();
 
       clearIO();
       try {
-         Set<Role> roles = SecurityFormatter.createSecurity(sendRoles, consumeRoles, createDurableQueueRoles, deleteDurableQueueRoles, createNonDurableQueueRoles, deleteNonDurableQueueRoles, manageRoles, browseRoles, createAddressRoles);
+         Set<Role> roles = SecurityFormatter.createSecurity(sendRoles, consumeRoles, createDurableQueueRoles, deleteDurableQueueRoles, createNonDurableQueueRoles, deleteNonDurableQueueRoles, manageRoles, browseRoles, createAddressRoles, deleteAddressRoles);
 
          server.getSecurityRepository().addMatch(addressMatch, roles);
 
-         PersistedRoles persistedRoles = new PersistedRoles(addressMatch, sendRoles, consumeRoles, createDurableQueueRoles, deleteDurableQueueRoles, createNonDurableQueueRoles, deleteNonDurableQueueRoles, manageRoles, browseRoles, createAddressRoles);
+         PersistedRoles persistedRoles = new PersistedRoles(addressMatch, sendRoles, consumeRoles, createDurableQueueRoles, deleteDurableQueueRoles, createNonDurableQueueRoles, deleteNonDurableQueueRoles, manageRoles, browseRoles, createAddressRoles, deleteAddressRoles);
 
          storageManager.storeSecurityRoles(persistedRoles);
       } finally {

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b7e7492b/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/config/PersistedRoles.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/config/PersistedRoles.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/config/PersistedRoles.java
index ffa0dbb..86fdc14 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/config/PersistedRoles.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/config/PersistedRoles.java
@@ -48,6 +48,8 @@ public class PersistedRoles implements EncodingSupport {
 
    private SimpleString createAddressRoles;
 
+   private SimpleString deleteAddressRoles;
+
    // Static --------------------------------------------------------
 
    // Constructors --------------------------------------------------
@@ -65,6 +67,8 @@ public class PersistedRoles implements EncodingSupport {
     * @param deleteNonDurableQueueRoles
     * @param manageRoles
     * @param browseRoles
+    * @param createAddressRoles
+    * @param deleteAddressRoles
     */
    public PersistedRoles(final String addressMatch,
                          final String sendRoles,
@@ -75,7 +79,8 @@ public class PersistedRoles implements EncodingSupport {
                          final String deleteNonDurableQueueRoles,
                          final String manageRoles,
                          final String browseRoles,
-                         final String createAddressRoles) {
+                         final String createAddressRoles,
+                         final String deleteAddressRoles) {
       super();
       this.addressMatch = SimpleString.toSimpleString(addressMatch);
       this.sendRoles = SimpleString.toSimpleString(sendRoles);
@@ -87,6 +92,7 @@ public class PersistedRoles implements EncodingSupport {
       this.manageRoles = SimpleString.toSimpleString(manageRoles);
       this.browseRoles = SimpleString.toSimpleString(browseRoles);
       this.createAddressRoles = SimpleString.toSimpleString(createAddressRoles);
+      this.deleteAddressRoles = SimpleString.toSimpleString(deleteAddressRoles);
    }
 
    // Public --------------------------------------------------------
@@ -169,6 +175,13 @@ public class PersistedRoles implements EncodingSupport {
       return createAddressRoles.toString();
    }
 
+   /**
+    * @return the deleteAddressRoles
+    */
+   public String getDeleteAddressRoles() {
+      return deleteAddressRoles.toString();
+   }
+
    @Override
    public void encode(final ActiveMQBuffer buffer) {
       buffer.writeSimpleString(addressMatch);
@@ -181,6 +194,7 @@ public class PersistedRoles implements EncodingSupport {
       buffer.writeNullableSimpleString(manageRoles);
       buffer.writeNullableSimpleString(browseRoles);
       buffer.writeNullableSimpleString(createAddressRoles);
+      buffer.writeNullableSimpleString(deleteAddressRoles);
    }
 
    @Override
@@ -193,8 +207,8 @@ public class PersistedRoles implements EncodingSupport {
          SimpleString.sizeofNullableString(deleteNonDurableQueueRoles) +
          SimpleString.sizeofNullableString(manageRoles) +
          SimpleString.sizeofNullableString(browseRoles) +
-         SimpleString.sizeofNullableString(createAddressRoles);
-
+         SimpleString.sizeofNullableString(createAddressRoles) +
+         SimpleString.sizeofNullableString(deleteAddressRoles);
    }
 
    @Override
@@ -209,6 +223,7 @@ public class PersistedRoles implements EncodingSupport {
       manageRoles = buffer.readNullableSimpleString();
       browseRoles = buffer.readNullableSimpleString();
       createAddressRoles = buffer.readNullableSimpleString();
+      deleteAddressRoles = buffer.readNullableSimpleString();
    }
 
    /* (non-Javadoc)
@@ -227,6 +242,7 @@ public class PersistedRoles implements EncodingSupport {
       result = prime * result + ((manageRoles == null) ? 0 : manageRoles.hashCode());
       result = prime * result + ((browseRoles == null) ? 0 : browseRoles.hashCode());
       result = prime * result + ((createAddressRoles == null) ? 0 : createAddressRoles.hashCode());
+      result = prime * result + ((deleteAddressRoles == null) ? 0 : deleteAddressRoles.hashCode());
       result = prime * result + ((sendRoles == null) ? 0 : sendRoles.hashCode());
       result = prime * result + (int) (storeId ^ (storeId >>> 32));
       return result;
@@ -289,6 +305,11 @@ public class PersistedRoles implements EncodingSupport {
             return false;
       } else if (!createAddressRoles.equals(other.createAddressRoles))
          return false;
+      if (deleteAddressRoles == null) {
+         if (other.deleteAddressRoles != null)
+            return false;
+      } else if (!deleteAddressRoles.equals(other.deleteAddressRoles))
+         return false;
       if (sendRoles == null) {
          if (other.sendRoles != null)
             return false;
@@ -325,6 +346,8 @@ public class PersistedRoles implements EncodingSupport {
          browseRoles +
          ", createAddressRoles=" +
          createAddressRoles +
+         ", deleteAddressRoles=" +
+         deleteAddressRoles +
          "]";
    }
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b7e7492b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
index b0d61ad..1c508df 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
@@ -2249,7 +2249,7 @@ public class ActiveMQServerImpl implements ActiveMQServer {
       List<PersistedRoles> roles = storageManager.recoverPersistedRoles();
 
       for (PersistedRoles roleItem : roles) {
-         Set<Role> setRoles = SecurityFormatter.createSecurity(roleItem.getSendRoles(), roleItem.getConsumeRoles(), roleItem.getCreateDurableQueueRoles(), roleItem.getDeleteDurableQueueRoles(), roleItem.getCreateNonDurableQueueRoles(), roleItem.getDeleteNonDurableQueueRoles(), roleItem.getManageRoles(), roleItem.getBrowseRoles(), roleItem.getCreateAddressRoles());
+         Set<Role> setRoles = SecurityFormatter.createSecurity(roleItem.getSendRoles(), roleItem.getConsumeRoles(), roleItem.getCreateDurableQueueRoles(), roleItem.getDeleteDurableQueueRoles(), roleItem.getCreateNonDurableQueueRoles(), roleItem.getDeleteNonDurableQueueRoles(), roleItem.getManageRoles(), roleItem.getBrowseRoles(), roleItem.getCreateAddressRoles(), roleItem.getDeleteAddressRoles());
 
          securityRepository.addMatch(roleItem.getAddressMatch().toString(), setRoles);
       }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b7e7492b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ServerSessionImpl.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ServerSessionImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ServerSessionImpl.java
index 8d73eda..e4e9135 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ServerSessionImpl.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ServerSessionImpl.java
@@ -538,7 +538,6 @@ public class ServerSessionImpl implements ServerSession, FailureListener {
 
    @Override
    public AddressInfo createAddress(final SimpleString address, final boolean multicast) throws Exception {
-      // make sure the user has privileges to create this queue
       securityCheck(address, CheckType.CREATE_ADDRESS, this);
       AddressInfo.RoutingType routingType = multicast ? AddressInfo.RoutingType.MULTICAST : AddressInfo.RoutingType.ANYCAST;
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b7e7492b/artemis-server/src/test/java/org/apache/activemq/artemis/core/security/RoleTest.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/test/java/org/apache/activemq/artemis/core/security/RoleTest.java b/artemis-server/src/test/java/org/apache/activemq/artemis/core/security/RoleTest.java
index 5274db6..a2b3d44 100644
--- a/artemis-server/src/test/java/org/apache/activemq/artemis/core/security/RoleTest.java
+++ b/artemis-server/src/test/java/org/apache/activemq/artemis/core/security/RoleTest.java
@@ -42,7 +42,7 @@ public class RoleTest extends Assert {
 
    @Test
    public void testWriteRole() throws Exception {
-      Role role = new Role("testWriteRole", true, false, false, false, false, false, false, false, false);
+      Role role = new Role("testWriteRole", true, false, false, false, false, false, false, false, false, false);
       Assert.assertTrue(SEND.hasRole(role));
       Assert.assertFalse(CONSUME.hasRole(role));
       Assert.assertFalse(CREATE_DURABLE_QUEUE.hasRole(role));
@@ -56,7 +56,7 @@ public class RoleTest extends Assert {
 
    @Test
    public void testReadRole() throws Exception {
-      Role role = new Role("testReadRole", false, true, false, false, false, false, false, true, false);
+      Role role = new Role("testReadRole", false, true, false, false, false, false, false, true, false, false);
       Assert.assertFalse(SEND.hasRole(role));
       Assert.assertTrue(CONSUME.hasRole(role));
       Assert.assertFalse(CREATE_DURABLE_QUEUE.hasRole(role));
@@ -70,7 +70,7 @@ public class RoleTest extends Assert {
 
    @Test
    public void testCreateRole() throws Exception {
-      Role role = new Role("testCreateRole", false, false, true, false, false, false, false, false, false);
+      Role role = new Role("testCreateRole", false, false, true, false, false, false, false, false, false, false);
       Assert.assertFalse(SEND.hasRole(role));
       Assert.assertFalse(CONSUME.hasRole(role));
       Assert.assertTrue(CREATE_DURABLE_QUEUE.hasRole(role));
@@ -84,7 +84,7 @@ public class RoleTest extends Assert {
 
    @Test
    public void testManageRole() throws Exception {
-      Role role = new Role("testManageRole", false, false, false, false, false, false, true, false, false);
+      Role role = new Role("testManageRole", false, false, false, false, false, false, true, false, false, false);
       Assert.assertFalse(SEND.hasRole(role));
       Assert.assertFalse(CONSUME.hasRole(role));
       Assert.assertFalse(CREATE_DURABLE_QUEUE.hasRole(role));
@@ -98,12 +98,12 @@ public class RoleTest extends Assert {
 
    @Test
    public void testEqualsAndHashcode() throws Exception {
-      Role role = new Role("testEquals", true, true, true, false, false, false, false, false, false);
-      Role sameRole = new Role("testEquals", true, true, true, false, false, false, false, false, false);
-      Role roleWithDifferentName = new Role("notEquals", true, true, true, false, false, false, false, false, false);
-      Role roleWithDifferentRead = new Role("testEquals", false, true, true, false, false, false, false, false, false);
-      Role roleWithDifferentWrite = new Role("testEquals", true, false, true, false, false, false, false, false, false);
-      Role roleWithDifferentCreate = new Role("testEquals", true, true, false, false, false, false, false, false, false);
+      Role role = new Role("testEquals", true, true, true, false, false, false, false, false, false, false);
+      Role sameRole = new Role("testEquals", true, true, true, false, false, false, false, false, false, false);
+      Role roleWithDifferentName = new Role("notEquals", true, true, true, false, false, false, false, false, false, false);
+      Role roleWithDifferentRead = new Role("testEquals", false, true, true, false, false, false, false, false, false, false);
+      Role roleWithDifferentWrite = new Role("testEquals", true, false, true, false, false, false, false, false, false, false);
+      Role roleWithDifferentCreate = new Role("testEquals", true, true, false, false, false, false, false, false, false, false);
 
       Assert.assertTrue(role.equals(role));
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b7e7492b/artemis-server/src/test/java/org/apache/activemq/artemis/core/settings/RepositoryTest.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/test/java/org/apache/activemq/artemis/core/settings/RepositoryTest.java b/artemis-server/src/test/java/org/apache/activemq/artemis/core/settings/RepositoryTest.java
index b8678ae..ed272c4 100644
--- a/artemis-server/src/test/java/org/apache/activemq/artemis/core/settings/RepositoryTest.java
+++ b/artemis-server/src/test/java/org/apache/activemq/artemis/core/settings/RepositoryTest.java
@@ -72,13 +72,13 @@ public class RepositoryTest extends ActiveMQTestBase {
    public void testSingletwo() {
       securityRepository.addMatch("queues.another.aq.*", new HashSet<Role>());
       HashSet<Role> roles = new HashSet<>(2);
-      roles.add(new Role("test1", true, true, true, true, true, true, true, true, true));
-      roles.add(new Role("test2", true, true, true, true, true, true, true, true, true));
+      roles.add(new Role("test1", true, true, true, true, true, true, true, true, true, true));
+      roles.add(new Role("test2", true, true, true, true, true, true, true, true, true, true));
       securityRepository.addMatch("queues.aq", roles);
       HashSet<Role> roles2 = new HashSet<>(2);
-      roles2.add(new Role("test1", true, true, true, true, true, true, true, true, true));
-      roles2.add(new Role("test2", true, true, true, true, true, true, true, true, true));
-      roles2.add(new Role("test3", true, true, true, true, true, true, true, true, true));
+      roles2.add(new Role("test1", true, true, true, true, true, true, true, true, true, true));
+      roles2.add(new Role("test2", true, true, true, true, true, true, true, true, true, true));
+      roles2.add(new Role("test3", true, true, true, true, true, true, true, true, true, true));
       securityRepository.addMatch("queues.another.andanother", roles2);
 
       HashSet<Role> hashSet = securityRepository.getMatch("queues.another.andanother");
@@ -89,8 +89,8 @@ public class RepositoryTest extends ActiveMQTestBase {
    public void testWithoutWildcard() {
       securityRepository.addMatch("queues.1.*", new HashSet<Role>());
       HashSet<Role> roles = new HashSet<>(2);
-      roles.add(new Role("test1", true, true, true, true, true, true, true, true, true));
-      roles.add(new Role("test2", true, true, true, true, true, true, true, true, true));
+      roles.add(new Role("test1", true, true, true, true, true, true, true, true, true, true));
+      roles.add(new Role("test2", true, true, true, true, true, true, true, true, true, true));
       securityRepository.addMatch("queues.2.aq", roles);
       HashSet<Role> hashSet = securityRepository.getMatch("queues.2.aq");
       Assert.assertEquals(hashSet.size(), 2);

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b7e7492b/examples/features/standard/topic/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/topic/src/main/resources/activemq/server0/broker.xml b/examples/features/standard/topic/src/main/resources/activemq/server0/broker.xml
index fd6671c..25d82da 100644
--- a/examples/features/standard/topic/src/main/resources/activemq/server0/broker.xml
+++ b/examples/features/standard/topic/src/main/resources/activemq/server0/broker.xml
@@ -45,9 +45,11 @@ under the License.
       <!-- Other config -->
       <security-settings>
          <!--security for example topic-->
-         <security-setting match="jms.topic.exampleTopic">
+         <security-setting match="exampleTopic">
             <permission type="createDurableQueue" roles="guest"/>
             <permission type="deleteDurableQueue" roles="guest"/>
+            <permission type="createAddress" roles="guest"/>
+            <permission type="deleteAddress" roles="guest"/>
             <permission type="createNonDurableQueue" roles="guest"/>
             <permission type="deleteNonDurableQueue" roles="guest"/>
             <permission type="consume" roles="guest"/>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b7e7492b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/AutoCreateJmsDestinationTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/AutoCreateJmsDestinationTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/AutoCreateJmsDestinationTest.java
index 006bef1..a980878 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/AutoCreateJmsDestinationTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/AutoCreateJmsDestinationTest.java
@@ -114,7 +114,7 @@ public class AutoCreateJmsDestinationTest extends JMSTestBase {
       ((ActiveMQJAASSecurityManager) server.getSecurityManager()).getConfiguration().addUser("guest", "guest");
       ((ActiveMQJAASSecurityManager) server.getSecurityManager()).getConfiguration().setDefaultUser("guest");
       ((ActiveMQJAASSecurityManager) server.getSecurityManager()).getConfiguration().addRole("guest", "rejectAll");
-      Role role = new Role("rejectAll", false, false, false, false, false, false, false, false, false);
+      Role role = new Role("rejectAll", false, false, false, false, false, false, false, false, false, false);
       Set<Role> roles = new HashSet<>();
       roles.add(role);
       server.getSecurityRepository().addMatch("#", roles);
@@ -249,7 +249,7 @@ public class AutoCreateJmsDestinationTest extends JMSTestBase {
       ((ActiveMQJAASSecurityManager) server.getSecurityManager()).getConfiguration().addUser("guest", "guest");
       ((ActiveMQJAASSecurityManager) server.getSecurityManager()).getConfiguration().setDefaultUser("guest");
       ((ActiveMQJAASSecurityManager) server.getSecurityManager()).getConfiguration().addRole("guest", "allowAll");
-      Role role = new Role("allowAll", true, true, true, true, true, true, true, true, true);
+      Role role = new Role("allowAll", true, true, true, true, true, true, true, true, true, true);
       Set<Role> roles = new HashSet<>();
       roles.add(role);
       server.getSecurityRepository().addMatch("#", roles);

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b7e7492b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/SecurityFailoverTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/SecurityFailoverTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/SecurityFailoverTest.java
index abfc093..746b31d 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/SecurityFailoverTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/SecurityFailoverTest.java
@@ -103,7 +103,7 @@ public class SecurityFailoverTest extends FailoverTest {
    protected ActiveMQJAASSecurityManager installSecurity(TestableServer server) {
       ActiveMQJAASSecurityManager securityManager = (ActiveMQJAASSecurityManager) server.getServer().getSecurityManager();
       securityManager.getConfiguration().addUser("a", "b");
-      Role role = new Role("arole", true, true, true, true, true, true, true, true, true);
+      Role role = new Role("arole", true, true, true, true, true, true, true, true, true, true);
       Set<Role> roles = new HashSet<>();
       roles.add(role);
       server.getServer().getSecurityRepository().addMatch("#", roles);

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b7e7492b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlTest.java
index bac9671..142c3d5 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlTest.java
@@ -440,7 +440,7 @@ public class ActiveMQServerControlTest extends ManagementTestBase {
       String exactAddress = "test.whatever";
 
       assertEquals(1, serverControl.getRoles(addressMatch).length);
-      serverControl.addSecuritySettings(addressMatch, "foo", "foo, bar", "foo", "bar", "foo, bar", "", "", "bar", "foo");
+      serverControl.addSecuritySettings(addressMatch, "foo", "foo, bar", "foo", "bar", "foo, bar", "", "", "bar", "foo", "foo");
 
       // Restart the server. Those settings should be persisted
 
@@ -1415,7 +1415,7 @@ public class ActiveMQServerControlTest extends ManagementTestBase {
       server.start();
 
       HashSet<Role> role = new HashSet<>();
-      role.add(new Role("guest", true, true, true, true, true, true, true, true, true));
+      role.add(new Role("guest", true, true, true, true, true, true, true, true, true, true));
       server.getSecurityRepository().addMatch("#", role);
    }
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b7e7492b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlUsingCoreTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlUsingCoreTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlUsingCoreTest.java
index 2547bb6..cb2d9b0 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlUsingCoreTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlUsingCoreTest.java
@@ -607,8 +607,9 @@ public class ActiveMQServerControlUsingCoreTest extends ActiveMQServerControlTes
                                          String deleteNonDurableQueueRoles,
                                          String manageRoles,
                                          String browseRoles,
-                                         String createAddress) throws Exception {
-            proxy.invokeOperation("addSecuritySettings", addressMatch, sendRoles, consumeRoles, createDurableQueueRoles, deleteDurableQueueRoles, createNonDurableQueueRoles, deleteNonDurableQueueRoles, manageRoles, browseRoles, createAddress);
+                                         String createAddress,
+                                         String deleteAddress) throws Exception {
+            proxy.invokeOperation("addSecuritySettings", addressMatch, sendRoles, consumeRoles, createDurableQueueRoles, deleteDurableQueueRoles, createNonDurableQueueRoles, deleteNonDurableQueueRoles, manageRoles, browseRoles, createAddress, deleteAddress);
          }
 
          @Override

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b7e7492b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/AddressControlTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/AddressControlTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/AddressControlTest.java
index 9a2ec1e..35e1aa2 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/AddressControlTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/AddressControlTest.java
@@ -117,7 +117,7 @@ public class AddressControlTest extends ManagementTestBase {
    public void testGetRoles() throws Exception {
       SimpleString address = RandomUtil.randomSimpleString();
       SimpleString queue = RandomUtil.randomSimpleString();
-      Role role = new Role(RandomUtil.randomString(), RandomUtil.randomBoolean(), RandomUtil.randomBoolean(), RandomUtil.randomBoolean(), RandomUtil.randomBoolean(), RandomUtil.randomBoolean(), RandomUtil.randomBoolean(), RandomUtil.randomBoolean(), RandomUtil.randomBoolean(), RandomUtil.randomBoolean());
+      Role role = new Role(RandomUtil.randomString(), RandomUtil.randomBoolean(), RandomUtil.randomBoolean(), RandomUtil.randomBoolean(), RandomUtil.randomBoolean(), RandomUtil.randomBoolean(), RandomUtil.randomBoolean(), RandomUtil.randomBoolean(), RandomUtil.randomBoolean(), RandomUtil.randomBoolean(), RandomUtil.randomBoolean());
 
       session.createQueue(address, queue, true);
 
@@ -148,7 +148,7 @@ public class AddressControlTest extends ManagementTestBase {
    public void testGetRolesAsJSON() throws Exception {
       SimpleString address = RandomUtil.randomSimpleString();
       SimpleString queue = RandomUtil.randomSimpleString();
-      Role role = new Role(RandomUtil.randomString(), RandomUtil.randomBoolean(), RandomUtil.randomBoolean(), RandomUtil.randomBoolean(), RandomUtil.randomBoolean(), RandomUtil.randomBoolean(), RandomUtil.randomBoolean(), RandomUtil.randomBoolean(), RandomUtil.randomBoolean(), RandomUtil.randomBoolean());
+      Role role = new Role(RandomUtil.randomString(), RandomUtil.randomBoolean(), RandomUtil.randomBoolean(), RandomUtil.randomBoolean(), RandomUtil.randomBoolean(), RandomUtil.randomBoolean(), RandomUtil.randomBoolean(), RandomUtil.randomBoolean(), RandomUtil.randomBoolean(), RandomUtil.randomBoolean(), RandomUtil.randomBoolean());
 
       session.createQueue(address, queue, true);
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b7e7492b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/AddressControlUsingCoreTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/AddressControlUsingCoreTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/AddressControlUsingCoreTest.java
index 1587cef..4b8e487 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/AddressControlUsingCoreTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/AddressControlUsingCoreTest.java
@@ -125,7 +125,7 @@ public class AddressControlUsingCoreTest extends ManagementTestBase {
    public void testGetRoles() throws Exception {
       SimpleString address = RandomUtil.randomSimpleString();
       SimpleString queue = RandomUtil.randomSimpleString();
-      Role role = new Role(RandomUtil.randomString(), RandomUtil.randomBoolean(), RandomUtil.randomBoolean(), RandomUtil.randomBoolean(), RandomUtil.randomBoolean(), RandomUtil.randomBoolean(), RandomUtil.randomBoolean(), RandomUtil.randomBoolean(), RandomUtil.randomBoolean(), RandomUtil.randomBoolean());
+      Role role = new Role(RandomUtil.randomString(), RandomUtil.randomBoolean(), RandomUtil.randomBoolean(), RandomUtil.randomBoolean(), RandomUtil.randomBoolean(), RandomUtil.randomBoolean(), RandomUtil.randomBoolean(), RandomUtil.randomBoolean(), RandomUtil.randomBoolean(), RandomUtil.randomBoolean(), RandomUtil.randomBoolean());
 
       session.createQueue(address, queue, true);
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b7e7492b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/SecurityManagementWithConfiguredAdminUserTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/SecurityManagementWithConfiguredAdminUserTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/SecurityManagementWithConfiguredAdminUserTest.java
index 03c7fc7..bbe97ec 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/SecurityManagementWithConfiguredAdminUserTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/SecurityManagementWithConfiguredAdminUserTest.java
@@ -90,10 +90,10 @@ public class SecurityManagementWithConfiguredAdminUserTest extends SecurityManag
       securityManager.getConfiguration().addRole(invalidAdminUser, "guest");
 
       Set<Role> adminRole = securityRepository.getMatch(ActiveMQDefaultConfiguration.getDefaultManagementAddress().toString());
-      adminRole.add(new Role("admin", true, true, true, true, true, true, true, true, true));
+      adminRole.add(new Role("admin", true, true, true, true, true, true, true, true, true, true));
       securityRepository.addMatch(ActiveMQDefaultConfiguration.getDefaultManagementAddress().toString(), adminRole);
       Set<Role> guestRole = securityRepository.getMatch("*");
-      guestRole.add(new Role("guest", true, true, true, true, true, true, false, true, true));
+      guestRole.add(new Role("guest", true, true, true, true, true, true, false, true, true, true));
       securityRepository.addMatch("*", guestRole);
 
       return server;

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b7e7492b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/SecurityNotificationTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/SecurityNotificationTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/SecurityNotificationTest.java
index 89f03b8..a5f8ec5 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/SecurityNotificationTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/SecurityNotificationTest.java
@@ -88,7 +88,7 @@ public class SecurityNotificationTest extends ActiveMQTestBase {
       SimpleString address = RandomUtil.randomSimpleString();
 
       // guest can not create queue
-      Role role = new Role("roleCanNotCreateQueue", true, true, false, true, false, true, true, true, true);
+      Role role = new Role("roleCanNotCreateQueue", true, true, false, true, false, true, true, true, true, true);
       Set<Role> roles = new HashSet<>();
       roles.add(role);
       server.getSecurityRepository().addMatch(address.toString(), roles);
@@ -136,7 +136,7 @@ public class SecurityNotificationTest extends ActiveMQTestBase {
       securityManager.getConfiguration().addUser("guest", "guest");
       securityManager.getConfiguration().setDefaultUser("guest");
 
-      Role role = new Role("notif", true, true, true, true, true, true, true, true, true);
+      Role role = new Role("notif", true, true, true, true, true, true, true, true, true, true);
       Set<Role> roles = new HashSet<>();
       roles.add(role);
       server.getSecurityRepository().addMatch(ActiveMQDefaultConfiguration.getDefaultManagementNotificationAddress().toString(), roles);

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b7e7492b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/OpenWireTestBase.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/OpenWireTestBase.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/OpenWireTestBase.java
index 52f090d..1465afb 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/OpenWireTestBase.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/OpenWireTestBase.java
@@ -75,23 +75,23 @@ public class OpenWireTestBase extends ActiveMQTestBase {
          securityManager.getConfiguration().addRole("openwireSender", "sender");
          securityManager.getConfiguration().addUser("openwireSender", "SeNdEr");
          //sender cannot receive
-         Role senderRole = new Role("sender", true, false, false, false, true, true, false, false, true);
+         Role senderRole = new Role("sender", true, false, false, false, true, true, false, false, true, true);
 
          securityManager.getConfiguration().addRole("openwireReceiver", "receiver");
          securityManager.getConfiguration().addUser("openwireReceiver", "ReCeIvEr");
          //receiver cannot send
-         Role receiverRole = new Role("receiver", false, true, false, false, true, true, false, true, false);
+         Role receiverRole = new Role("receiver", false, true, false, false, true, true, false, true, false, false);
 
          securityManager.getConfiguration().addRole("openwireGuest", "guest");
          securityManager.getConfiguration().addUser("openwireGuest", "GuEsT");
 
          //guest cannot do anything
-         Role guestRole = new Role("guest", false, false, false, false, false, false, false, false, false);
+         Role guestRole = new Role("guest", false, false, false, false, false, false, false, false, false, false);
 
          securityManager.getConfiguration().addRole("openwireDestinationManager", "manager");
          securityManager.getConfiguration().addUser("openwireDestinationManager", "DeStInAtIoN");
 
-         Role destRole = new Role("manager", false, false, false, false, true, true, false, false, false);
+         Role destRole = new Role("manager", false, false, false, false, true, true, false, false, false, false);
 
          Set<Role> roles = new HashSet<>();
          roles.add(senderRole);

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b7e7492b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/persistence/RolesConfigurationStorageTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/persistence/RolesConfigurationStorageTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/persistence/RolesConfigurationStorageTest.java
index 8f15998..b525e9d 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/persistence/RolesConfigurationStorageTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/persistence/RolesConfigurationStorageTest.java
@@ -50,9 +50,9 @@ public class RolesConfigurationStorageTest extends StorageManagerTestBase {
    public void testStoreSecuritySettings() throws Exception {
       createStorage();
 
-      addSetting(new PersistedRoles("a#", "a1", "a1", "a1", "a1", "a1", "a1", "a1", "a1", "a1"));
+      addSetting(new PersistedRoles("a#", "a1", "a1", "a1", "a1", "a1", "a1", "a1", "a1", "a1", "a1"));
 
-      addSetting(new PersistedRoles("a2", "a1", null, "a1", "a1", "a1", "a1", "a1", "a1", "a1"));
+      addSetting(new PersistedRoles("a2", "a1", null, "a1", "a1", "a1", "a1", "a1", "a1", "a1", "a1"));
 
       journal.stop();
 
@@ -62,9 +62,9 @@ public class RolesConfigurationStorageTest extends StorageManagerTestBase {
 
       checkSettings();
 
-      addSetting(new PersistedRoles("a2", "a1", null, "a1", "a1", "a1", "a1", "a1", "a1", "a1"));
+      addSetting(new PersistedRoles("a2", "a1", null, "a1", "a1", "a1", "a1", "a1", "a1", "a1", "a1"));
 
-      addSetting(new PersistedRoles("a3", "a1", null, "a1", "a1", "a1", "a1", "a1", "a1", "a1"));
+      addSetting(new PersistedRoles("a3", "a1", null, "a1", "a1", "a1", "a1", "a1", "a1", "a1", "a1"));
 
       checkSettings();
 
@@ -92,7 +92,7 @@ public class RolesConfigurationStorageTest extends StorageManagerTestBase {
 
       checkSettings();
 
-      addSetting(new PersistedRoles("a#", "a1", "a1", "a1", "a1", "a1", "a1", "a1", "a1", "a1"));
+      addSetting(new PersistedRoles("a#", "a1", "a1", "a1", "a1", "a1", "a1", "a1", "a1", "a1", "a1"));
 
       journal.stop();
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b7e7492b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ra/ActiveMQMessageHandlerSecurityTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ra/ActiveMQMessageHandlerSecurityTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ra/ActiveMQMessageHandlerSecurityTest.java
index c25d3db..143ec27 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ra/ActiveMQMessageHandlerSecurityTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ra/ActiveMQMessageHandlerSecurityTest.java
@@ -67,7 +67,7 @@ public class ActiveMQMessageHandlerSecurityTest extends ActiveMQRATestBase {
       ActiveMQJAASSecurityManager securityManager = (ActiveMQJAASSecurityManager) server.getSecurityManager();
       securityManager.getConfiguration().addUser("testuser", "testpassword");
       securityManager.getConfiguration().addRole("testuser", "arole");
-      Role role = new Role("arole", false, true, false, false, false, false, false, false, false);
+      Role role = new Role("arole", false, true, false, false, false, false, false, false, false, false);
       Set<Role> roles = new HashSet<>();
       roles.add(role);
       server.getSecurityRepository().addMatch(MDBQUEUEPREFIXED, roles);

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b7e7492b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ra/JMSContextTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ra/JMSContextTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ra/JMSContextTest.java
index 895ebbe..6956499 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ra/JMSContextTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ra/JMSContextTest.java
@@ -57,7 +57,7 @@ public class JMSContextTest extends ActiveMQRATestBase {
       securityManager.getConfiguration().setDefaultUser("guest");
       securityManager.getConfiguration().addRole("testuser", "arole");
       securityManager.getConfiguration().addRole("guest", "arole");
-      Role role = new Role("arole", true, true, true, true, true, true, true, true, true);
+      Role role = new Role("arole", true, true, true, true, true, true, true, true, true, true);
       Set<Role> roles = new HashSet<>();
       roles.add(role);
       server.getSecurityRepository().addMatch(MDBQUEUEPREFIXED, roles);

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b7e7492b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ra/OutgoingConnectionTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ra/OutgoingConnectionTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ra/OutgoingConnectionTest.java
index a96c00e..feed83c 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ra/OutgoingConnectionTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ra/OutgoingConnectionTest.java
@@ -82,7 +82,7 @@ public class OutgoingConnectionTest extends ActiveMQRATestBase {
       securityManager.getConfiguration().setDefaultUser("guest");
       securityManager.getConfiguration().addRole("testuser", "arole");
       securityManager.getConfiguration().addRole("guest", "arole");
-      Role role = new Role("arole", true, true, true, true, true, true, true, true, true);
+      Role role = new Role("arole", true, true, true, true, true, true, true, true, true, true);
       Set<Role> roles = new HashSet<>();
       roles.add(role);
       server.getSecurityRepository().addMatch(MDBQUEUEPREFIXED, roles);

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b7e7492b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ra/OutgoingConnectionTestJTA.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ra/OutgoingConnectionTestJTA.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ra/OutgoingConnectionTestJTA.java
index c85140d..ab32ad3 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ra/OutgoingConnectionTestJTA.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ra/OutgoingConnectionTestJTA.java
@@ -71,7 +71,7 @@ public class OutgoingConnectionTestJTA extends ActiveMQRATestBase {
       ((ActiveMQJAASSecurityManager) server.getSecurityManager()).getConfiguration().setDefaultUser("guest");
       ((ActiveMQJAASSecurityManager) server.getSecurityManager()).getConfiguration().addRole("testuser", "arole");
       ((ActiveMQJAASSecurityManager) server.getSecurityManager()).getConfiguration().addRole("guest", "arole");
-      Role role = new Role("arole", true, true, true, true, true, true, true, true, true);
+      Role role = new Role("arole", true, true, true, true, true, true, true, true, true, true);
       Set<Role> roles = new HashSet<>();
       roles.add(role);
       server.getSecurityRepository().addMatch(MDBQUEUEPREFIXED, roles);

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b7e7492b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/security/LDAPSecurityTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/security/LDAPSecurityTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/security/LDAPSecurityTest.java
index 5bfdc62..caacdd0 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/security/LDAPSecurityTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/security/LDAPSecurityTest.java
@@ -174,7 +174,7 @@ public class LDAPSecurityTest extends AbstractLdapTestUnit {
       final SimpleString NON_DURABLE_QUEUE = new SimpleString("nonDurableQueue");
 
       Set<Role> roles = new HashSet<>();
-      roles.add(new Role("programmers", false, false, false, false, false, false, false, false, false));
+      roles.add(new Role("programmers", false, false, false, false, false, false, false, false, false, false));
       server.getConfiguration().putSecurityRoles("#", roles);
       server.start();
       server.createQueue(ADDRESS, DURABLE_QUEUE, null, true, false);
@@ -260,7 +260,7 @@ public class LDAPSecurityTest extends AbstractLdapTestUnit {
       final SimpleString NON_DURABLE_QUEUE = new SimpleString("nonDurableQueue");
 
       Set<Role> roles = new HashSet<>();
-      roles.add(new Role("admins", true, true, true, true, true, true, true, true, true));
+      roles.add(new Role("admins", true, true, true, true, true, true, true, true, true, true));
       server.getConfiguration().putSecurityRoles("#", roles);
       server.start();
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b7e7492b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/security/SecurityTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/security/SecurityTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/security/SecurityTest.java
index d08afed..2829d80 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/security/SecurityTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/security/SecurityTest.java
@@ -224,7 +224,7 @@ public class SecurityTest extends ActiveMQTestBase {
       ActiveMQJAASSecurityManager securityManager = new ActiveMQJAASSecurityManager("PropertiesLogin");
       ActiveMQServer server = addServer(ActiveMQServers.newActiveMQServer(createDefaultInVMConfig().setSecurityEnabled(true), ManagementFactory.getPlatformMBeanServer(), securityManager, false));
       Set<Role> roles = new HashSet<>();
-      roles.add(new Role("programmers", false, false, false, false, false, false, false, false, false));
+      roles.add(new Role("programmers", false, false, false, false, false, false, false, false, false, false));
       server.getConfiguration().putSecurityRoles("#", roles);
       server.start();
       server.createQueue(ADDRESS, DURABLE_QUEUE, null, true, false);
@@ -309,10 +309,10 @@ public class SecurityTest extends ActiveMQTestBase {
       ActiveMQJAASSecurityManager securityManager = new ActiveMQJAASSecurityManager("PropertiesLogin");
       ActiveMQServer server = addServer(ActiveMQServers.newActiveMQServer(createDefaultInVMConfig().setSecurityEnabled(true), ManagementFactory.getPlatformMBeanServer(), securityManager, false));
       Set<Role> aRoles = new HashSet<>();
-      aRoles.add(new Role(QUEUE_A.toString(), false, true, false, false, false, false, false, false, false));
+      aRoles.add(new Role(QUEUE_A.toString(), false, true, false, false, false, false, false, false, false, false));
       server.getConfiguration().putSecurityRoles(ADDRESS.concat(".").concat(QUEUE_A).toString(), aRoles);
       Set<Role> bRoles = new HashSet<>();
-      bRoles.add(new Role(QUEUE_B.toString(), false, true, false, false, false, false, false, false, false));
+      bRoles.add(new Role(QUEUE_B.toString(), false, true, false, false, false, false, false, false, false, false));
       server.getConfiguration().putSecurityRoles(ADDRESS.concat(".").concat(QUEUE_B).toString(), bRoles);
       server.start();
       server.createQueue(ADDRESS, QUEUE_A, null, true, false);
@@ -375,7 +375,7 @@ public class SecurityTest extends ActiveMQTestBase {
       server.getConfiguration().addAcceptorConfiguration(new TransportConfiguration(NETTY_ACCEPTOR_FACTORY, params));
 
       Set<Role> roles = new HashSet<>();
-      roles.add(new Role("programmers", false, false, false, false, false, false, false, false, false));
+      roles.add(new Role("programmers", false, false, false, false, false, false, false, false, false, false));
       server.getConfiguration().putSecurityRoles("#", roles);
 
       server.start();
@@ -470,7 +470,7 @@ public class SecurityTest extends ActiveMQTestBase {
       ActiveMQJAASSecurityManager securityManager = new ActiveMQJAASSecurityManager("PropertiesLogin");
       ActiveMQServer server = addServer(ActiveMQServers.newActiveMQServer(createDefaultInVMConfig().setSecurityEnabled(true), ManagementFactory.getPlatformMBeanServer(), securityManager, false));
       Set<Role> roles = new HashSet<>();
-      roles.add(new Role("programmers", true, true, true, true, true, true, true, true, true));
+      roles.add(new Role("programmers", true, true, true, true, true, true, true, true, true, true));
       server.getConfiguration().putSecurityRoles("#", roles);
       server.start();
 
@@ -558,7 +558,7 @@ public class SecurityTest extends ActiveMQTestBase {
       server.getConfiguration().addAcceptorConfiguration(new TransportConfiguration(NETTY_ACCEPTOR_FACTORY, params));
 
       Set<Role> roles = new HashSet<>();
-      roles.add(new Role("programmers", true, true, true, true, true, true, true, true, true));
+      roles.add(new Role("programmers", true, true, true, true, true, true, true, true, true, true));
       server.getConfiguration().putSecurityRoles("#", roles);
       server.start();
 
@@ -642,7 +642,7 @@ public class SecurityTest extends ActiveMQTestBase {
       ActiveMQJAASSecurityManager securityManager = new ActiveMQJAASSecurityManager("GuestLogin");
       ActiveMQServer server = addServer(ActiveMQServers.newActiveMQServer(createDefaultInVMConfig().setSecurityEnabled(true), ManagementFactory.getPlatformMBeanServer(), securityManager, false));
       Set<Role> roles = new HashSet<>();
-      roles.add(new Role("bar", true, true, true, true, true, true, true, false, true));
+      roles.add(new Role("bar", true, true, true, true, true, true, true, false, true, true));
       server.getConfiguration().putSecurityRoles("#", roles);
       server.start();
 
@@ -789,7 +789,7 @@ public class SecurityTest extends ActiveMQTestBase {
       HierarchicalRepository<Set<Role>> securityRepository = server.getSecurityRepository();
       ActiveMQJAASSecurityManager securityManager = (ActiveMQJAASSecurityManager) server.getSecurityManager();
       securityManager.getConfiguration().addUser("auser", "pass");
-      Role role = new Role("arole", false, false, true, false, false, false, false, false, false);
+      Role role = new Role("arole", false, false, true, false, false, false, false, false, false, false);
       Set<Role> roles = new HashSet<>();
       roles.add(role);
       securityRepository.addMatch(SecurityTest.addressA, roles);
@@ -808,7 +808,7 @@ public class SecurityTest extends ActiveMQTestBase {
       HierarchicalRepository<Set<Role>> securityRepository = server.getSecurityRepository();
       ActiveMQJAASSecurityManager securityManager = (ActiveMQJAASSecurityManager) server.getSecurityManager();
       securityManager.getConfiguration().addUser("auser", "pass");
-      Role role = new Role("arole", false, false, false, false, false, false, false, false, false);
+      Role role = new Role("arole", false, false, false, false, false, false, false, false, false, false);
       Set<Role> roles = new HashSet<>();
       roles.add(role);
       securityRepository.addMatch(SecurityTest.addressA, roles);
@@ -833,7 +833,7 @@ public class SecurityTest extends ActiveMQTestBase {
       HierarchicalRepository<Set<Role>> securityRepository = server.getSecurityRepository();
       ActiveMQJAASSecurityManager securityManager = (ActiveMQJAASSecurityManager) server.getSecurityManager();
       securityManager.getConfiguration().addUser("auser", "pass");
-      Role role = new Role("arole", false, false, true, true, false, false, false, false, false);
+      Role role = new Role("arole", false, false, true, true, false, false, false, false, false, false);
       Set<Role> roles = new HashSet<>();
       roles.add(role);
       securityRepository.addMatch(SecurityTest.addressA, roles);
@@ -852,7 +852,7 @@ public class SecurityTest extends ActiveMQTestBase {
       HierarchicalRepository<Set<Role>> securityRepository = server.getSecurityRepository();
       ActiveMQJAASSecurityManager securityManager = (ActiveMQJAASSecurityManager) server.getSecurityManager();
       securityManager.getConfiguration().addUser("auser", "pass");
-      Role role = new Role("arole", false, false, true, false, false, false, false, false, false);
+      Role role = new Role("arole", false, false, true, false, false, false, false, false, false, false);
       Set<Role> roles = new HashSet<>();
       roles.add(role);
       securityRepository.addMatch(SecurityTest.addressA, roles);
@@ -879,7 +879,7 @@ public class SecurityTest extends ActiveMQTestBase {
       HierarchicalRepository<Set<Role>> securityRepository = server.getSecurityRepository();
       ActiveMQJAASSecurityManager securityManager = (ActiveMQJAASSecurityManager) server.getSecurityManager();
       securityManager.getConfiguration().addUser("auser", "pass");
-      Role role = new Role("arole", false, false, false, false, true, false, false, false, false);
+      Role role = new Role("arole", false, false, false, false, true, false, false, false, false, false);
       Set<Role> roles = new HashSet<>();
       roles.add(role);
       securityRepository.addMatch(SecurityTest.addressA, roles);
@@ -898,7 +898,7 @@ public class SecurityTest extends ActiveMQTestBase {
       HierarchicalRepository<Set<Role>> securityRepository = server.getSecurityRepository();
       ActiveMQJAASSecurityManager securityManager = (ActiveMQJAASSecurityManager) server.getSecurityManager();
       securityManager.getConfiguration().addUser("auser", "pass");
-      Role role = new Role("arole", false, false, false, false, false, false, false, false, false);
+      Role role = new Role("arole", false, false, false, false, false, false, false, false, false, false);
       Set<Role> roles = new HashSet<>();
       roles.add(role);
       securityRepository.addMatch(SecurityTest.addressA, roles);
@@ -923,7 +923,7 @@ public class SecurityTest extends ActiveMQTestBase {
       HierarchicalRepository<Set<Role>> securityRepository = server.getSecurityRepository();
       ActiveMQJAASSecurityManager securityManager = (ActiveMQJAASSecurityManager) server.getSecurityManager();
       securityManager.getConfiguration().addUser("auser", "pass");
-      Role role = new Role("arole", false, false, false, false, true, true, false, false, false);
+      Role role = new Role("arole", false, false, false, false, true, true, false, false, false, false);
       Set<Role> roles = new HashSet<>();
       roles.add(role);
       securityRepository.addMatch(SecurityTest.addressA, roles);
@@ -942,7 +942,7 @@ public class SecurityTest extends ActiveMQTestBase {
       HierarchicalRepository<Set<Role>> securityRepository = server.getSecurityRepository();
       ActiveMQJAASSecurityManager securityManager = (ActiveMQJAASSecurityManager) server.getSecurityManager();
       securityManager.getConfiguration().addUser("auser", "pass");
-      Role role = new Role("arole", false, false, false, false, true, false, false, false, false);
+      Role role = new Role("arole", false, false, false, false, true, false, false, false, false, false);
       Set<Role> roles = new HashSet<>();
       roles.add(role);
       securityRepository.addMatch(SecurityTest.addressA, roles);
@@ -973,7 +973,7 @@ public class SecurityTest extends ActiveMQTestBase {
 
       securityManager.getConfiguration().addUser("auser", "pass");
 
-      Role role = new Role("arole", true, true, true, false, false, false, false, false, false);
+      Role role = new Role("arole", true, true, true, false, false, false, false, false, false, false);
 
       Set<Role> roles = new HashSet<>();
 
@@ -1005,7 +1005,7 @@ public class SecurityTest extends ActiveMQTestBase {
 
       receivedMessage.acknowledge();
 
-      role = new Role("arole", false, false, true, false, false, false, false, false, false);
+      role = new Role("arole", false, false, true, false, false, false, false, false, false, false);
 
       roles = new HashSet<>();
 
@@ -1032,7 +1032,7 @@ public class SecurityTest extends ActiveMQTestBase {
       HierarchicalRepository<Set<Role>> securityRepository = server.getSecurityRepository();
       ActiveMQJAASSecurityManager securityManager = (ActiveMQJAASSecurityManager) server.getSecurityManager();
       securityManager.getConfiguration().addUser("auser", "pass");
-      Role role = new Role("arole", false, false, true, false, false, false, false, false, false);
+      Role role = new Role("arole", false, false, true, false, false, false, false, false, false, false);
       Set<Role> roles = new HashSet<>();
       roles.add(role);
       securityRepository.addMatch(SecurityTest.addressA, roles);
@@ -1060,7 +1060,7 @@ public class SecurityTest extends ActiveMQTestBase {
       HierarchicalRepository<Set<Role>> securityRepository = server.getSecurityRepository();
       ActiveMQJAASSecurityManager securityManager = (ActiveMQJAASSecurityManager) server.getSecurityManager();
       securityManager.getConfiguration().addUser("auser", "pass");
-      Role role = new Role("arole", false, false, true, false, false, false, false, false, false);
+      Role role = new Role("arole", false, false, true, false, false, false, false, false, false, false);
       Set<Role> roles = new HashSet<>();
       roles.add(role);
       securityRepository.addMatch(SecurityTest.addressA, roles);
@@ -1086,8 +1086,8 @@ public class SecurityTest extends ActiveMQTestBase {
       securityManager.getConfiguration().addUser("guest", "guest");
       securityManager.getConfiguration().addRole("guest", "guest");
       securityManager.getConfiguration().setDefaultUser("guest");
-      Role role = new Role("arole", false, true, false, false, false, false, false, false, false);
-      Role sendRole = new Role("guest", true, false, true, false, false, false, false, false, false);
+      Role role = new Role("arole", false, true, false, false, false, false, false, false, false, false);
+      Role sendRole = new Role("guest", true, false, true, false, false, false, false, false, false, false);
       Set<Role> roles = new HashSet<>();
       roles.add(sendRole);
       roles.add(role);
@@ -1114,8 +1114,8 @@ public class SecurityTest extends ActiveMQTestBase {
       securityManager.getConfiguration().addUser("guest", "guest");
       securityManager.getConfiguration().addRole("guest", "guest");
       securityManager.getConfiguration().setDefaultUser("guest");
-      Role role = new Role("arole", false, false, false, false, false, false, false, false, false);
-      Role sendRole = new Role("guest", true, false, true, false, false, false, false, false, false);
+      Role role = new Role("arole", false, false, false, false, false, false, false, false, false, false);
+      Role sendRole = new Role("guest", true, false, true, false, false, false, false, false, false, false);
       Set<Role> roles = new HashSet<>();
       roles.add(sendRole);
       roles.add(role);
@@ -1149,9 +1149,9 @@ public class SecurityTest extends ActiveMQTestBase {
       securityManager.getConfiguration().addUser("guest", "guest");
       securityManager.getConfiguration().addRole("guest", "guest");
       securityManager.getConfiguration().setDefaultUser("guest");
-      Role role = new Role("arole", false, false, false, false, false, false, false, false, false);
-      Role sendRole = new Role("guest", true, false, true, false, false, false, false, false, false);
-      Role receiveRole = new Role("receiver", false, true, false, false, false, false, false, false, false);
+      Role role = new Role("arole", false, false, false, false, false, false, false, false, false, false);
+      Role sendRole = new Role("guest", true, false, true, false, false, false, false, false, false, false);
+      Role receiveRole = new Role("receiver", false, true, false, false, false, false, false, false, false, false);
       Set<Role> roles = new HashSet<>();
       roles.add(sendRole);
       roles.add(role);
@@ -1198,9 +1198,9 @@ public class SecurityTest extends ActiveMQTestBase {
       securityManager.getConfiguration().addUser("guest", "guest");
       securityManager.getConfiguration().addRole("guest", "guest");
       securityManager.getConfiguration().setDefaultUser("guest");
-      Role role = new Role("arole", false, false, false, false, false, false, false, false, false);
-      Role sendRole = new Role("guest", true, false, true, false, false, false, false, false, false);
-      Role receiveRole = new Role("receiver", false, true, false, false, false, false, false, false, false);
+      Role role = new Role("arole", false, false, false, false, false, false, false, false, false, false);
+      Role sendRole = new Role("guest", true, false, true, false, false, false, false, false, false, false);
+      Role receiveRole = new Role("receiver", false, true, false, false, false, false, false, false, false, false);
       Set<Role> roles = new HashSet<>();
       roles.add(sendRole);
       roles.add(role);
@@ -1254,11 +1254,11 @@ public class SecurityTest extends ActiveMQTestBase {
       securityManager.getConfiguration().addUser("guest", "guest");
       securityManager.getConfiguration().addRole("guest", "guest");
       securityManager.getConfiguration().setDefaultUser("guest");
-      Role role = new Role("arole", false, false, false, false, false, false, false, false, false);
+      Role role = new Role("arole", false, false, false, false, false, false, false, false, false, false);
       System.out.println("guest:" + role);
-      Role sendRole = new Role("guest", true, false, true, false, false, false, false, false, false);
+      Role sendRole = new Role("guest", true, false, true, false, false, false, false, false, false, false);
       System.out.println("guest:" + sendRole);
-      Role receiveRole = new Role("receiver", false, true, false, false, false, false, false, false, false);
+      Role receiveRole = new Role("receiver", false, true, false, false, false, false, false, false, false, false);
       System.out.println("guest:" + receiveRole);
       Set<Role> roles = new HashSet<>();
       roles.add(sendRole);
@@ -1339,7 +1339,7 @@ public class SecurityTest extends ActiveMQTestBase {
       HierarchicalRepository<Set<Role>> securityRepository = server.getSecurityRepository();
       ActiveMQJAASSecurityManager securityManager = (ActiveMQJAASSecurityManager) server.getSecurityManager();
       securityManager.getConfiguration().addUser("auser", "pass");
-      Role role = new Role("arole", false, false, false, false, false, false, true, false, false);
+      Role role = new Role("arole", false, false, false, false, false, false, true, false, false, false);
       Set<Role> roles = new HashSet<>();
       roles.add(role);
       securityRepository.addMatch(configuration.getManagementAddress().toString(), roles);
@@ -1360,7 +1360,7 @@ public class SecurityTest extends ActiveMQTestBase {
       HierarchicalRepository<Set<Role>> securityRepository = server.getSecurityRepository();
       ActiveMQJAASSecurityManager securityManager = (ActiveMQJAASSecurityManager) server.getSecurityManager();
       securityManager.getConfiguration().addUser("auser", "pass");
-      Role role = new Role("arole", false, false, true, false, false, false, false, false, false);
+      Role role = new Role("arole", false, false, true, false, false, false, false, false, false, false);
       Set<Role> roles = new HashSet<>();
       roles.add(role);
       securityRepository.addMatch(configuration.getManagementAddress().toString(), roles);
@@ -1389,7 +1389,7 @@ public class SecurityTest extends ActiveMQTestBase {
       HierarchicalRepository<Set<Role>> securityRepository = server.getSecurityRepository();
       ActiveMQJAASSecurityManager securityManager = (ActiveMQJAASSecurityManager) server.getSecurityManager();
       securityManager.getConfiguration().addUser("auser", "pass");
-      Role role = new Role("arole", false, false, true, false, false, false, false, false, false);
+      Role role = new Role("arole", false, false, true, false, false, false, false, false, false, false);
       Set<Role> roles = new HashSet<>();
       roles.add(role);
       securityRepository.addMatch(configuration.getManagementAddress().toString(), roles);
@@ -1425,23 +1425,23 @@ public class SecurityTest extends ActiveMQTestBase {
       securityManager.getConfiguration().addRole("frank", "user");
       securityManager.getConfiguration().addRole("sam", "news-user");
       securityManager.getConfiguration().addRole("sam", "user");
-      Role all = new Role("all", true, true, true, true, true, true, true, true, true);
+      Role all = new Role("all", true, true, true, true, true, true, true, true, true, true);
       HierarchicalRepository<Set<Role>> repository = server.getSecurityRepository();
       Set<Role> add = new HashSet<>();
-      add.add(new Role("user", true, true, true, true, true, true, false, true, true));
+      add.add(new Role("user", true, true, true, true, true, true, false, true, true, true));
       add.add(all);
       repository.addMatch("#", add);
       Set<Role> add1 = new HashSet<>();
       add1.add(all);
-      add1.add(new Role("user", false, false, true, true, true, true, false, true, true));
-      add1.add(new Role("europe-user", true, false, false, false, false, false, false, true, true));
-      add1.add(new Role("news-user", false, true, false, false, false, false, false, true, true));
+      add1.add(new Role("user", false, false, true, true, true, true, false, true, true, true));
+      add1.add(new Role("europe-user", true, false, false, false, false, false, false, true, true, true));
+      add1.add(new Role("news-user", false, true, false, false, false, false, false, true, true, true));
       repository.addMatch("news.europe.#", add1);
       Set<Role> add2 = new HashSet<>();
       add2.add(all);
-      add2.add(new Role("user", false, false, true, true, true, true, false, true, true));
-      add2.add(new Role("us-user", true, false, false, false, false, false, false, true, true));
-      add2.add(new Role("news-user", false, true, false, false, false, false, false, true, true));
+      add2.add(new Role("user", false, false, true, true, true, true, false, true, true, true));
+      add2.add(new Role("us-user", true, false, false, false, false, false, false, true, true, true));
+      add2.add(new Role("news-user", false, true, false, false, false, false, false, true, true, true));
       repository.addMatch("news.us.#", add2);
       ClientSession billConnection = null;
       ClientSession andrewConnection = null;
@@ -1552,23 +1552,23 @@ public class SecurityTest extends ActiveMQTestBase {
       securityManager.getConfiguration().addRole("frank", "user");
       securityManager.getConfiguration().addRole("sam", "news-user");
       securityManager.getConfiguration().addRole("sam", "user");
-      Role all = new Role("all", true, true, true, true, true, true, true, true, true);
+      Role all = new Role("all", true, true, true, true, true, true, true, true, true, true);
       HierarchicalRepository<Set<Role>> repository = server.getSecurityRepository();
       Set<Role> add = new HashSet<>();
-      add.add(new Role("user", true, true, true, true, true, true, false, true, true));
+      add.add(new Role("user", true, true, true, true, true, true, false, true, true, true));
       add.add(all);
       repository.addMatch("#", add);
       Set<Role> add1 = new HashSet<>();
       add1.add(all);
-      add1.add(new Role("user", false, false, true, true, true, true, false, true, true));
-      add1.add(new Role("europe-user", true, false, false, false, false, false, false, true, true));
-      add1.add(new Role("news-user", false, true, false, false, false, false, false, true, true));
+      add1.add(new Role("user", false, false, true, true, true, true, false, true, true, true));
+      add1.add(new Role("europe-user", true, false, false, false, false, false, false, true, true, true));
+      add1.add(new Role("news-user", false, true, false, false, false, false, false, true, true, true));
       repository.addMatch("news.europe.#", add1);
       Set<Role> add2 = new HashSet<>();
       add2.add(all);
-      add2.add(new Role("user", false, false, true, true, true, true, false, true, true));
-      add2.add(new Role("us-user", true, false, false, false, false, false, false, true, true));
-      add2.add(new Role("news-user", false, true, false, false, false, false, false, true, true));
+      add2.add(new Role("user", false, false, true, true, true, true, false, true, true, true));
+      add2.add(new Role("us-user", true, false, false, false, false, false, false, true, true, true));
+      add2.add(new Role("news-user", false, true, false, false, false, false, false, true, true, true));
       repository.addMatch("news.us.#", add2);
       ClientSession billConnection = null;
       ClientSession andrewConnection = null;

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b7e7492b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/ResourceLimitTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/ResourceLimitTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/ResourceLimitTest.java
index b6ebc12..a672bb1 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/ResourceLimitTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/ResourceLimitTest.java
@@ -59,7 +59,7 @@ public class ResourceLimitTest extends ActiveMQTestBase {
       ActiveMQJAASSecurityManager securityManager = (ActiveMQJAASSecurityManager) server.getSecurityManager();
       securityManager.getConfiguration().addUser("myUser", "password");
       securityManager.getConfiguration().addRole("myUser", "arole");
-      Role role = new Role("arole", false, false, false, false, true, true, false, true, false);
+      Role role = new Role("arole", false, false, false, false, true, true, false, true, false, false);
       Set<Role> roles = new HashSet<>();
       roles.add(role);
       server.getSecurityRepository().addMatch("#", roles);

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b7e7492b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ssl/DualAuthenticationTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ssl/DualAuthenticationTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ssl/DualAuthenticationTest.java
index 6529d9b..6716e45 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ssl/DualAuthenticationTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ssl/DualAuthenticationTest.java
@@ -128,8 +128,8 @@ public class DualAuthenticationTest extends ActiveMQTestBase {
       server = addServer(ActiveMQServers.newActiveMQServer(config, ManagementFactory.getPlatformMBeanServer(), securityManager, false));
 
       HierarchicalRepository<Set<Role>> securityRepository = server.getSecurityRepository();
-      Role sendRole = new Role("producers", true, false, true, false, true, false, false, false, false);
-      Role receiveRole = new Role("consumers", false, true, false, false, false, false, false, false, false);
+      Role sendRole = new Role("producers", true, false, true, false, true, false, false, false, false, false);
+      Role receiveRole = new Role("consumers", false, true, false, false, false, false, false, false, false, false);
       Set<Role> roles = new HashSet<>();
       roles.add(sendRole);
       roles.add(receiveRole);


[09/48] activemq-artemis git commit: Check routing semantics for STOMP senders/subscribers

Posted by jb...@apache.org.
Check routing semantics for STOMP senders/subscribers


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

Branch: refs/heads/ARTEMIS-780
Commit: c756499ccb0b18940c92ab7d15cc1a85e81dd932
Parents: 3020837
Author: jbertram <jb...@apache.com>
Authored: Tue Nov 15 10:27:55 2016 -0600
Committer: jbertram <jb...@apache.com>
Committed: Tue Nov 15 10:38:13 2016 -0600

----------------------------------------------------------------------
 .../protocol/stomp/ActiveMQStompException.java  |  4 +--
 .../ActiveMQStompProtocolMessageBundle.java     |  7 ++--
 .../core/protocol/stomp/StompConnection.java    | 20 ++++++++++--
 .../stomp/VersionedStompFrameHandler.java       |  6 +++-
 .../tests/integration/stomp/StompTest.java      | 34 ++++++++++++++++++++
 .../tests/integration/stomp/StompTestBase.java  |  3 +-
 .../integration/stomp/v11/StompV11Test.java     | 18 -----------
 .../integration/stomp/v12/StompV12Test.java     | 15 ---------
 8 files changed, 65 insertions(+), 42 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/c756499c/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/ActiveMQStompException.java
----------------------------------------------------------------------
diff --git a/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/ActiveMQStompException.java b/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/ActiveMQStompException.java
index 118f7f8..69fa130 100644
--- a/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/ActiveMQStompException.java
+++ b/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/ActiveMQStompException.java
@@ -40,12 +40,12 @@ public class ActiveMQStompException extends Exception {
    }
 
    public ActiveMQStompException(String msg) {
-      super(msg);
+      super(msg.replace(":", ""));
       handler = null;
    }
 
    public ActiveMQStompException(String msg, Throwable t) {
-      super(msg, t);
+      super(msg.replace(":", ""), t);
       this.body = t.getMessage();
       handler = null;
    }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/c756499c/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/ActiveMQStompProtocolMessageBundle.java
----------------------------------------------------------------------
diff --git a/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/ActiveMQStompProtocolMessageBundle.java b/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/ActiveMQStompProtocolMessageBundle.java
index e535725..c1f93e4 100644
--- a/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/ActiveMQStompProtocolMessageBundle.java
+++ b/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/ActiveMQStompProtocolMessageBundle.java
@@ -86,10 +86,10 @@ public interface ActiveMQStompProtocolMessageBundle {
    ActiveMQStompException noDestination();
 
    @Message(id = 339016, value = "Error creating subscription {0}", format = Message.Format.MESSAGE_FORMAT)
-   ActiveMQStompException errorCreatSubscription(String subscriptionID, @Cause Exception e);
+   ActiveMQStompException errorCreatingSubscription(String subscriptionID, @Cause Exception e);
 
    @Message(id = 339017, value = "Error unsubscribing {0}", format = Message.Format.MESSAGE_FORMAT)
-   ActiveMQStompException errorUnsubscrib(String subscriptionID, @Cause Exception e);
+   ActiveMQStompException errorUnsubscribing(String subscriptionID, @Cause Exception e);
 
    @Message(id = 339018, value = "Error acknowledging message {0}", format = Message.Format.MESSAGE_FORMAT)
    ActiveMQStompException errorAck(String messageID, @Cause Exception e);
@@ -150,4 +150,7 @@ public interface ActiveMQStompProtocolMessageBundle {
 
    @Message(id = 339039, value = "No id header in ACK/NACK frame.")
    ActiveMQStompException noIDInAck();
+
+   @Message(id = 339040, value = "Not allowed to specify {0} semantics on {1} address.", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQStompException illegalSemantics(String requested, String exists);
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/c756499c/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompConnection.java
----------------------------------------------------------------------
diff --git a/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompConnection.java b/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompConnection.java
index a6eab6b..eaeb21d 100644
--- a/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompConnection.java
+++ b/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompConnection.java
@@ -256,7 +256,9 @@ public final class StompConnection implements RemotingConnection {
       }
    }
 
-   public void autoCreateDestinationIfPossible(String queue, AddressInfo.RoutingType routingType) throws ActiveMQStompException {
+   public boolean autoCreateDestinationIfPossible(String queue, AddressInfo.RoutingType routingType) throws ActiveMQStompException {
+      boolean result = false;
+
       try {
          if (manager.getServer().getAddressInfo(SimpleString.toSimpleString(queue)) == null) {
             // TODO check here to see if auto-creation is enabled
@@ -266,12 +268,22 @@ public final class StompConnection implements RemotingConnection {
                manager.getServer().createOrUpdateAddressInfo(new AddressInfo(SimpleString.toSimpleString(queue)).setRoutingType(AddressInfo.RoutingType.ANYCAST).setAutoCreated(true));
                manager.getServer().createQueue(SimpleString.toSimpleString(queue), SimpleString.toSimpleString(queue), null, null, true, false, true);
             }
+            result = true;
          }
       } catch (ActiveMQQueueExistsException e) {
          // ignore
       } catch (Exception e) {
          throw new ActiveMQStompException(e.getMessage(), e).setHandler(frameHandler);
       }
+
+      return result;
+   }
+
+   public void checkRoutingSemantics(String destination, AddressInfo.RoutingType routingType) throws ActiveMQStompException {
+      AddressInfo.RoutingType actualRoutingTypeOfAddress = manager.getServer().getAddressInfo(SimpleString.toSimpleString(destination)).getRoutingType();
+      if (routingType != null && !routingType.equals(actualRoutingTypeOfAddress)) {
+         throw BUNDLE.illegalSemantics(routingType.toString(), actualRoutingTypeOfAddress.toString());
+      }
    }
 
    @Override
@@ -629,6 +641,8 @@ public final class StompConnection implements RemotingConnection {
                   boolean noLocal,
                   AddressInfo.RoutingType subscriptionType) throws ActiveMQStompException {
       autoCreateDestinationIfPossible(destination, subscriptionType);
+      checkDestination(destination);
+      checkRoutingSemantics(destination, subscriptionType);
       if (noLocal) {
          String noLocalFilter = CONNECTION_ID_PROP + " <> '" + getID().toString() + "'";
          if (selector == null) {
@@ -657,7 +671,7 @@ public final class StompConnection implements RemotingConnection {
       } catch (ActiveMQStompException e) {
          throw e;
       } catch (Exception e) {
-         throw BUNDLE.errorCreatSubscription(subscriptionID, e).setHandler(frameHandler);
+         throw BUNDLE.errorCreatingSubscription(subscriptionID, e).setHandler(frameHandler);
       }
    }
 
@@ -667,7 +681,7 @@ public final class StompConnection implements RemotingConnection {
       } catch (ActiveMQStompException e) {
          throw e;
       } catch (Exception e) {
-         throw BUNDLE.errorUnsubscrib(subscriptionID, e).setHandler(frameHandler);
+         throw BUNDLE.errorUnsubscribing(subscriptionID, e).setHandler(frameHandler);
       }
    }
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/c756499c/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/VersionedStompFrameHandler.java
----------------------------------------------------------------------
diff --git a/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/VersionedStompFrameHandler.java b/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/VersionedStompFrameHandler.java
index 06af785..580bade 100644
--- a/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/VersionedStompFrameHandler.java
+++ b/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/VersionedStompFrameHandler.java
@@ -172,6 +172,7 @@ public abstract class VersionedStompFrameHandler {
          AddressInfo.RoutingType routingType = getRoutingType(frame.getHeader(Headers.Send.DESTINATION_TYPE), frame.getHeader(Headers.Send.DESTINATION));
          connection.autoCreateDestinationIfPossible(destination, routingType);
          connection.checkDestination(destination);
+         connection.checkRoutingSemantics(destination, routingType);
          String txID = frame.getHeader(Stomp.Headers.TRANSACTION);
 
          long timestamp = System.currentTimeMillis();
@@ -344,12 +345,15 @@ public abstract class VersionedStompFrameHandler {
    }
 
    private AddressInfo.RoutingType getRoutingType(String typeHeader, String destination) {
-      AddressInfo.RoutingType routingType = AddressInfo.RoutingType.ANYCAST; // default
+      // null is valid to return here so we know when the user didn't provide any routing info
+      AddressInfo.RoutingType routingType = null;
       if (typeHeader != null) {
          routingType = AddressInfo.RoutingType.valueOf(typeHeader);
       } else if (destination != null && !connection.getAnycastPrefix().equals(connection.getMulticastPrefix())) {
          if (connection.getMulticastPrefix().length() > 0 && destination.startsWith(connection.getMulticastPrefix())) {
             routingType = AddressInfo.RoutingType.MULTICAST;
+         } else if (connection.getAnycastPrefix().length() > 0 && destination.startsWith(connection.getAnycastPrefix())) {
+            routingType = AddressInfo.RoutingType.ANYCAST;
          }
       }
       return routingType;

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/c756499c/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/StompTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/StompTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/StompTest.java
index 19e9ebe..e7dcc91 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/StompTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/StompTest.java
@@ -1372,4 +1372,38 @@ public class StompTest extends StompTestBase {
 
       conn.disconnect();
    }
+
+   @Test
+   public void testMulticastOperationsOnAnycastAddress() throws Exception {
+      testRoutingSemantics(AddressInfo.RoutingType.MULTICAST.toString(), getQueuePrefix() + getQueueName());
+   }
+
+   @Test
+   public void testAnycastOperationsOnMulticastAddress() throws Exception {
+      testRoutingSemantics(AddressInfo.RoutingType.ANYCAST.toString(), getTopicPrefix() + getTopicName());
+   }
+
+   public void testRoutingSemantics(String routingType, String destination) throws Exception {
+      conn.connect(defUser, defPass);
+
+      String uuid = UUID.randomUUID().toString();
+
+      ClientStompFrame frame = conn.createFrame(Stomp.Commands.SUBSCRIBE)
+                                   .addHeader(Stomp.Headers.Subscribe.SUBSCRIPTION_TYPE, routingType)
+                                   .addHeader(Stomp.Headers.Subscribe.DESTINATION, destination)
+                                   .addHeader(Stomp.Headers.RECEIPT_REQUESTED, uuid);
+
+      frame = conn.sendFrame(frame);
+      assertEquals(Stomp.Responses.ERROR, frame.getCommand());
+
+      uuid = UUID.randomUUID().toString();
+
+      frame = conn.createFrame(Stomp.Commands.SEND)
+                                   .addHeader(Stomp.Headers.Send.DESTINATION_TYPE, AddressInfo.RoutingType.MULTICAST.toString())
+                                   .addHeader(Stomp.Headers.Send.DESTINATION, getQueuePrefix() + getQueueName())
+                                   .addHeader(Stomp.Headers.RECEIPT_REQUESTED, uuid);
+
+      frame = conn.sendFrame(frame);
+      assertEquals(Stomp.Responses.ERROR, frame.getCommand());
+   }
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/c756499c/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/StompTestBase.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/StompTestBase.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/StompTestBase.java
index 278d80e..bcac436 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/StompTestBase.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/StompTestBase.java
@@ -218,7 +218,6 @@ public abstract class StompTestBase extends ActiveMQTestBase {
       MessageProducer producer = session.createProducer(destination);
       TextMessage message = session.createTextMessage(msg);
       producer.send(message);
-      IntegrationTestLogger.LOGGER.info("Sent message from JMS client to: " + destination);
    }
 
    public void sendJmsMessage(byte[] data, Destination destination) throws Exception {
@@ -526,6 +525,8 @@ public abstract class StompTestBase extends ActiveMQTestBase {
          assertEquals(uuid, frame.getHeader(Stomp.Headers.Response.RECEIPT_ID));
       }
 
+      IntegrationTestLogger.LOGGER.info("Received: " + frame);
+
       return frame;
    }
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/c756499c/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/v11/StompV11Test.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/v11/StompV11Test.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/v11/StompV11Test.java
index 7cb02a3..6eb57b2 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/v11/StompV11Test.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/v11/StompV11Test.java
@@ -2128,24 +2128,6 @@ public class StompV11Test extends StompTestBase {
    }
 
    @Test
-   public void testSendMessageToNonExistentQueueWithoutAutoCreation() throws Exception {
-      AddressSettings addressSettings = new AddressSettings();
-      addressSettings.setAutoCreateJmsQueues(false);
-      server.getActiveMQServer().getAddressSettingsRepository().addMatch("#", addressSettings);
-      conn.connect(defUser, defPass);
-
-      String uuid = UUID.randomUUID().toString();
-
-      ClientStompFrame frame = send(conn, "NonExistentQueue" + uuid, null, "Hello World", true, AddressInfo.RoutingType.ANYCAST);
-
-      // TODO fix this test by checking auto-create settings
-      assertTrue(frame.getCommand().equals(Stomp.Responses.ERROR));
-      IntegrationTestLogger.LOGGER.info("message: " + frame.getHeader("message"));
-
-      conn.disconnect();
-   }
-
-   @Test
    public void testSendMessageToNonExistentQueueWithAutoCreation() throws Exception {
       conn.connect(defUser, defPass);
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/c756499c/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/v12/StompV12Test.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/v12/StompV12Test.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/v12/StompV12Test.java
index 0a52714..dc8cea0 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/v12/StompV12Test.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/v12/StompV12Test.java
@@ -2167,21 +2167,6 @@ public class StompV12Test extends StompTestBase {
    }
 
    @Test
-   public void testSendMessageToNonExistentQueueWithoutAutoCreation() throws Exception {
-      AddressSettings addressSettings = new AddressSettings();
-      addressSettings.setAutoCreateJmsQueues(false);
-      server.getActiveMQServer().getAddressSettingsRepository().addMatch("#", addressSettings);
-      conn.connect(defUser, defPass);
-
-      ClientStompFrame frame = send(conn, "NonExistentQueue" + UUID.randomUUID().toString(), null, "Hello World", true, AddressInfo.RoutingType.ANYCAST);
-
-      // TODO this is broken because queue auto-creation is always on
-      assertTrue(frame.getCommand().equals(Stomp.Responses.ERROR));
-
-      waitDisconnect(conn);
-   }
-
-   @Test
    public void testSendMessageToNonExistentQueueWithAutoCreation() throws Exception {
       conn.connect(defUser, defPass);
 


[20/48] activemq-artemis git commit: Fix JMSBridgeTest

Posted by jb...@apache.org.
Fix JMSBridgeTest


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

Branch: refs/heads/ARTEMIS-780
Commit: 493e99900962e9e1cf21cd8fe5a777b18b2605c4
Parents: 4ccfc73
Author: jbertram <jb...@apache.com>
Authored: Tue Nov 15 14:24:38 2016 -0600
Committer: jbertram <jb...@apache.com>
Committed: Wed Nov 23 09:04:34 2016 -0600

----------------------------------------------------------------------
 .../artemis/tests/extras/jms/bridge/BridgeTestBase.java         | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/493e9990/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/jms/bridge/BridgeTestBase.java
----------------------------------------------------------------------
diff --git a/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/jms/bridge/BridgeTestBase.java b/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/jms/bridge/BridgeTestBase.java
index 5e0345f..c47d026 100644
--- a/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/jms/bridge/BridgeTestBase.java
+++ b/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/jms/bridge/BridgeTestBase.java
@@ -506,8 +506,9 @@ public abstract class BridgeTestBase extends ActiveMQTestBase {
          managementService = server1.getManagementService();
       }
       AddressControl topicControl = (AddressControl) managementService.getResource(ResourceNames.ADDRESS + topic.getTopicName());
-      Assert.assertEquals(0, topicControl.getQueueNames().length);
-
+      if (topicControl != null) {
+         Assert.assertEquals(0, topicControl.getQueueNames().length);
+      }
    }
 
    protected void removeAllMessages(final String queueName, final int index) throws Exception {


[48/48] activemq-artemis git commit: Fix SessionTest

Posted by jb...@apache.org.
Fix SessionTest


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

Branch: refs/heads/ARTEMIS-780
Commit: d1b62a501c0ab42c1f628aa6d377fc24c90e90da
Parents: 1f9d47c
Author: jbertram <jb...@apache.com>
Authored: Tue Nov 22 10:18:18 2016 -0600
Committer: jbertram <jb...@apache.com>
Committed: Wed Nov 23 09:04:37 2016 -0600

----------------------------------------------------------------------
 .../org/apache/activemq/artemis/jms/tests/SessionTest.java   | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/d1b62a50/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/SessionTest.java
----------------------------------------------------------------------
diff --git a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/SessionTest.java b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/SessionTest.java
index 1ff79d0..fc3d132 100644
--- a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/SessionTest.java
+++ b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/SessionTest.java
@@ -169,8 +169,8 @@ public class SessionTest extends ActiveMQServerTestCase {
 
    @Test
    public void testCreateNonExistentTopic() throws Exception {
-      getJmsServer().getAddressSettingsRepository().addMatch("#", new AddressSettings().setAutoCreateJmsQueues(false));
-      getJmsServer().getAddressSettingsRepository().addMatch("#", new AddressSettings().setAutoCreateJmsTopics(false));
+      getJmsServer().getAddressSettingsRepository().addMatch("#", new AddressSettings().setAutoCreateQueues(false));
+      getJmsServer().getAddressSettingsRepository().addMatch("#", new AddressSettings().setAutoCreateAddresses(false));
       Connection conn = getConnectionFactory().createConnection();
       Session sess = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
       try {
@@ -198,8 +198,8 @@ public class SessionTest extends ActiveMQServerTestCase {
 
    @Test
    public void testCreateTopicWhileQueueWithSameNameExists() throws Exception {
-      getJmsServer().getAddressSettingsRepository().addMatch("#", new AddressSettings().setAutoCreateJmsQueues(false));
-      getJmsServer().getAddressSettingsRepository().addMatch("#", new AddressSettings().setAutoCreateJmsTopics(false));
+      getJmsServer().getAddressSettingsRepository().addMatch("#", new AddressSettings().setAutoCreateQueues(false));
+      getJmsServer().getAddressSettingsRepository().addMatch("#", new AddressSettings().setAutoCreateAddresses(false));
       Connection conn = getConnectionFactory().createConnection();
       Session sess = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
       try {


[34/48] activemq-artemis git commit: Fix XML parsing for address roles

Posted by jb...@apache.org.
Fix XML parsing for address roles


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

Branch: refs/heads/ARTEMIS-780
Commit: cf47a04c5df0b74f3b661ac2347594ee86ef4ebd
Parents: 07ab200
Author: jbertram <jb...@apache.com>
Authored: Sat Nov 19 09:56:18 2016 -0600
Committer: jbertram <jb...@apache.com>
Committed: Wed Nov 23 09:04:35 2016 -0600

----------------------------------------------------------------------
 .../core/deployers/impl/FileConfigurationParser.java      | 10 ++++++++++
 1 file changed, 10 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/cf47a04c/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 796caf2..2517b10 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
@@ -125,6 +125,10 @@ public final class FileConfigurationParser extends XMLConfigurationUtil {
 
    private static final String BROWSE_NAME = "browse";
 
+   private static final String CREATEADDRESS_NAME = "createAddress";
+
+   private static final String DELETEADDRESS_NAME = "deleteAddress";
+
    // Address parsing
 
    private static final String DEAD_LETTER_ADDRESS_NODE_NAME = "dead-letter-address";
@@ -680,6 +684,8 @@ public final class FileConfigurationParser extends XMLConfigurationUtil {
       ArrayList<String> deleteNonDurableQueue = new ArrayList<>();
       ArrayList<String> manageRoles = new ArrayList<>();
       ArrayList<String> browseRoles = new ArrayList<>();
+      ArrayList<String> createAddressRoles = new ArrayList<>();
+      ArrayList<String> deleteAddressRoles = new ArrayList<>();
       ArrayList<String> allRoles = new ArrayList<>();
       NodeList children = node.getChildNodes();
       for (int i = 0; i < children.getLength(); i++) {
@@ -710,6 +716,10 @@ public final class FileConfigurationParser extends XMLConfigurationUtil {
                   manageRoles.add(role.trim());
                } else if (BROWSE_NAME.equals(type)) {
                   browseRoles.add(role.trim());
+               } else if (CREATEADDRESS_NAME.equals(type)) {
+                  createAddressRoles.add(role.trim());
+               } else if (DELETEADDRESS_NAME.equals(type)) {
+                  deleteAddressRoles.add(role.trim());
                } else {
                   ActiveMQServerLogger.LOGGER.rolePermissionConfigurationError(type);
                }


[45/48] activemq-artemis git commit: Fixing handful of issues

Posted by jb...@apache.org.
Fixing handful of issues


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

Branch: refs/heads/ARTEMIS-780
Commit: fb6793967dc425f3c19dde2a7e9ce4b72f41e943
Parents: 40a5559
Author: jbertram <jb...@apache.com>
Authored: Tue Nov 22 15:07:36 2016 -0600
Committer: jbertram <jb...@apache.com>
Committed: Wed Nov 23 09:04:37 2016 -0600

----------------------------------------------------------------------
 .../src/test/scripts/validate-instalation.sh     |  4 ++--
 .../artemis/jms/client/ActiveMQSession.java      |  1 -
 .../core/server/impl/ActiveMQServerImpl.java     |  6 +++---
 .../server/impl/AutoCreatedQueueManagerImpl.java |  8 +++-----
 artemis-tools/pom.xml                            |  2 +-
 .../integration/amqp/AmqpClientTestSupport.java  |  2 +-
 .../tests/integration/client/SessionTest.java    |  3 ++-
 .../crossprotocol/AMQPToOpenwireTest.java        |  2 +-
 .../crossprotocol/OpenWireToAMQPTest.java        |  2 +-
 .../jms/cluster/AutoCreateQueueClusterTest.java  | 10 ++++------
 .../jms/jms2client/NonExistentQueueTest.java     |  4 ++--
 .../mqtt/imported/MQTTTestSupport.java           |  3 ++-
 .../integration/openwire/OpenWireTestBase.java   |  2 +-
 .../integration/openwire/SimpleOpenWireTest.java | 19 ++++++++++++-------
 .../activemq/artemis/jms/tests/SessionTest.java  |  5 +++--
 15 files changed, 38 insertions(+), 35 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/fb679396/artemis-distribution/src/test/scripts/validate-instalation.sh
----------------------------------------------------------------------
diff --git a/artemis-distribution/src/test/scripts/validate-instalation.sh b/artemis-distribution/src/test/scripts/validate-instalation.sh
index 98449bd..5837739 100755
--- a/artemis-distribution/src/test/scripts/validate-instalation.sh
+++ b/artemis-distribution/src/test/scripts/validate-instalation.sh
@@ -49,7 +49,7 @@ pwd
 sleep 5
 
 ./artemis producer
-./artemis consumer --receive-timeout 10000
+./artemis consumer --receive-timeout 10000 --break-on-null
 
 ./artemis stop
 
@@ -64,7 +64,7 @@ sleep 5
 sleep 5
 
 ./artemis producer
-./artemis consumer --receive-timeout 10000
+./artemis consumer --receive-timeout 10000 --break-on-null
 
 ./artemis-service stop
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/fb679396/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQSession.java
----------------------------------------------------------------------
diff --git a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQSession.java b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQSession.java
index 26a941b..7fc0fb2 100644
--- a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQSession.java
+++ b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQSession.java
@@ -301,7 +301,6 @@ public class ActiveMQSession implements QueueSession, TopicSession {
 
             if (!response.isExists()) {
                if (jbd.isQueue() && response.isAutoCreateJmsQueues()) {
-                  // TODO create queue here in such a way that it is deleted when consumerCount == 0
                   // perhaps just relying on the broker to do it is simplest (i.e. deleteOnNoConsumers)
                   session.createAddress(jbd.getSimpleAddress(), false, true);
                   session.createQueue(jbd.getSimpleAddress(), jbd.getSimpleAddress(), null, true, true);

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/fb679396/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
index a21e5be..b2cd7f8 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
@@ -650,7 +650,7 @@ public class ActiveMQServerImpl implements ActiveMQServer {
          throw ActiveMQMessageBundle.BUNDLE.queueNameIsNull();
       }
 
-      boolean autoCreateJmsQueues = getAddressSettingsRepository().getMatch(name.toString()).isAutoCreateJmsQueues();
+      boolean autoCreateJmsQueues = getAddressSettingsRepository().getMatch(name.toString()).isAutoCreateQueues();
 
       QueueQueryResult response;
 
@@ -1555,7 +1555,7 @@ public class ActiveMQServerImpl implements ActiveMQServer {
    public void destroyQueue(final SimpleString queueName,
                             final SecurityAuth session,
                             final boolean checkConsumerCount) throws Exception {
-      destroyQueue(queueName, session, checkConsumerCount, false, true);
+      destroyQueue(queueName, session, checkConsumerCount, false);
    }
 
    @Override
@@ -1607,7 +1607,7 @@ public class ActiveMQServerImpl implements ActiveMQServer {
 
       if (autoDeleteAddress && postOffice != null) {
          try {
-            postOffice.removeAddressInfo(address);
+            removeAddressInfo(address);
          } catch (ActiveMQDeleteAddressException e) {
             // Could be thrown if the address has bindings or is not deletable.
          }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/fb679396/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/AutoCreatedQueueManagerImpl.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/AutoCreatedQueueManagerImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/AutoCreatedQueueManagerImpl.java
index 8bea315..0a1d09c 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/AutoCreatedQueueManagerImpl.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/AutoCreatedQueueManagerImpl.java
@@ -39,17 +39,15 @@ public class AutoCreatedQueueManagerImpl implements AutoCreatedQueueManager {
          long consumerCount = queue.getConsumerCount();
          long messageCount = queue.getMessageCount();
 
-         // TODO make sure this is the right check
-         if (((queue.isAutoCreated() && settings.isAutoDeleteJmsQueues()) || queue.isDeleteOnNoConsumers()) && queue.getMessageCount() == 0) {
+         if (((queue.isAutoCreated() && settings.isAutoDeleteQueues()) || queue.isDeleteOnNoConsumers()) && queue.getMessageCount() == 0) {
             if (ActiveMQServerLogger.LOGGER.isDebugEnabled()) {
-               ActiveMQServerLogger.LOGGER.debug("deleting auto-created queue \"" + queueName + ".\" consumerCount = " + consumerCount + "; messageCount = " + messageCount + "; isAutoDeleteJmsQueues = " + settings.isAutoDeleteJmsQueues());
+               ActiveMQServerLogger.LOGGER.debug("deleting " + (queue.isAutoCreated() ? "auto-created " : "") + "queue \"" + queueName + ".\" consumerCount = " + consumerCount + "; messageCount = " + messageCount + "; isAutoDeleteQueues = " + settings.isAutoDeleteQueues());
             }
 
-            // TODO handle this exception better
             try {
                server.destroyQueue(queueName, null, true, false);
             } catch (Exception e) {
-               e.printStackTrace();
+               ActiveMQServerLogger.LOGGER.errorRemovingAutoCreatedQueue(e, queueName);
             }
          }
       }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/fb679396/artemis-tools/pom.xml
----------------------------------------------------------------------
diff --git a/artemis-tools/pom.xml b/artemis-tools/pom.xml
index 9ce22fd..b28f3e5 100644
--- a/artemis-tools/pom.xml
+++ b/artemis-tools/pom.xml
@@ -19,7 +19,7 @@
    <parent>
       <groupId>org.apache.activemq</groupId>
       <artifactId>artemis-pom</artifactId>
-      <version>1.5.0-SNAPSHOT</version>
+      <version>2.0.0-SNAPSHOT</version>
    </parent>
 
    <name>ActiveMQ Artemis Tools</name>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/fb679396/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpClientTestSupport.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpClientTestSupport.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpClientTestSupport.java
index d961a71..1e12d4c 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpClientTestSupport.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpClientTestSupport.java
@@ -86,7 +86,7 @@ public class AmqpClientTestSupport extends ActiveMQTestBase {
       ActiveMQServer server = createServer(true, true);
       serverManager = new JMSServerManagerImpl(server);
       Configuration serverConfig = server.getConfiguration();
-      serverConfig.getAddressesSettings().put("#", new AddressSettings().setAutoCreateJmsQueues(true).setDeadLetterAddress(new SimpleString("ActiveMQ.DLQ")));
+      serverConfig.getAddressesSettings().put("#", new AddressSettings().setAutoCreateQueues(true).setAutoCreateAddresses(true).setDeadLetterAddress(new SimpleString("ActiveMQ.DLQ")));
       serverConfig.setSecurityEnabled(false);
       serverManager.start();
       server.start();

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/fb679396/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/SessionTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/SessionTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/SessionTest.java
index 7f97100..b3c7a4c 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/SessionTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/SessionTest.java
@@ -229,7 +229,8 @@ public class SessionTest extends ActiveMQTestBase {
 
    @Test
    public void testQueueQueryNoQ() throws Exception {
-      server.getAddressSettingsRepository().addMatch("#", new AddressSettings().setAutoCreateJmsQueues(false));
+      server.getAddressSettingsRepository().addMatch("#", new AddressSettings().setAutoCreateQueues(false));
+      server.getAddressSettingsRepository().addMatch("#", new AddressSettings().setAutoCreateAddresses(false));
       cf = createSessionFactory(locator);
       ClientSession clientSession = cf.createSession(false, true, true);
       QueueQuery resp = clientSession.queueQuery(new SimpleString(queueName));

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/fb679396/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/crossprotocol/AMQPToOpenwireTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/crossprotocol/AMQPToOpenwireTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/crossprotocol/AMQPToOpenwireTest.java
index 1a0a997..5aafd91 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/crossprotocol/AMQPToOpenwireTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/crossprotocol/AMQPToOpenwireTest.java
@@ -64,7 +64,7 @@ public class AMQPToOpenwireTest extends ActiveMQTestBase {
       server.waitForActivation(10, TimeUnit.SECONDS);
 
       Configuration serverConfig = server.getConfiguration();
-      serverConfig.getAddressesSettings().put("#", new AddressSettings().setAutoCreateJmsQueues(false).setDeadLetterAddress(new SimpleString("ActiveMQ.DLQ")));
+      serverConfig.getAddressesSettings().put("#", new AddressSettings().setAutoCreateQueues(false).setAutoCreateAddresses(false).setDeadLetterAddress(new SimpleString("ActiveMQ.DLQ")));
       serverConfig.setSecurityEnabled(false);
       coreQueue = new SimpleString(queueName);
       server.createQueue(coreQueue, coreQueue, null, false, false);

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/fb679396/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/crossprotocol/OpenWireToAMQPTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/crossprotocol/OpenWireToAMQPTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/crossprotocol/OpenWireToAMQPTest.java
index fc98f13..968a3a7 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/crossprotocol/OpenWireToAMQPTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/crossprotocol/OpenWireToAMQPTest.java
@@ -55,7 +55,7 @@ public class OpenWireToAMQPTest extends ActiveMQTestBase {
       super.setUp();
       server = createServer(true, true);
       Configuration serverConfig = server.getConfiguration();
-      serverConfig.getAddressesSettings().put("#", new AddressSettings().setAutoCreateJmsQueues(false).setDeadLetterAddress(new SimpleString("ActiveMQ.DLQ")));
+      serverConfig.getAddressesSettings().put("#", new AddressSettings().setAutoCreateQueues(false).setAutoCreateAddresses(false).setDeadLetterAddress(new SimpleString("ActiveMQ.DLQ")));
       serverConfig.setSecurityEnabled(false);
       server.start();
       coreQueue = new SimpleString(queueName);

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/fb679396/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/cluster/AutoCreateQueueClusterTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/cluster/AutoCreateQueueClusterTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/cluster/AutoCreateQueueClusterTest.java
index eb3d184..2894c29 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/cluster/AutoCreateQueueClusterTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/cluster/AutoCreateQueueClusterTest.java
@@ -46,8 +46,8 @@ public class AutoCreateQueueClusterTest extends JMSClusteredTestBase {
 
    @Test
    public void testAutoCreate() throws Exception {
-      server1.getAddressSettingsRepository().getMatch("#").setAutoCreateJmsQueues(true).setRedistributionDelay(0);
-      server2.getAddressSettingsRepository().getMatch("#").setAutoCreateJmsQueues(true).setRedistributionDelay(0);
+      server1.getAddressSettingsRepository().getMatch("#").setAutoCreateQueues(true).setAutoCreateAddresses(true).setRedistributionDelay(0);
+      server2.getAddressSettingsRepository().getMatch("#").setAutoCreateQueues(true).setAutoCreateAddresses(true).setRedistributionDelay(0);
       Connection conn1 = cf1.createConnection();
       Connection conn2 = cf2.createConnection();
       conn1.start();
@@ -58,15 +58,13 @@ public class AutoCreateQueueClusterTest extends JMSClusteredTestBase {
 
          Session session2 = conn2.createSession(false, Session.AUTO_ACKNOWLEDGE);
 
-         // TODO the "jms." prefix is required here because the cluster connection only works for queues which start with "jms"
-         MessageProducer prod1 = session1.createProducer(ActiveMQJMSClient.createQueue("jms.myQueue"));
+         MessageProducer prod1 = session1.createProducer(ActiveMQJMSClient.createQueue("myQueue"));
 
          prod1.setDeliveryMode(DeliveryMode.PERSISTENT);
 
          prod1.send(session1.createTextMessage("m1"));
 
-         // TODO the "jms." prefix is required here because the cluster connection only works for queues which start with "jms"
-         MessageConsumer cons2 = session2.createConsumer(ActiveMQJMSClient.createQueue("jms.myQueue"));
+         MessageConsumer cons2 = session2.createConsumer(ActiveMQJMSClient.createQueue("myQueue"));
 
          TextMessage received = (TextMessage) cons2.receive(5000);
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/fb679396/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/jms2client/NonExistentQueueTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/jms2client/NonExistentQueueTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/jms2client/NonExistentQueueTest.java
index 64d2af3..64edd29 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/jms2client/NonExistentQueueTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/jms2client/NonExistentQueueTest.java
@@ -40,8 +40,8 @@ public class NonExistentQueueTest extends JMSTestBase {
 
    @Test
    public void sendToNonExistentDestination() throws Exception {
-      server.getAddressSettingsRepository().addMatch("#", new AddressSettings().setAutoCreateJmsQueues(false));
-      server.getAddressSettingsRepository().addMatch("#", new AddressSettings().setAutoCreateJmsTopics(false));
+      server.getAddressSettingsRepository().addMatch("#", new AddressSettings().setAutoCreateQueues(false));
+      server.getAddressSettingsRepository().addMatch("#", new AddressSettings().setAutoCreateAddresses(false));
       Destination destination = ActiveMQJMSClient.createTopic("DoesNotExist");
       TransportConfiguration transportConfiguration = new TransportConfiguration(InVMConnectorFactory.class.getName());
       ConnectionFactory localConnectionFactory = ActiveMQJMSClient.createConnectionFactoryWithoutHA(JMSFactoryType.CF, transportConfiguration);

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/fb679396/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/imported/MQTTTestSupport.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/imported/MQTTTestSupport.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/imported/MQTTTestSupport.java
index 15cb8b6..877d5a7 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/imported/MQTTTestSupport.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/imported/MQTTTestSupport.java
@@ -132,7 +132,8 @@ public class MQTTTestSupport extends ActiveMQTestBase {
       addMQTTConnector();
       AddressSettings addressSettings = new AddressSettings();
       addressSettings.setMaxSizeBytes(999999999);
-      addressSettings.setAutoCreateJmsQueues(true);
+      addressSettings.setAutoCreateQueues(true);
+      addressSettings.setAutoCreateAddresses(true);
 
       server.getAddressSettingsRepository().addMatch("#", addressSettings);
       server.start();

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/fb679396/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/OpenWireTestBase.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/OpenWireTestBase.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/OpenWireTestBase.java
index 1465afb..ac995c2 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/OpenWireTestBase.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/OpenWireTestBase.java
@@ -64,7 +64,7 @@ public class OpenWireTestBase extends ActiveMQTestBase {
 
       Configuration serverConfig = server.getConfiguration();
 
-      serverConfig.getAddressesSettings().put("#", new AddressSettings().setAutoCreateJmsQueues(false).setDeadLetterAddress(new SimpleString("ActiveMQ.DLQ")));
+      serverConfig.getAddressesSettings().put("#", new AddressSettings().setAutoCreateQueues(false).setAutoCreateAddresses(false).setDeadLetterAddress(new SimpleString("ActiveMQ.DLQ")));
 
       serverConfig.setSecurityEnabled(enableSecurity);
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/fb679396/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/SimpleOpenWireTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/SimpleOpenWireTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/SimpleOpenWireTest.java
index 3842b67..be037ee 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/SimpleOpenWireTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/SimpleOpenWireTest.java
@@ -402,6 +402,13 @@ public class SimpleOpenWireTest extends BasicOpenWireTest {
 
    @Test
    public void testSimpleTempQueue() throws Exception {
+      AddressSettings addressSetting = new AddressSettings();
+      addressSetting.setAutoCreateQueues(true);
+      addressSetting.setAutoCreateAddresses(true);
+
+      String address = "#";
+      server.getAddressSettingsRepository().addMatch(address, addressSetting);
+
       connection.start();
       Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
 
@@ -438,17 +445,13 @@ public class SimpleOpenWireTest extends BasicOpenWireTest {
 
    @Test
    public void testInvalidDestinationExceptionWhenNoQueueExistsOnCreateProducer() throws Exception {
-      AddressSettings addressSetting = new AddressSettings();
-      addressSetting.setAutoCreateJmsQueues(false);
-
-      server.getAddressSettingsRepository().addMatch("foo", addressSetting);
-
       connection.start();
       Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
       Queue queue = session.createQueue("foo");
 
       try {
          session.createProducer(queue);
+         fail("Should have thrown an exception creating a producer here");
       } catch (JMSException expected) {
       }
       session.close();
@@ -457,7 +460,8 @@ public class SimpleOpenWireTest extends BasicOpenWireTest {
    @Test
    public void testAutoDestinationCreationOnProducerSend() throws JMSException {
       AddressSettings addressSetting = new AddressSettings();
-      addressSetting.setAutoCreateJmsQueues(true);
+      addressSetting.setAutoCreateQueues(true);
+      addressSetting.setAutoCreateAddresses(true);
 
       String address = "foo";
       server.getAddressSettingsRepository().addMatch(address, addressSetting);
@@ -479,7 +483,8 @@ public class SimpleOpenWireTest extends BasicOpenWireTest {
    @Test
    public void testAutoDestinationCreationOnConsumer() throws JMSException {
       AddressSettings addressSetting = new AddressSettings();
-      addressSetting.setAutoCreateJmsQueues(true);
+      addressSetting.setAutoCreateQueues(true);
+      addressSetting.setAutoCreateAddresses(true);
 
       String address = "foo";
       server.getAddressSettingsRepository().addMatch(address, addressSetting);

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/fb679396/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/SessionTest.java
----------------------------------------------------------------------
diff --git a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/SessionTest.java b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/SessionTest.java
index fc3d132..c2e700a 100644
--- a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/SessionTest.java
+++ b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/SessionTest.java
@@ -104,7 +104,7 @@ public class SessionTest extends ActiveMQServerTestCase {
    @Test
    public void testCreateNonExistentQueue() throws Exception {
       AddressSettings addressSettings = new AddressSettings();
-      addressSettings.setAutoCreateJmsQueues(false);
+      addressSettings.setAutoCreateQueues(false);
       getJmsServer().getAddressSettingsRepository().addMatch("#", addressSettings);
 
       Connection conn = getConnectionFactory().createConnection();
@@ -134,7 +134,8 @@ public class SessionTest extends ActiveMQServerTestCase {
    @Test
    public void testCreateQueueWhileTopicWithSameNameExists() throws Exception {
       AddressSettings addressSettings = new AddressSettings();
-      addressSettings.setAutoCreateJmsQueues(false);
+      addressSettings.setAutoCreateQueues(false);
+      addressSettings.setAutoCreateAddresses(false);
       getJmsServer().getAddressSettingsRepository().addMatch("#", addressSettings);
 
       Connection conn = getConnectionFactory().createConnection();


[39/48] activemq-artemis git commit: Fix AddressCommandTest

Posted by jb...@apache.org.
Fix AddressCommandTest


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

Branch: refs/heads/ARTEMIS-780
Commit: 2244463982429bd53ee2a0e11eb53d30da480021
Parents: 5a4a4c9
Author: jbertram <jb...@apache.com>
Authored: Mon Nov 21 17:06:02 2016 -0600
Committer: jbertram <jb...@apache.com>
Committed: Wed Nov 23 09:04:36 2016 -0600

----------------------------------------------------------------------
 .../impl/ActiveMQServerControlImpl.java           | 18 ++++++++++++------
 .../core/server/impl/ActiveMQServerImpl.java      | 10 +++-------
 2 files changed, 15 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/22444639/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/ActiveMQServerControlImpl.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/ActiveMQServerControlImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/ActiveMQServerControlImpl.java
index e5ad233..f8880fc 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/ActiveMQServerControlImpl.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/ActiveMQServerControlImpl.java
@@ -787,12 +787,18 @@ public class ActiveMQServerControlImpl extends AbstractControl implements Active
 
    @Override
    public String getAddressInfo(String address) throws ActiveMQAddressDoesNotExistException {
-      AddressInfo addressInfo = server.getAddressInfo(SimpleString.toSimpleString(address));
-      if (addressInfo == null) {
-//         throw ActiveMQMessageBundle.BUNDLE.addressDoesNotExist(SimpleString.toSimpleString(address));
-         return null;
-      } else {
-         return addressInfo.toString();
+      checkStarted();
+
+      clearIO();
+      try {
+         AddressInfo addressInfo = server.getAddressInfo(SimpleString.toSimpleString(address));
+         if (addressInfo == null) {
+            throw ActiveMQMessageBundle.BUNDLE.addressDoesNotExist(SimpleString.toSimpleString(address));
+         } else {
+            return addressInfo.toString();
+         }
+      } finally {
+         blockOnIO();
       }
    }
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/22444639/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
index 16dccbb..990e2e0 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
@@ -2271,11 +2271,6 @@ public class ActiveMQServerImpl implements ActiveMQServer {
       if (putAddressInfoIfAbsent(addressInfo) != null) {
          throw ActiveMQMessageBundle.BUNDLE.addressAlreadyExists(addressInfo.getName());
       }
-
-      // TODO: is this the right way to do this?
-      long txID = storageManager.generateID();
-      storageManager.addAddressBinding(txID, addressInfo);
-      storageManager.commitBindings(txID);
    }
 
    @Override
@@ -2292,13 +2287,14 @@ public class ActiveMQServerImpl implements ActiveMQServer {
 
    @Override
    public void removeAddressInfo(SimpleString address) throws Exception {
+      AddressInfo addressInfo = getAddressInfo(address);
       if (postOffice.removeAddressInfo(address) == null) {
          throw ActiveMQMessageBundle.BUNDLE.addressDoesNotExist(address);
       }
 
-      // TODO: is this the right way to do this?
+      // TODO: is this the right way to do this? Should it use a transaction?
       long txID = storageManager.generateID();
-      storageManager.deleteAddressBinding(txID, getAddressInfo(address).getId());
+      storageManager.deleteAddressBinding(txID, addressInfo.getId());
       storageManager.commitBindings(txID);
    }
 


[46/48] activemq-artemis git commit: Fix MessageProducerTest

Posted by jb...@apache.org.
Fix MessageProducerTest


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

Branch: refs/heads/ARTEMIS-780
Commit: 1f9d47cb4ad60c06e0d2bb4663604f310e80c9a8
Parents: bcb011d
Author: jbertram <jb...@apache.com>
Authored: Tue Nov 22 10:13:43 2016 -0600
Committer: jbertram <jb...@apache.com>
Committed: Wed Nov 23 09:04:37 2016 -0600

----------------------------------------------------------------------
 .../apache/activemq/artemis/jms/tests/MessageProducerTest.java   | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/1f9d47cb/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/MessageProducerTest.java
----------------------------------------------------------------------
diff --git a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/MessageProducerTest.java b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/MessageProducerTest.java
index fc97cd4..d001f5b 100644
--- a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/MessageProducerTest.java
+++ b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/MessageProducerTest.java
@@ -339,8 +339,8 @@ public class MessageProducerTest extends JMSTestCase {
 
    @Test
    public void testCreateProducerOnInexistentDestination() throws Exception {
-      getJmsServer().getAddressSettingsRepository().addMatch("#", new AddressSettings().setAutoCreateJmsQueues(false));
-      getJmsServer().getAddressSettingsRepository().addMatch("#", new AddressSettings().setAutoCreateJmsTopics(false));
+      getJmsServer().getAddressSettingsRepository().addMatch("#", new AddressSettings().setAutoCreateQueues(false));
+      getJmsServer().getAddressSettingsRepository().addMatch("#", new AddressSettings().setAutoCreateAddresses(false));
       Connection pconn = createConnection();
       try {
          Session ps = pconn.createSession(false, Session.AUTO_ACKNOWLEDGE);


[07/48] activemq-artemis git commit: Fix AutoCreateJmsDestinationTest

Posted by jb...@apache.org.
Fix AutoCreateJmsDestinationTest


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

Branch: refs/heads/ARTEMIS-780
Commit: 3bd57057b630bbf1ace1d3a84d7c1b1c1367edf2
Parents: 5686114
Author: jbertram <jb...@apache.com>
Authored: Mon Nov 14 16:31:11 2016 -0600
Committer: jbertram <jb...@apache.com>
Committed: Tue Nov 15 10:36:43 2016 -0600

----------------------------------------------------------------------
 .../apache/activemq/artemis/jms/client/ActiveMQSession.java | 2 +-
 .../integration/client/AutoCreateJmsDestinationTest.java    | 9 +++++----
 2 files changed, 6 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3bd57057/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQSession.java
----------------------------------------------------------------------
diff --git a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQSession.java b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQSession.java
index c115614..e0cef1d 100644
--- a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQSession.java
+++ b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQSession.java
@@ -660,7 +660,7 @@ public class ActiveMQSession implements QueueSession, TopicSession {
             AddressQuery response = session.addressQuery(dest.getSimpleAddress());
 
             if (!response.isExists()) {
-               if (response.isAutoCreateJmsQueues()) {
+               if (response.isAutoCreateJmsTopics()) {
                   session.createAddress(dest.getSimpleAddress(), true, true);
                } else {
                   throw new InvalidDestinationException("Topic " + dest.getName() + " does not exist");

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3bd57057/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/AutoCreateJmsDestinationTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/AutoCreateJmsDestinationTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/AutoCreateJmsDestinationTest.java
index 5094eba..006bef1 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/AutoCreateJmsDestinationTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/AutoCreateJmsDestinationTest.java
@@ -28,6 +28,7 @@ import java.util.Set;
 import java.util.UUID;
 
 import org.apache.activemq.artemis.api.core.SimpleString;
+import org.apache.activemq.artemis.api.core.management.ResourceNames;
 import org.apache.activemq.artemis.api.jms.ActiveMQJMSClient;
 import org.apache.activemq.artemis.core.security.Role;
 import org.apache.activemq.artemis.core.server.Queue;
@@ -144,7 +145,7 @@ public class AutoCreateJmsDestinationTest extends JMSTestBase {
 
       connection.close();
 
-      assertNotNull(server.getManagementService().getResource("core.address.test"));
+      assertNotNull(server.getManagementService().getResource(ResourceNames.ADDRESS + "test"));
    }
 
    @Test
@@ -181,11 +182,11 @@ public class AutoCreateJmsDestinationTest extends JMSTestBase {
       connection.start();
       assertNotNull(consumer.receive(500));
 
-      assertNotNull(server.getManagementService().getResource("core.address." + topicName));
+      assertNotNull(server.getManagementService().getResource(ResourceNames.ADDRESS + topicName));
 
       connection.close();
 
-      assertNull(server.getManagementService().getResource("core.address." + topicName));
+      assertNull(server.getManagementService().getResource(ResourceNames.ADDRESS + topicName));
    }
 
    @Test
@@ -204,7 +205,7 @@ public class AutoCreateJmsDestinationTest extends JMSTestBase {
 
       connection.close();
 
-      assertNotNull(server.getManagementService().getResource("core.address.test"));
+      assertNotNull(server.getManagementService().getResource(ResourceNames.ADDRESS + "test"));
 
       assertNotNull(server.locateQueue(SimpleString.toSimpleString("myClientID.myDurableSub")));
    }


[18/48] activemq-artemis git commit: Checkstyle, etc.

Posted by jb...@apache.org.
Checkstyle, etc.


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

Branch: refs/heads/ARTEMIS-780
Commit: dd1a9ccd78526033af5f1b4d87b3463cfab62966
Parents: 3a8552d
Author: jbertram <jb...@apache.com>
Authored: Wed Nov 16 11:33:28 2016 -0600
Committer: jbertram <jb...@apache.com>
Committed: Wed Nov 23 09:04:34 2016 -0600

----------------------------------------------------------------------
 .../apache/activemq/artemis/cli/commands/AbstractAction.java    | 1 -
 .../activemq/artemis/cli/commands/address/CreateAddress.java    | 1 -
 .../activemq/artemis/cli/commands/address/ShowAddress.java      | 3 +--
 .../artemis/core/management/impl/ActiveMQServerControlImpl.java | 5 +----
 .../activemq/artemis/core/postoffice/impl/PostOfficeImpl.java   | 2 +-
 .../org/apache/activemq/artemis/core/server/ActiveMQServer.java | 1 -
 .../activemq/artemis/core/server/impl/ActiveMQServerImpl.java   | 2 +-
 .../artemis/tests/integration/cli/AddressCommandTest.java       | 4 ----
 .../artemis/tests/integration/cli/QueueCommandTest.java         | 4 ++--
 9 files changed, 6 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd1a9ccd/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/AbstractAction.java
----------------------------------------------------------------------
diff --git a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/AbstractAction.java b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/AbstractAction.java
index b4dbba8..3619ed7 100644
--- a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/AbstractAction.java
+++ b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/AbstractAction.java
@@ -16,7 +16,6 @@
  */
 package org.apache.activemq.artemis.cli.commands;
 
-import io.airlift.airline.Option;
 import org.apache.activemq.artemis.api.core.client.ActiveMQClient;
 import org.apache.activemq.artemis.api.core.client.ClientMessage;
 import org.apache.activemq.artemis.api.core.client.ClientRequestor;

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd1a9ccd/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/address/CreateAddress.java
----------------------------------------------------------------------
diff --git a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/address/CreateAddress.java b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/address/CreateAddress.java
index 6c92dc6..86aafaf 100644
--- a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/address/CreateAddress.java
+++ b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/address/CreateAddress.java
@@ -23,7 +23,6 @@ import org.apache.activemq.artemis.api.core.client.ClientMessage;
 import org.apache.activemq.artemis.api.core.management.ManagementHelper;
 import org.apache.activemq.artemis.cli.commands.AbstractAction;
 import org.apache.activemq.artemis.cli.commands.ActionContext;
-import org.apache.activemq.artemis.core.server.impl.AddressInfo;
 
 @Command(name = "create", description = "create an address")
 public class CreateAddress extends AbstractAction {

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd1a9ccd/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/address/ShowAddress.java
----------------------------------------------------------------------
diff --git a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/address/ShowAddress.java b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/address/ShowAddress.java
index 34331bb..013b504 100644
--- a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/address/ShowAddress.java
+++ b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/address/ShowAddress.java
@@ -46,8 +46,7 @@ public class ShowAddress extends AbstractAction {
          public void setUpInvocation(ClientMessage message) throws Exception {
             if (bindings) {
                ManagementHelper.putOperationInvocation(message, "broker", "listBindingsForAddress", getName());
-            }
-            else {
+            } else {
                ManagementHelper.putOperationInvocation(message, "broker", "getAddressInfo", getName());
             }
          }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd1a9ccd/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/ActiveMQServerControlImpl.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/ActiveMQServerControlImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/ActiveMQServerControlImpl.java
index c38b2cf..b70abdc 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/ActiveMQServerControlImpl.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/ActiveMQServerControlImpl.java
@@ -67,7 +67,6 @@ import org.apache.activemq.artemis.core.postoffice.Binding;
 import org.apache.activemq.artemis.core.postoffice.Bindings;
 import org.apache.activemq.artemis.core.postoffice.DuplicateIDCache;
 import org.apache.activemq.artemis.core.postoffice.PostOffice;
-import org.apache.activemq.artemis.core.postoffice.QueueBinding;
 import org.apache.activemq.artemis.core.postoffice.impl.LocalQueueBinding;
 import org.apache.activemq.artemis.core.remoting.server.RemotingService;
 import org.apache.activemq.artemis.core.security.CheckType;
@@ -75,7 +74,6 @@ import org.apache.activemq.artemis.core.security.Role;
 import org.apache.activemq.artemis.core.server.ActiveMQMessageBundle;
 import org.apache.activemq.artemis.core.server.ActiveMQServer;
 import org.apache.activemq.artemis.core.server.ActiveMQServerLogger;
-import org.apache.activemq.artemis.core.server.BindingQueryResult;
 import org.apache.activemq.artemis.core.server.ConnectorServiceFactory;
 import org.apache.activemq.artemis.core.server.Consumer;
 import org.apache.activemq.artemis.core.server.JournalType;
@@ -792,8 +790,7 @@ public class ActiveMQServerControlImpl extends AbstractControl implements Active
       AddressInfo addressInfo = server.getAddressInfo(SimpleString.toSimpleString(address));
       if (addressInfo == null) {
          throw ActiveMQMessageBundle.BUNDLE.addressDoesNotExist(SimpleString.toSimpleString(address));
-      }
-      else {
+      } else {
          return addressInfo.toString();
       }
    }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd1a9ccd/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 3064363..fbb6385 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
@@ -132,7 +132,7 @@ public class PostOfficeImpl implements PostOffice, NotificationListener, Binding
 
    private final ActiveMQServer server;
 
-   private Object addressLock = new Object();
+   private final Object addressLock = new Object();
 
    public PostOfficeImpl(final ActiveMQServer server,
                          final StorageManager storageManager,

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd1a9ccd/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQServer.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQServer.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQServer.java
index c45be50..c0f1b97 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQServer.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQServer.java
@@ -22,7 +22,6 @@ import java.util.Set;
 import java.util.concurrent.ScheduledExecutorService;
 import java.util.concurrent.TimeUnit;
 
-import com.google.common.collect.Queues;
 import org.apache.activemq.artemis.api.core.SimpleString;
 import org.apache.activemq.artemis.core.config.BridgeConfiguration;
 import org.apache.activemq.artemis.core.config.Configuration;

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd1a9ccd/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
index 5ab6ef7..b0d61ad 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
@@ -2290,7 +2290,7 @@ public class ActiveMQServerImpl implements ActiveMQServer {
    public void removeAddressInfo(SimpleString address) throws Exception {
       if (postOffice.removeAddressInfo(address) == null) {
          throw ActiveMQMessageBundle.BUNDLE.addressDoesNotExist(address);
-      };
+      }
 
       // TODO: is this the right way to do this?
       //      long txID = storageManager.generateID();

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd1a9ccd/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cli/AddressCommandTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cli/AddressCommandTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cli/AddressCommandTest.java
index 9589f47..4fceaef 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cli/AddressCommandTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cli/AddressCommandTest.java
@@ -18,7 +18,6 @@ package org.apache.activemq.artemis.tests.integration.cli;
 
 import java.io.ByteArrayOutputStream;
 import java.io.PrintStream;
-import java.util.UUID;
 
 import org.apache.activemq.artemis.api.core.SimpleString;
 import org.apache.activemq.artemis.cli.commands.AbstractAction;
@@ -26,10 +25,7 @@ import org.apache.activemq.artemis.cli.commands.ActionContext;
 import org.apache.activemq.artemis.cli.commands.address.CreateAddress;
 import org.apache.activemq.artemis.cli.commands.address.DeleteAddress;
 import org.apache.activemq.artemis.cli.commands.address.ShowAddress;
-import org.apache.activemq.artemis.cli.commands.queue.CreateQueue;
-import org.apache.activemq.artemis.cli.commands.queue.DeleteQueue;
 import org.apache.activemq.artemis.core.config.DivertConfiguration;
-import org.apache.activemq.artemis.core.server.Queue;
 import org.apache.activemq.artemis.core.server.impl.AddressInfo;
 import org.apache.activemq.artemis.tests.util.JMSTestBase;
 import org.junit.Before;

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd1a9ccd/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cli/QueueCommandTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cli/QueueCommandTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cli/QueueCommandTest.java
index 5d7a695..9bddb8c 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cli/QueueCommandTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cli/QueueCommandTest.java
@@ -51,7 +51,7 @@ public class QueueCommandTest extends JMSTestBase {
       CreateQueue command = new CreateQueue();
       command.setName(queueName);
       command.execute(new ActionContext(System.in, new PrintStream(output), new PrintStream(error)));
-      checkExecutionFailure(command, "AMQ119203: Address Does Not Exist:");;
+      checkExecutionFailure(command, "AMQ119203: Address Does Not Exist:");
       assertFalse(server.queueQuery(new SimpleString(queueName)).isExists());
    }
 
@@ -74,7 +74,7 @@ public class QueueCommandTest extends JMSTestBase {
    @Test
    public void testCreateCoreQueueAddressExists() throws Exception {
       String queueName = "queue";
-      String address= "address";
+      String address = "address";
 
       CreateQueue command = new CreateQueue();
       command.setName(queueName);


[40/48] activemq-artemis git commit: Fix TemporaryQueueClusterTest

Posted by jb...@apache.org.
Fix TemporaryQueueClusterTest


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

Branch: refs/heads/ARTEMIS-780
Commit: ef8848246125d825aaa6c79430218edf484305c3
Parents: 2244463
Author: jbertram <jb...@apache.com>
Authored: Mon Nov 21 17:09:00 2016 -0600
Committer: jbertram <jb...@apache.com>
Committed: Wed Nov 23 09:04:36 2016 -0600

----------------------------------------------------------------------
 .../tests/integration/jms/cluster/TemporaryQueueClusterTest.java  | 3 +--
 .../apache/activemq/artemis/tests/util/JMSClusteredTestBase.java  | 2 --
 2 files changed, 1 insertion(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ef884824/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/cluster/TemporaryQueueClusterTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/cluster/TemporaryQueueClusterTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/cluster/TemporaryQueueClusterTest.java
index c26cb85..ae3a93a 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/cluster/TemporaryQueueClusterTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/cluster/TemporaryQueueClusterTest.java
@@ -28,8 +28,7 @@ import org.junit.Test;
 
 public class TemporaryQueueClusterTest extends JMSClusteredTestBase {
 
-   // TODO had to prefix this with "jms." to deal with cluster connection address match
-   public static final String QUEUE_NAME = "jms.target";
+   public static final String QUEUE_NAME = "target";
 
    // Constants -----------------------------------------------------
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ef884824/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/util/JMSClusteredTestBase.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/util/JMSClusteredTestBase.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/util/JMSClusteredTestBase.java
index 30fdfd4..ac52d02 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/util/JMSClusteredTestBase.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/util/JMSClusteredTestBase.java
@@ -175,8 +175,6 @@ public class JMSClusteredTestBase extends ActiveMQTestBase {
                                                                    .addConnectorConfiguration(destinationLabel, new TransportConfiguration(InVMConnectorFactory.class.getName(), generateInVMParams(destination)))
                                                                    .addConnectorConfiguration(sourceLabel, new TransportConfiguration(InVMConnectorFactory.class.getName(), generateInVMParams(source)))
                                                                    .addClusterConfiguration(new ClusterConnectionConfiguration().setName(destinationLabel)
-                                                                                                                                // TODO should this be changed?
-                                                                                                                                .setAddress("jms")
                                                                                                                                 .setConnectorName(sourceLabel)
                                                                                                                                 .setRetryInterval(250)
                                                                                                                                 .setMaxHops(MAX_HOPS)


[15/48] activemq-artemis git commit: CLI WORK

Posted by jb...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/bd4b7cec/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cli/DestinationCommandTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cli/DestinationCommandTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cli/DestinationCommandTest.java
deleted file mode 100644
index a9266ef..0000000
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cli/DestinationCommandTest.java
+++ /dev/null
@@ -1,226 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.activemq.artemis.tests.integration.cli;
-
-import java.io.ByteArrayOutputStream;
-import java.io.PrintStream;
-import java.util.Map;
-
-import org.apache.activemq.artemis.api.core.SimpleString;
-import org.apache.activemq.artemis.cli.commands.ActionContext;
-import org.apache.activemq.artemis.cli.commands.destination.CreateDestination;
-import org.apache.activemq.artemis.cli.commands.destination.DeleteDestination;
-import org.apache.activemq.artemis.cli.commands.destination.DestinationAction;
-import org.apache.activemq.artemis.core.filter.Filter;
-import org.apache.activemq.artemis.core.postoffice.Binding;
-import org.apache.activemq.artemis.tests.util.JMSTestBase;
-import org.junit.Before;
-import org.junit.Test;
-
-public class DestinationCommandTest extends JMSTestBase {
-
-   //the command
-   private ByteArrayOutputStream output;
-   private ByteArrayOutputStream error;
-
-   @Before
-   @Override
-   public void setUp() throws Exception {
-      super.setUp();
-      this.output = new ByteArrayOutputStream(1024);
-      this.error = new ByteArrayOutputStream(1024);
-   }
-
-   @Test
-   public void testCreateJmsQueue() throws Exception {
-      CreateDestination command = new CreateDestination();
-      command.setName("jmsQueue1");
-      command.setBindings("jmsQueue1Binding");
-      command.execute(new ActionContext(System.in, new PrintStream(output), new PrintStream(error)));
-      checkExecutionResult(command);
-   }
-
-   @Test
-   public void testDeleteJmsQueue() throws Exception {
-      CreateDestination command = new CreateDestination();
-      command.setName("jmsQueue1");
-      command.setBindings("jmsQueue1Binding");
-      command.execute(new ActionContext());
-
-      DeleteDestination delete = new DeleteDestination();
-      delete.setName("jmsQueue1");
-      delete.execute(new ActionContext(System.in, new PrintStream(output), new PrintStream(error)));
-      checkExecutionResult(delete);
-   }
-
-   @Test
-   public void testDeleteNonExistJmsQueue() throws Exception {
-      DeleteDestination delete = new DeleteDestination();
-      delete.setName("jmsQueue1NotExist");
-      delete.execute(new ActionContext(System.in, new PrintStream(output), new PrintStream(error)));
-      checkExecutionResult(delete);
-   }
-
-   @Test
-   public void testCreateJmsQueueWithFilter() throws Exception {
-      CreateDestination command = new CreateDestination();
-      command.setName("jmsQueue2");
-      command.setBindings("jmsQueue2Binding");
-      command.setFilter("color='red'");
-      command.execute(new ActionContext(System.in, new PrintStream(output), new PrintStream(error)));
-      checkExecutionResult(command);
-      assertTrue(checkBindingExists(command, "color='red'"));
-   }
-
-   @Test
-   public void testCreateJmsTopic() throws Exception {
-      CreateDestination command = new CreateDestination();
-      command.setDestType(DestinationAction.JMS_TOPIC);
-      command.setName("jmsTopic1");
-      command.setBindings("jmsTopic1Binding");
-      command.execute(new ActionContext(System.in, new PrintStream(output), new PrintStream(error)));
-      checkExecutionResult(command);
-   }
-
-   @Test
-   public void testDeleteJmsTopic() throws Exception {
-      CreateDestination command = new CreateDestination();
-      command.setDestType(DestinationAction.JMS_TOPIC);
-      command.setName("jmsTopic1");
-      command.setBindings("jmsTopic1Binding");
-      command.execute(new ActionContext());
-
-      DeleteDestination delete = new DeleteDestination();
-      delete.setDestType(DestinationAction.JMS_TOPIC);
-      delete.setName("jmsTopic1");
-      delete.execute(new ActionContext(System.in, new PrintStream(output), new PrintStream(error)));
-      checkExecutionResult(delete);
-   }
-
-   @Test
-   public void testDeleteJmsTopicNotExist() throws Exception {
-      DeleteDestination delete = new DeleteDestination();
-      delete.setDestType(DestinationAction.JMS_TOPIC);
-      delete.setName("jmsTopic1NotExist");
-      delete.execute(new ActionContext(System.in, new PrintStream(output), new PrintStream(error)));
-      checkExecutionResult(delete);
-   }
-
-   @Test
-   public void testCreateCoreQueue() throws Exception {
-      CreateDestination command = new CreateDestination();
-      command.setDestType(DestinationAction.CORE_QUEUE);
-      command.setName("coreQueue1");
-      command.execute(new ActionContext(System.in, new PrintStream(output), new PrintStream(error)));
-      checkExecutionResult(command);
-   }
-
-   @Test
-   public void testCreateCoreQueueWithFilter() throws Exception {
-      CreateDestination command = new CreateDestination();
-      command.setName("coreQueue2");
-      command.setDestType(DestinationAction.CORE_QUEUE);
-      command.setFilter("color='green'");
-      command.execute(new ActionContext(System.in, new PrintStream(output), new PrintStream(error)));
-      checkExecutionResult(command);
-   }
-
-   @Test
-   public void testDeleteCoreQueue() throws Exception {
-      CreateDestination command = new CreateDestination();
-      command.setName("coreQueue2");
-      command.setDestType(DestinationAction.CORE_QUEUE);
-      command.setFilter("color='green'");
-      command.execute(new ActionContext());
-
-      DeleteDestination delete = new DeleteDestination();
-      delete.setName("coreQueue2");
-      delete.setDestType(DestinationAction.CORE_QUEUE);
-      delete.execute(new ActionContext(System.in, new PrintStream(output), new PrintStream(error)));
-      checkExecutionResult(delete);
-   }
-
-   @Test
-   public void testDeleteCoreQueueNotExist() throws Exception {
-      DeleteDestination delete = new DeleteDestination();
-      delete.setName("coreQueue2NotExist");
-      delete.setDestType(DestinationAction.CORE_QUEUE);
-      delete.execute(new ActionContext(System.in, new PrintStream(output), new PrintStream(error)));
-      checkExecutionResult(delete);
-   }
-
-   private boolean isCreateCommand(DestinationAction command) {
-      return command instanceof CreateDestination;
-   }
-
-   private boolean isJms(DestinationAction command) {
-      String destType = command.getDestType();
-      return !DestinationAction.CORE_QUEUE.equals(destType);
-   }
-
-   private boolean isTopic(DestinationAction command) {
-      String destType = command.getDestType();
-      return DestinationAction.JMS_TOPIC.equals(destType);
-   }
-
-   private void checkExecutionResult(DestinationAction command) throws Exception {
-      if (isCreateCommand(command)) {
-         String fullMessage = output.toString();
-         System.out.println("output: " + fullMessage);
-         assertTrue(fullMessage, fullMessage.contains("successfully"));
-         assertTrue(checkBindingExists(command, null));
-      } else {
-         if (command.getName().equals("jmsQueue1") || command.getName().equals("coreQueue2") || command.getName().equals("jmsTopic1")) {
-            String fullMessage = output.toString();
-            System.out.println("output: " + fullMessage);
-            assertTrue(fullMessage, fullMessage.contains("successfully"));
-            assertFalse(checkBindingExists(command, null));
-         } else {
-            String errorMessage = error.toString();
-            System.out.println("error: " + errorMessage);
-            assertTrue(errorMessage, errorMessage.contains("Failed to"));
-            assertFalse(checkBindingExists(command, null));
-         }
-      }
-   }
-
-   private boolean checkBindingExists(DestinationAction command, String filter) {
-      String bindingKey = command.getName();
-      if (isJms(command)) {
-         if (isTopic(command)) {
-//            bindingKey = bindingKey;
-         } else {
-//            bindingKey = bindingKey;
-         }
-      }
-      Map<SimpleString, Binding> bindings = server.getPostOffice().getAllBindings();
-      System.out.println("bindings: " + bindings);
-      Binding binding = bindings.get(new SimpleString(bindingKey));
-      System.out.println("got binding: " + binding);
-      if (binding == null) {
-         System.out.println("No bindings for " + bindingKey);
-         return false;
-      }
-      if (filter != null) {
-         Filter bindingFilter = binding.getFilter();
-         assertNotNull(bindingFilter);
-         assertEquals(filter, bindingFilter.getFilterString().toString());
-      }
-      return true;
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/bd4b7cec/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cli/DummyServerConsumer.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cli/DummyServerConsumer.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cli/DummyServerConsumer.java
new file mode 100644
index 0000000..d79b444
--- /dev/null
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cli/DummyServerConsumer.java
@@ -0,0 +1,204 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.activemq.artemis.tests.integration.cli;
+
+import java.util.List;
+
+import org.apache.activemq.artemis.core.filter.Filter;
+import org.apache.activemq.artemis.core.server.HandleStatus;
+import org.apache.activemq.artemis.core.server.MessageReference;
+import org.apache.activemq.artemis.core.server.Queue;
+import org.apache.activemq.artemis.core.server.ServerConsumer;
+import org.apache.activemq.artemis.core.server.SlowConsumerDetectionListener;
+import org.apache.activemq.artemis.core.transaction.Transaction;
+
+public class DummyServerConsumer implements ServerConsumer {
+
+   @Override
+   public void setlowConsumerDetection(SlowConsumerDetectionListener listener) {
+
+   }
+
+   @Override
+   public SlowConsumerDetectionListener getSlowConsumerDetecion() {
+      return null;
+   }
+
+   @Override
+   public void fireSlowConsumer() {
+
+   }
+
+   @Override
+   public Object getProtocolData() {
+      return null;
+   }
+
+   @Override
+   public void setProtocolData(Object protocolData) {
+
+   }
+
+   @Override
+   public void setProtocolContext(Object protocolContext) {
+
+   }
+
+   @Override
+   public Object getProtocolContext() {
+      return null;
+   }
+
+   @Override
+   public long getID() {
+      return 0;
+   }
+
+   @Override
+   public Object getConnectionID() {
+      return null;
+   }
+
+   @Override
+   public void close(boolean failed) throws Exception {
+
+   }
+
+   @Override
+   public void removeItself() throws Exception {
+
+   }
+
+   @Override
+   public List<MessageReference> cancelRefs(boolean failed,
+                                            boolean lastConsumedAsDelivered,
+                                            Transaction tx) throws Exception {
+      return null;
+   }
+
+   @Override
+   public void setStarted(boolean started) {
+
+   }
+
+   @Override
+   public void receiveCredits(int credits) {
+
+   }
+
+   @Override
+   public Queue getQueue() {
+      return null;
+   }
+
+   @Override
+   public MessageReference removeReferenceByID(long messageID) throws Exception {
+      return null;
+   }
+
+   @Override
+   public void backToDelivering(MessageReference reference) {
+
+   }
+
+   @Override
+   public List<MessageReference> getDeliveringReferencesBasedOnProtocol(boolean remove,
+                                                                        Object protocolDataStart,
+                                                                        Object protocolDataEnd) {
+      return null;
+   }
+
+   @Override
+   public void acknowledge(Transaction tx, long messageID) throws Exception {
+
+   }
+
+   @Override
+   public void individualAcknowledge(Transaction tx, long messageID) throws Exception {
+
+   }
+
+   @Override
+   public void individualCancel(long messageID, boolean failed) throws Exception {
+
+   }
+
+   @Override
+   public void forceDelivery(long sequence) {
+
+   }
+
+   @Override
+   public void setTransferring(boolean transferring) {
+
+   }
+
+   @Override
+   public boolean isBrowseOnly() {
+      return false;
+   }
+
+   @Override
+   public long getCreationTime() {
+      return 0;
+   }
+
+   @Override
+   public String getSessionID() {
+      return null;
+   }
+
+   @Override
+   public void promptDelivery() {
+
+   }
+
+   @Override
+   public HandleStatus handle(MessageReference reference) throws Exception {
+      return null;
+   }
+
+   @Override
+   public void proceedDeliver(MessageReference reference) throws Exception {
+
+   }
+
+   @Override
+   public Filter getFilter() {
+      return null;
+   }
+
+   @Override
+   public List<MessageReference> getDeliveringMessages() {
+      return null;
+   }
+
+   @Override
+   public String debug() {
+      return null;
+   }
+
+   @Override
+   public String toManagementString() {
+      return null;
+   }
+
+   @Override
+   public void disconnect() {
+
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/bd4b7cec/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cli/QueueCommandTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cli/QueueCommandTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cli/QueueCommandTest.java
new file mode 100644
index 0000000..9d63439
--- /dev/null
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cli/QueueCommandTest.java
@@ -0,0 +1,227 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.activemq.artemis.tests.integration.cli;
+
+import java.io.ByteArrayOutputStream;
+import java.io.PrintStream;
+import java.util.UUID;
+
+import org.apache.activemq.artemis.api.core.SimpleString;
+import org.apache.activemq.artemis.cli.commands.ActionContext;
+import org.apache.activemq.artemis.cli.commands.queue.CreateQueue;
+import org.apache.activemq.artemis.cli.commands.queue.DeleteQueue;
+import org.apache.activemq.artemis.cli.commands.queue.QueueAction;
+import org.apache.activemq.artemis.core.server.Queue;
+import org.apache.activemq.artemis.core.server.impl.AddressInfo;
+import org.apache.activemq.artemis.tests.util.JMSTestBase;
+import org.junit.Before;
+import org.junit.Test;
+
+public class QueueCommandTest extends JMSTestBase {
+
+   //the command
+   private ByteArrayOutputStream output;
+   private ByteArrayOutputStream error;
+
+   @Before
+   @Override
+   public void setUp() throws Exception {
+      super.setUp();
+      this.output = new ByteArrayOutputStream(1024);
+      this.error = new ByteArrayOutputStream(1024);
+   }
+
+   @Test
+   public void testCreateCoreQueueShowsErrorWhenAddressDoesNotExists() throws Exception {
+      String queueName = "queue1";
+      CreateQueue command = new CreateQueue();
+      command.setName(queueName);
+      command.execute(new ActionContext(System.in, new PrintStream(output), new PrintStream(error)));
+      checkExecutionFailure(command, "AMQ119203: Address Does Not Exist:");;
+      assertFalse(server.queueQuery(new SimpleString(queueName)).isExists());
+   }
+
+   @Test
+   public void testCreateCoreQueueAutoCreateAddressDefaultAddress() throws Exception {
+      String queueName = UUID.randomUUID().toString();
+      CreateQueue command = new CreateQueue();
+      command.setName(queueName);
+      command.setAutoCreateAddress(true);
+      command.execute(new ActionContext(System.in, new PrintStream(output), new PrintStream(error)));
+      checkExecutionPassed(command);
+      assertNotNull(server.getAddressInfo(new SimpleString(queueName)));
+
+      Queue queue = server.locateQueue(new SimpleString(queueName));
+      assertEquals(-1, queue.getMaxConsumers());
+      assertEquals(false, queue.isDeleteOnNoConsumers());
+      assertTrue(server.queueQuery(new SimpleString(queueName)).isExists());
+   }
+
+   @Test
+   public void testCreateCoreQueueAddressExists() throws Exception {
+      String queueName = "queue";
+      String address= "address";
+
+      CreateQueue command = new CreateQueue();
+      command.setName(queueName);
+      command.setAutoCreateAddress(false);
+      command.setAddress(address);
+
+      server.createOrUpdateAddressInfo(new AddressInfo(new SimpleString(address)));
+
+      command.execute(new ActionContext(System.in, new PrintStream(output), new PrintStream(error)));
+      checkExecutionPassed(command);
+      assertNotNull(server.getAddressInfo(new SimpleString(address)));
+
+      Queue queue = server.locateQueue(new SimpleString(queueName));
+      assertEquals(-1, queue.getMaxConsumers());
+      assertEquals(false, queue.isDeleteOnNoConsumers());
+      assertTrue(server.queueQuery(new SimpleString(queueName)).isExists());
+   }
+
+   @Test
+   public void testCreateCoreQueueWithFilter() throws Exception {
+      String queueName = "queue2";
+      String filerString = "color='green'";
+
+      CreateQueue command = new CreateQueue();
+      command.setName(queueName);
+      command.setFilter("color='green'");
+      command.setAutoCreateAddress(true);
+      command.execute(new ActionContext(System.in, new PrintStream(output), new PrintStream(error)));
+
+      checkExecutionPassed(command);
+      Queue queue = server.locateQueue(new SimpleString(queueName));
+      assertNotNull(queue);
+      assertEquals(new SimpleString(filerString), queue.getFilter().getFilterString());
+   }
+
+   @Test
+   public void testCreateQueueAlreadyExists() throws Exception {
+      String queueName = "queue2";
+      String filerString = "color='green'";
+
+      CreateQueue command = new CreateQueue();
+      command.setName(queueName);
+      command.setFilter("color='green'");
+      command.setAutoCreateAddress(true);
+      command.execute(new ActionContext());
+      command.execute(new ActionContext(System.in, new PrintStream(output), new PrintStream(error)));
+      checkExecutionFailure(command, "AMQ119019: Queue already exists " + queueName);
+   }
+
+   @Test
+   public void testDeleteCoreQueue() throws Exception {
+      SimpleString queueName = new SimpleString("deleteQueue");
+
+      CreateQueue command = new CreateQueue();
+      command.setName(queueName.toString());
+      command.setFilter("color='green'");
+      command.setAutoCreateAddress(true);
+      command.execute(new ActionContext());
+
+      DeleteQueue delete = new DeleteQueue();
+      delete.setName(queueName.toString());
+      delete.execute(new ActionContext(System.in, new PrintStream(output), new PrintStream(error)));
+      checkExecutionPassed(delete);
+
+      assertFalse(server.queueQuery(queueName).isExists());
+   }
+
+   @Test
+   public void testDeleteQueueDoesNotExist() throws Exception {
+      SimpleString queueName = new SimpleString("deleteQueue");
+
+      DeleteQueue delete = new DeleteQueue();
+      delete.setName(queueName.toString());
+      delete.execute(new ActionContext(System.in, new PrintStream(output), new PrintStream(error)));
+      checkExecutionFailure(delete, "AMQ119017: Queue " + queueName + " does not exist");
+
+      assertFalse(server.queueQuery(queueName).isExists());
+   }
+
+   @Test
+   public void testDeleteQueueWithConsumersFails() throws Exception {
+      SimpleString queueName = new SimpleString("deleteQueue");
+
+      CreateQueue command = new CreateQueue();
+      command.setName(queueName.toString());
+      command.setFilter("color='green'");
+      command.setAutoCreateAddress(true);
+      command.execute(new ActionContext());
+
+      server.locateQueue(queueName).addConsumer(new DummyServerConsumer());
+
+      DeleteQueue delete = new DeleteQueue();
+      delete.setName(queueName.toString());
+      delete.execute(new ActionContext(System.in, new PrintStream(output), new PrintStream(error)));
+      checkExecutionFailure(delete, "AMQ119025: Cannot delete queue " + queueName + " on binding deleteQueue");
+   }
+
+   @Test
+   public void testDeleteQueueWithConsumersFailsAndRemoveConsumersTrue() throws Exception {
+      SimpleString queueName = new SimpleString("deleteQueue");
+
+      CreateQueue command = new CreateQueue();
+      command.setName(queueName.toString());
+      command.setFilter("color='green'");
+      command.setAutoCreateAddress(true);
+      command.execute(new ActionContext());
+
+      server.locateQueue(queueName).addConsumer(new DummyServerConsumer());
+
+      DeleteQueue delete = new DeleteQueue();
+      delete.setName(queueName.toString());
+      delete.setRemoveConsumers(true);
+      delete.execute(new ActionContext(System.in, new PrintStream(output), new PrintStream(error)));
+      checkExecutionPassed(command);
+   }
+
+   @Test
+   public void testAutoDeleteAddress() throws Exception {
+      SimpleString queueName = new SimpleString("deleteQueue");
+
+      CreateQueue command = new CreateQueue();
+      command.setName(queueName.toString());
+      command.setFilter("color='green'");
+      command.setAutoCreateAddress(true);
+      command.execute(new ActionContext());
+      assertNotNull(server.getAddressInfo(queueName));
+
+      server.locateQueue(queueName).addConsumer(new DummyServerConsumer());
+
+      DeleteQueue delete = new DeleteQueue();
+      delete.setName(queueName.toString());
+      delete.setRemoveConsumers(true);
+      delete.setAutoDeleteAddress(true);
+      delete.execute(new ActionContext(System.in, new PrintStream(output), new PrintStream(error)));
+      checkExecutionPassed(command);
+      assertNull(server.getAddressInfo(queueName));
+   }
+
+   private void checkExecutionPassed(QueueAction command) throws Exception {
+      String fullMessage = output.toString();
+      System.out.println("output: " + fullMessage);
+      assertTrue(fullMessage, fullMessage.contains("successfully"));
+   }
+
+   private void checkExecutionFailure(QueueAction command, String message) throws Exception {
+      String fullMessage = error.toString();
+      System.out.println("error: " + fullMessage);
+      assertTrue(fullMessage, fullMessage.contains(message));
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/bd4b7cec/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlUsingCoreTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlUsingCoreTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlUsingCoreTest.java
index ad36598..bac0784 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlUsingCoreTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlUsingCoreTest.java
@@ -122,6 +122,17 @@ public class ActiveMQServerControlUsingCoreTest extends ActiveMQServerControlTes
          }
 
          @Override
+         public void createQueue(@Parameter(name = "address", desc = "Address of the queue") String address,
+                                 @Parameter(name = "name", desc = "Name of the queue") String name,
+                                 @Parameter(name = "filter", desc = "Filter of the queue") String filter,
+                                 @Parameter(name = "durable", desc = "Is the queue durable?") boolean durable,
+                                 @Parameter(name = "maxConsumers", desc = "The maximum number of consumers allowed on this queue at any one time") int maxConsumers,
+                                 @Parameter(name = "deleteOnNoConsumers", desc = "Delete this queue when the last consumer disconnects") boolean deleteOnNoConsumers,
+                                 @Parameter(name = "autoCreateAddress", desc = "Create an address with default values should a matching address not be found") boolean autoCreateAddress) throws Exception {
+
+         }
+
+         @Override
          public void deployQueue(final String address,
                                  final String name,
                                  final String filter,

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/bd4b7cec/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/imported/MQTTTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/imported/MQTTTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/imported/MQTTTest.java
index 00d220b..3095cb5 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/imported/MQTTTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/imported/MQTTTest.java
@@ -1628,7 +1628,7 @@ public class MQTTTest extends MQTTTestSupport {
          addressInfo.setDefaultMaxQueueConsumers(0);
          getServer().createOrUpdateAddressInfo(addressInfo);
 
-         getServer().createQueue(coreAddress, new SimpleString(clientId + "." + coreAddress), null, false, true, 0, false);
+         getServer().createQueue(coreAddress, new SimpleString(clientId + "." + coreAddress), null, false, true, 0, false, false);
 
          MQTT mqtt = createMQTTConnection();
          mqtt.setClientId(clientId);
@@ -1674,7 +1674,7 @@ public class MQTTTest extends MQTTTestSupport {
       try {
          String clientId = "testMqtt";
          SimpleString coreAddress = new SimpleString("foo.bar");
-         getServer().createQueue(coreAddress, new SimpleString(clientId + "." + coreAddress), null, false, true, -1, true);
+         getServer().createQueue(coreAddress, new SimpleString(clientId + "." + coreAddress), null, false, true, -1, true, false);
 
          Topic[] mqttSubscription = new Topic[]{new Topic("foo/bar", QoS.AT_LEAST_ONCE)};
 


[35/48] activemq-artemis git commit: Use timeout on script to prevent hang

Posted by jb...@apache.org.
Use timeout on script to prevent hang


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

Branch: refs/heads/ARTEMIS-780
Commit: 20433fd2207ddcb2f96e3b9ab518135a93d44c4c
Parents: 62a5cfd
Author: jbertram <jb...@apache.com>
Authored: Mon Nov 21 09:55:21 2016 -0600
Committer: jbertram <jb...@apache.com>
Committed: Wed Nov 23 09:04:36 2016 -0600

----------------------------------------------------------------------
 artemis-distribution/src/test/scripts/validate-instalation.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/20433fd2/artemis-distribution/src/test/scripts/validate-instalation.sh
----------------------------------------------------------------------
diff --git a/artemis-distribution/src/test/scripts/validate-instalation.sh b/artemis-distribution/src/test/scripts/validate-instalation.sh
index 85773a4..98449bd 100755
--- a/artemis-distribution/src/test/scripts/validate-instalation.sh
+++ b/artemis-distribution/src/test/scripts/validate-instalation.sh
@@ -49,7 +49,7 @@ pwd
 sleep 5
 
 ./artemis producer
-./artemis consumer
+./artemis consumer --receive-timeout 10000
 
 ./artemis stop
 
@@ -64,7 +64,7 @@ sleep 5
 sleep 5
 
 ./artemis producer
-./artemis consumer
+./artemis consumer --receive-timeout 10000
 
 ./artemis-service stop
 


[38/48] activemq-artemis git commit: Generic controls for auto queue/address creation

Posted by jb...@apache.org.
Generic controls for auto queue/address creation


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

Branch: refs/heads/ARTEMIS-780
Commit: aefdc671f900c392fa6ff37eeb78f0c1906cb424
Parents: 20433fd
Author: jbertram <jb...@apache.com>
Authored: Mon Nov 21 16:23:27 2016 -0600
Committer: jbertram <jb...@apache.com>
Committed: Wed Nov 23 09:04:36 2016 -0600

----------------------------------------------------------------------
 .../core/management/ActiveMQServerControl.java  |  30 ++++
 artemis-features/src/main/resources/artemis.xml |   4 +-
 .../deployers/impl/FileConfigurationParser.java |  16 ++
 .../impl/ActiveMQServerControlImpl.java         |  62 ++++++-
 .../core/settings/impl/AddressSettings.java     | 165 +++++++++++++++++--
 .../resources/schema/artemis-configuration.xsd  |  43 ++++-
 .../core/settings/AddressSettingsTest.java      |   8 +-
 .../resources/ConfigurationTest-full-config.xml |   8 +
 docs/user-manual/en/queue-attributes.md         |  32 +++-
 .../ActiveMQServerControlUsingCoreTest.java     |  37 ++++-
 .../src/test/resources/reload-test-jms.xml      |   2 +-
 .../test/resources/reload-test-updated-jms.xml  |   2 +-
 12 files changed, 375 insertions(+), 34 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/aefdc671/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/ActiveMQServerControl.java
----------------------------------------------------------------------
diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/ActiveMQServerControl.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/ActiveMQServerControl.java
index b658508..33584bf 100644
--- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/ActiveMQServerControl.java
+++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/ActiveMQServerControl.java
@@ -849,6 +849,36 @@ public interface ActiveMQServerControl {
                            @Parameter(desc = "allow auto-created queues to be deleted automatically", name = "autoDeleteJmsQueues") boolean autoDeleteJmsQueues,
                            @Parameter(desc = "allow topics to be created automatically", name = "autoCreateJmsTopics") boolean autoCreateJmsTopics,
                            @Parameter(desc = "allow auto-created topics to be deleted automatically", name = "autoDeleteJmsTopics") boolean autoDeleteJmsTopics) throws Exception;
+   /**
+    * adds a new address setting for a specific address
+    */
+   @Operation(desc = "Add address settings for addresses matching the addressMatch", impact = MBeanOperationInfo.ACTION)
+   void addAddressSettings(@Parameter(desc = "an address match", name = "addressMatch") String addressMatch,
+                           @Parameter(desc = "the dead letter address setting", name = "DLA") String DLA,
+                           @Parameter(desc = "the expiry address setting", name = "expiryAddress") String expiryAddress,
+                           @Parameter(desc = "the expiry delay setting", name = "expiryDelay") long expiryDelay,
+                           @Parameter(desc = "are any queues created for this address a last value queue", name = "lastValueQueue") boolean lastValueQueue,
+                           @Parameter(desc = "the delivery attempts", name = "deliveryAttempts") int deliveryAttempts,
+                           @Parameter(desc = "the max size in bytes", name = "maxSizeBytes") long maxSizeBytes,
+                           @Parameter(desc = "the page size in bytes", name = "pageSizeBytes") int pageSizeBytes,
+                           @Parameter(desc = "the max number of pages in the soft memory cache", name = "pageMaxCacheSize") int pageMaxCacheSize,
+                           @Parameter(desc = "the redelivery delay", name = "redeliveryDelay") long redeliveryDelay,
+                           @Parameter(desc = "the redelivery delay multiplier", name = "redeliveryMultiplier") double redeliveryMultiplier,
+                           @Parameter(desc = "the maximum redelivery delay", name = "maxRedeliveryDelay") long maxRedeliveryDelay,
+                           @Parameter(desc = "the redistribution delay", name = "redistributionDelay") long redistributionDelay,
+                           @Parameter(desc = "do we send to the DLA when there is no where to route the message", name = "sendToDLAOnNoRoute") boolean sendToDLAOnNoRoute,
+                           @Parameter(desc = "the policy to use when the address is full", name = "addressFullMessagePolicy") String addressFullMessagePolicy,
+                           @Parameter(desc = "when a consumer falls below this threshold in terms of messages consumed per second it will be considered 'slow'", name = "slowConsumerThreshold") long slowConsumerThreshold,
+                           @Parameter(desc = "how often (in seconds) to check for slow consumers", name = "slowConsumerCheckPeriod") long slowConsumerCheckPeriod,
+                           @Parameter(desc = "the policy to use when a slow consumer is detected", name = "slowConsumerPolicy") String slowConsumerPolicy,
+                           @Parameter(desc = "allow jms queues to be created automatically", name = "autoCreateJmsQueues") boolean autoCreateJmsQueues,
+                           @Parameter(desc = "allow auto-created jms queues to be deleted automatically", name = "autoDeleteJmsQueues") boolean autoDeleteJmsQueues,
+                           @Parameter(desc = "allow jms topics to be created automatically", name = "autoCreateJmsTopics") boolean autoCreateJmsTopics,
+                           @Parameter(desc = "allow auto-created jms topics to be deleted automatically", name = "autoDeleteJmsTopics") boolean autoDeleteJmsTopics,
+                           @Parameter(desc = "allow queues to be created automatically", name = "autoCreateQueues") boolean autoCreateQueues,
+                           @Parameter(desc = "allow auto-created queues to be deleted automatically", name = "autoDeleteQueues") boolean autoDeleteQueues,
+                           @Parameter(desc = "allow topics to be created automatically", name = "autoCreateAddresses") boolean autoCreateAddresses,
+                           @Parameter(desc = "allow auto-created topics to be deleted automatically", name = "autoDeleteAddresses") boolean autoDeleteAddresses) throws Exception;
 
    void removeAddressSettings(String addressMatch) throws Exception;
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/aefdc671/artemis-features/src/main/resources/artemis.xml
----------------------------------------------------------------------
diff --git a/artemis-features/src/main/resources/artemis.xml b/artemis-features/src/main/resources/artemis.xml
index fc1cdcc..7a51dc2 100644
--- a/artemis-features/src/main/resources/artemis.xml
+++ b/artemis-features/src/main/resources/artemis.xml
@@ -80,6 +80,8 @@ under the License.
             <permission type="deleteNonDurableQueue" roles="manager"/>
             <permission type="createDurableQueue" roles="manager"/>
             <permission type="deleteDurableQueue" roles="manager"/>
+            <permission type="createAddress" roles="manager"/>
+            <permission type="deleteAddress" roles="manager"/>
             <permission type="consume" roles="manager"/>
             <permission type="send" roles="manager"/>
             <!-- we need this otherwise ./artemis data imp wouldn't work -->
@@ -97,7 +99,7 @@ under the License.
             <max-size-bytes>-1</max-size-bytes>
             <message-counter-history-day-limit>10</message-counter-history-day-limit>
             <address-full-policy>PAGE</address-full-policy>
-            <auto-create-jms-queues>true</auto-create-jms-queues>
+            <auto-create-queues>true</auto-create-queues>
          </address-setting>
       </address-settings>
    </core>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/aefdc671/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 2517b10..08e65e2 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
@@ -175,6 +175,14 @@ public final class FileConfigurationParser extends XMLConfigurationUtil {
 
    private static final String AUTO_DELETE_JMS_TOPICS = "auto-delete-jms-topics";
 
+   private static final String AUTO_CREATE_QUEUES = "auto-create-queues";
+
+   private static final String AUTO_DELETE_QUEUES = "auto-delete-queues";
+
+   private static final String AUTO_CREATE_ADDRESSES = "auto-create-addresses";
+
+   private static final String AUTO_DELETE_ADDRESSES = "auto-delete-addresses";
+
    private static final String MANAGEMENT_BROWSE_PAGE_SIZE = "management-browse-page-size";
 
    private static final String MAX_CONNECTIONS_NODE_NAME = "max-connections";
@@ -836,6 +844,14 @@ public final class FileConfigurationParser extends XMLConfigurationUtil {
             addressSettings.setAutoCreateJmsTopics(XMLUtil.parseBoolean(child));
          } else if (AUTO_DELETE_JMS_TOPICS.equalsIgnoreCase(name)) {
             addressSettings.setAutoDeleteJmsTopics(XMLUtil.parseBoolean(child));
+         } else if (AUTO_CREATE_QUEUES.equalsIgnoreCase(name)) {
+            addressSettings.setAutoCreateQueues(XMLUtil.parseBoolean(child));
+         } else if (AUTO_DELETE_QUEUES.equalsIgnoreCase(name)) {
+            addressSettings.setAutoDeleteQueues(XMLUtil.parseBoolean(child));
+         } else if (AUTO_CREATE_ADDRESSES.equalsIgnoreCase(name)) {
+            addressSettings.setAutoCreateAddresses(XMLUtil.parseBoolean(child));
+         } else if (AUTO_DELETE_ADDRESSES.equalsIgnoreCase(name)) {
+            addressSettings.setAutoDeleteAddresses(XMLUtil.parseBoolean(child));
          } else if (MANAGEMENT_BROWSE_PAGE_SIZE.equalsIgnoreCase(name)) {
             addressSettings.setManagementBrowsePageSize(XMLUtil.parseInt(child));
          }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/aefdc671/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/ActiveMQServerControlImpl.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/ActiveMQServerControlImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/ActiveMQServerControlImpl.java
index 0458fa4..e5ad233 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/ActiveMQServerControlImpl.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/ActiveMQServerControlImpl.java
@@ -1696,7 +1696,31 @@ public class ActiveMQServerControlImpl extends AbstractControl implements Active
       if (addressSettings.getExpiryAddress() != null) {
          settings.add("expiryAddress", addressSettings.getExpiryAddress().toString());
       }
-      return settings.add("expiryDelay", addressSettings.getExpiryDelay()).add("maxDeliveryAttempts", addressSettings.getMaxDeliveryAttempts()).add("pageCacheMaxSize", addressSettings.getPageCacheMaxSize()).add("maxSizeBytes", addressSettings.getMaxSizeBytes()).add("pageSizeBytes", addressSettings.getPageSizeBytes()).add("redeliveryDelay", addressSettings.getRedeliveryDelay()).add("redeliveryMultiplier", addressSettings.getRedeliveryMultiplier()).add("maxRedeliveryDelay", addressSettings.getMaxRedeliveryDelay()).add("redistributionDelay", addressSettings.getRedistributionDelay()).add("lastValueQueue", addressSettings.isLastValueQueue()).add("sendToDLAOnNoRoute", addressSettings.isSendToDLAOnNoRoute()).add("addressFullMessagePolicy", policy).add("slowConsumerThreshold", addressSettings.getSlowConsumerThreshold()).add("slowConsumerCheckPeriod", addressSettings.getSlowConsumerCheckPeriod()).add("slowConsumerPolicy", consumerPolicy).add("autoCreateJmsQueues", addressSettings.isAutoCreat
 eJmsQueues()).add("autoCreateJmsTopics", addressSettings.isAutoCreateJmsTopics()).add("autoDeleteJmsQueues", addressSettings.isAutoDeleteJmsQueues()).add("autoDeleteJmsTopics", addressSettings.isAutoDeleteJmsQueues()).build().toString();
+      return settings.add("expiryDelay", addressSettings.getExpiryDelay())
+                     .add("maxDeliveryAttempts", addressSettings.getMaxDeliveryAttempts())
+                     .add("pageCacheMaxSize", addressSettings.getPageCacheMaxSize())
+                     .add("maxSizeBytes", addressSettings.getMaxSizeBytes())
+                     .add("pageSizeBytes", addressSettings.getPageSizeBytes())
+                     .add("redeliveryDelay", addressSettings.getRedeliveryDelay())
+                     .add("redeliveryMultiplier", addressSettings.getRedeliveryMultiplier())
+                     .add("maxRedeliveryDelay", addressSettings.getMaxRedeliveryDelay())
+                     .add("redistributionDelay", addressSettings.getRedistributionDelay())
+                     .add("lastValueQueue", addressSettings.isLastValueQueue())
+                     .add("sendToDLAOnNoRoute", addressSettings.isSendToDLAOnNoRoute())
+                     .add("addressFullMessagePolicy", policy)
+                     .add("slowConsumerThreshold", addressSettings.getSlowConsumerThreshold())
+                     .add("slowConsumerCheckPeriod", addressSettings.getSlowConsumerCheckPeriod())
+                     .add("slowConsumerPolicy", consumerPolicy)
+                     .add("autoCreateJmsQueues", addressSettings.isAutoCreateJmsQueues())
+                     .add("autoCreateJmsTopics", addressSettings.isAutoCreateJmsTopics())
+                     .add("autoDeleteJmsQueues", addressSettings.isAutoDeleteJmsQueues())
+                     .add("autoDeleteJmsTopics", addressSettings.isAutoDeleteJmsQueues())
+                     .add("autoCreateQueues", addressSettings.isAutoCreateQueues())
+                     .add("autoDeleteQueues", addressSettings.isAutoDeleteQueues())
+                     .add("autoCreateAddress", addressSettings.isAutoCreateAddresses())
+                     .add("autoDeleteAddress", addressSettings.isAutoDeleteAddresses())
+                     .build()
+                     .toString();
    }
 
    @Override
@@ -1722,6 +1746,36 @@ public class ActiveMQServerControlImpl extends AbstractControl implements Active
                                   final boolean autoDeleteJmsQueues,
                                   final boolean autoCreateJmsTopics,
                                   final boolean autoDeleteJmsTopics) throws Exception {
+      addAddressSettings(address, DLA, expiryAddress, expiryDelay, lastValueQueue, deliveryAttempts, maxSizeBytes, pageSizeBytes, pageMaxCacheSize, redeliveryDelay, redeliveryMultiplier, maxRedeliveryDelay, redistributionDelay, sendToDLAOnNoRoute, addressFullMessagePolicy, slowConsumerThreshold, slowConsumerCheckPeriod, slowConsumerPolicy, autoCreateJmsQueues, autoDeleteJmsQueues, autoCreateJmsTopics, autoDeleteJmsTopics, AddressSettings.DEFAULT_AUTO_CREATE_QUEUES, AddressSettings.DEFAULT_AUTO_DELETE_QUEUES, AddressSettings.DEFAULT_AUTO_CREATE_ADDRESSES, AddressSettings.DEFAULT_AUTO_DELETE_ADDRESSES);
+   }
+
+   @Override
+   public void addAddressSettings(final String address,
+                                  final String DLA,
+                                  final String expiryAddress,
+                                  final long expiryDelay,
+                                  final boolean lastValueQueue,
+                                  final int deliveryAttempts,
+                                  final long maxSizeBytes,
+                                  final int pageSizeBytes,
+                                  final int pageMaxCacheSize,
+                                  final long redeliveryDelay,
+                                  final double redeliveryMultiplier,
+                                  final long maxRedeliveryDelay,
+                                  final long redistributionDelay,
+                                  final boolean sendToDLAOnNoRoute,
+                                  final String addressFullMessagePolicy,
+                                  final long slowConsumerThreshold,
+                                  final long slowConsumerCheckPeriod,
+                                  final String slowConsumerPolicy,
+                                  final boolean autoCreateJmsQueues,
+                                  final boolean autoDeleteJmsQueues,
+                                  final boolean autoCreateJmsTopics,
+                                  final boolean autoDeleteJmsTopics,
+                                  final boolean autoCreateQueues,
+                                  final boolean autoDeleteQueues,
+                                  final boolean autoCreateAddresses,
+                                  final boolean autoDeleteAddresses) throws Exception {
       checkStarted();
 
       // JBPAPP-6334 requested this to be pageSizeBytes > maxSizeBytes
@@ -1769,6 +1823,12 @@ public class ActiveMQServerControlImpl extends AbstractControl implements Active
       }
       addressSettings.setAutoCreateJmsQueues(autoCreateJmsQueues);
       addressSettings.setAutoDeleteJmsQueues(autoDeleteJmsQueues);
+      addressSettings.setAutoCreateJmsTopics(autoCreateJmsTopics);
+      addressSettings.setAutoDeleteJmsTopics(autoDeleteJmsTopics);
+      addressSettings.setAutoCreateQueues(autoCreateJmsQueues);
+      addressSettings.setAutoDeleteQueues(autoDeleteJmsQueues);
+      addressSettings.setAutoCreateAddresses(autoCreateJmsTopics);
+      addressSettings.setAutoDeleteAddresses(autoDeleteJmsTopics);
       server.getAddressSettingsRepository().addMatch(address, addressSettings);
 
       storageManager.storeAddressSetting(new PersistedAddressSetting(new SimpleString(address), addressSettings));

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/aefdc671/artemis-server/src/main/java/org/apache/activemq/artemis/core/settings/impl/AddressSettings.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/settings/impl/AddressSettings.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/settings/impl/AddressSettings.java
index e613ee6..a63ee9b 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/settings/impl/AddressSettings.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/settings/impl/AddressSettings.java
@@ -52,14 +52,26 @@ public class AddressSettings implements Mergeable<AddressSettings>, Serializable
 
    public static final boolean DEFAULT_LAST_VALUE_QUEUE = false;
 
+   @Deprecated
    public static final boolean DEFAULT_AUTO_CREATE_JMS_QUEUES = true;
 
+   @Deprecated
    public static final boolean DEFAULT_AUTO_DELETE_JMS_QUEUES = true;
 
+   @Deprecated
    public static final boolean DEFAULT_AUTO_CREATE_TOPICS = true;
 
+   @Deprecated
    public static final boolean DEFAULT_AUTO_DELETE_TOPICS = true;
 
+   public static final boolean DEFAULT_AUTO_CREATE_QUEUES = true;
+
+   public static final boolean DEFAULT_AUTO_DELETE_QUEUES = true;
+
+   public static final boolean DEFAULT_AUTO_CREATE_ADDRESSES = true;
+
+   public static final boolean DEFAULT_AUTO_DELETE_ADDRESSES = true;
+
    public static final long DEFAULT_REDISTRIBUTION_DELAY = -1;
 
    public static final long DEFAULT_EXPIRY_DELAY = -1;
@@ -125,6 +137,14 @@ public class AddressSettings implements Mergeable<AddressSettings>, Serializable
 
    private Boolean autoDeleteJmsTopics = null;
 
+   private Boolean autoCreateQueues = null;
+
+   private Boolean autoDeleteQueues = null;
+
+   private Boolean autoCreateAddresses = null;
+
+   private Boolean autoDeleteAddresses = null;
+
    private Integer managementBrowsePageSize = AddressSettings.MANAGEMENT_BROWSE_PAGE_SIZE;
 
    private Long maxSizeBytesRejectThreshold = null;
@@ -157,6 +177,10 @@ public class AddressSettings implements Mergeable<AddressSettings>, Serializable
       this.autoDeleteJmsQueues = other.autoDeleteJmsQueues;
       this.autoCreateJmsTopics = other.autoCreateJmsTopics;
       this.autoDeleteJmsTopics = other.autoDeleteJmsTopics;
+      this.autoCreateQueues = other.autoCreateQueues;
+      this.autoDeleteQueues = other.autoDeleteQueues;
+      this.autoCreateAddresses = other.autoCreateAddresses;
+      this.autoDeleteAddresses = other.autoDeleteAddresses;
       this.managementBrowsePageSize = other.managementBrowsePageSize;
       this.queuePrefetch = other.queuePrefetch;
       this.maxSizeBytesRejectThreshold = other.maxSizeBytesRejectThreshold;
@@ -165,42 +189,86 @@ public class AddressSettings implements Mergeable<AddressSettings>, Serializable
    public AddressSettings() {
    }
 
+   @Deprecated
    public boolean isAutoCreateJmsQueues() {
       return autoCreateJmsQueues != null ? autoCreateJmsQueues : AddressSettings.DEFAULT_AUTO_CREATE_JMS_QUEUES;
    }
 
+   @Deprecated
    public AddressSettings setAutoCreateJmsQueues(final boolean autoCreateJmsQueues) {
       this.autoCreateJmsQueues = autoCreateJmsQueues;
       return this;
    }
 
+   @Deprecated
    public boolean isAutoDeleteJmsQueues() {
       return autoDeleteJmsQueues != null ? autoDeleteJmsQueues : AddressSettings.DEFAULT_AUTO_DELETE_JMS_QUEUES;
    }
 
+   @Deprecated
    public AddressSettings setAutoDeleteJmsQueues(final boolean autoDeleteJmsQueues) {
       this.autoDeleteJmsQueues = autoDeleteJmsQueues;
       return this;
    }
 
+   @Deprecated
    public boolean isAutoCreateJmsTopics() {
       return autoCreateJmsTopics != null ? autoCreateJmsTopics : AddressSettings.DEFAULT_AUTO_CREATE_TOPICS;
    }
 
+   @Deprecated
    public AddressSettings setAutoCreateJmsTopics(final boolean autoCreateJmsTopics) {
       this.autoCreateJmsTopics = autoCreateJmsTopics;
       return this;
    }
 
+   @Deprecated
    public boolean isAutoDeleteJmsTopics() {
       return autoDeleteJmsTopics != null ? autoDeleteJmsTopics : AddressSettings.DEFAULT_AUTO_DELETE_TOPICS;
    }
 
+   @Deprecated
    public AddressSettings setAutoDeleteJmsTopics(final boolean autoDeleteJmsTopics) {
       this.autoDeleteJmsTopics = autoDeleteJmsTopics;
       return this;
    }
 
+   public boolean isAutoCreateQueues() {
+      return autoCreateQueues != null ? autoCreateQueues : AddressSettings.DEFAULT_AUTO_CREATE_QUEUES;
+   }
+
+   public AddressSettings setAutoCreateQueues(Boolean autoCreateQueues) {
+      this.autoCreateQueues = autoCreateQueues;
+      return this;
+   }
+
+   public boolean isAutoDeleteQueues() {
+      return autoDeleteQueues != null ? autoDeleteQueues : AddressSettings.DEFAULT_AUTO_DELETE_QUEUES;
+   }
+
+   public AddressSettings setAutoDeleteQueues(Boolean autoDeleteQueues) {
+      this.autoDeleteQueues = autoDeleteQueues;
+      return this;
+   }
+
+   public boolean isAutoCreateAddresses() {
+      return autoCreateAddresses != null ? autoCreateAddresses : AddressSettings.DEFAULT_AUTO_CREATE_ADDRESSES;
+   }
+
+   public AddressSettings setAutoCreateAddresses(Boolean autoCreateAddresses) {
+      this.autoCreateAddresses = autoCreateAddresses;
+      return this;
+   }
+
+   public boolean isAutoDeleteAddresses() {
+      return autoDeleteAddresses != null ? autoDeleteAddresses : AddressSettings.DEFAULT_AUTO_DELETE_ADDRESSES;
+   }
+
+   public AddressSettings setAutoDeleteAddresses(Boolean autoDeleteAddresses) {
+      this.autoDeleteAddresses = autoDeleteAddresses;
+      return this;
+   }
+
    public boolean isLastValueQueue() {
       return lastValueQueue != null ? lastValueQueue : AddressSettings.DEFAULT_LAST_VALUE_QUEUE;
    }
@@ -459,12 +527,24 @@ public class AddressSettings implements Mergeable<AddressSettings>, Serializable
       if (autoDeleteJmsQueues == null) {
          autoDeleteJmsQueues = merged.autoDeleteJmsQueues;
       }
-//      if (autoCreateJmsTopics == null) {
-//         autoCreateJmsTopics = merged.autoCreateJmsTopics;
-//      }
+      if (autoCreateJmsTopics == null) {
+         autoCreateJmsTopics = merged.autoCreateJmsTopics;
+      }
       if (autoDeleteJmsTopics == null) {
          autoDeleteJmsTopics = merged.autoDeleteJmsTopics;
       }
+      if (autoCreateQueues == null) {
+         autoCreateQueues = merged.autoCreateQueues;
+      }
+      if (autoDeleteQueues == null) {
+         autoDeleteQueues = merged.autoDeleteQueues;
+      }
+      if (autoCreateAddresses == null) {
+         autoCreateAddresses = merged.autoCreateAddresses;
+      }
+      if (autoDeleteAddresses == null) {
+         autoDeleteAddresses = merged.autoDeleteAddresses;
+      }
       if (managementBrowsePageSize == null) {
          managementBrowsePageSize = merged.managementBrowsePageSize;
       }
@@ -532,10 +612,18 @@ public class AddressSettings implements Mergeable<AddressSettings>, Serializable
 
       autoDeleteJmsQueues = BufferHelper.readNullableBoolean(buffer);
 
-//      autoCreateJmsTopics = BufferHelper.readNullableBoolean(buffer);
+      autoCreateJmsTopics = BufferHelper.readNullableBoolean(buffer);
 
       autoDeleteJmsTopics = BufferHelper.readNullableBoolean(buffer);
 
+      autoCreateQueues = BufferHelper.readNullableBoolean(buffer);
+
+      autoDeleteQueues = BufferHelper.readNullableBoolean(buffer);
+
+      autoCreateAddresses = BufferHelper.readNullableBoolean(buffer);
+
+      autoDeleteAddresses = BufferHelper.readNullableBoolean(buffer);
+
       managementBrowsePageSize = BufferHelper.readNullableInteger(buffer);
 
       maxSizeBytesRejectThreshold = BufferHelper.readNullableLong(buffer);
@@ -565,8 +653,12 @@ public class AddressSettings implements Mergeable<AddressSettings>, Serializable
          BufferHelper.sizeOfNullableSimpleString(slowConsumerPolicy != null ? slowConsumerPolicy.toString() : null) +
          BufferHelper.sizeOfNullableBoolean(autoCreateJmsQueues) +
          BufferHelper.sizeOfNullableBoolean(autoDeleteJmsQueues) +
-//         BufferHelper.sizeOfNullableBoolean(autoCreateJmsTopics) +
+         BufferHelper.sizeOfNullableBoolean(autoCreateJmsTopics) +
          BufferHelper.sizeOfNullableBoolean(autoDeleteJmsTopics) +
+         BufferHelper.sizeOfNullableBoolean(autoCreateQueues) +
+         BufferHelper.sizeOfNullableBoolean(autoDeleteQueues) +
+         BufferHelper.sizeOfNullableBoolean(autoCreateAddresses) +
+         BufferHelper.sizeOfNullableBoolean(autoDeleteAddresses) +
          BufferHelper.sizeOfNullableInteger(managementBrowsePageSize) +
          BufferHelper.sizeOfNullableLong(maxSizeBytesRejectThreshold);
    }
@@ -615,10 +707,18 @@ public class AddressSettings implements Mergeable<AddressSettings>, Serializable
 
       BufferHelper.writeNullableBoolean(buffer, autoDeleteJmsQueues);
 
-//      BufferHelper.writeNullableBoolean(buffer, autoCreateJmsTopics);
+      BufferHelper.writeNullableBoolean(buffer, autoCreateJmsTopics);
 
       BufferHelper.writeNullableBoolean(buffer, autoDeleteJmsTopics);
 
+      BufferHelper.writeNullableBoolean(buffer, autoCreateQueues);
+
+      BufferHelper.writeNullableBoolean(buffer, autoDeleteQueues);
+
+      BufferHelper.writeNullableBoolean(buffer, autoCreateAddresses);
+
+      BufferHelper.writeNullableBoolean(buffer, autoDeleteAddresses);
+
       BufferHelper.writeNullableInteger(buffer, managementBrowsePageSize);
 
       BufferHelper.writeNullableLong(buffer, maxSizeBytesRejectThreshold);
@@ -652,8 +752,12 @@ public class AddressSettings implements Mergeable<AddressSettings>, Serializable
       result = prime * result + ((slowConsumerPolicy == null) ? 0 : slowConsumerPolicy.hashCode());
       result = prime * result + ((autoCreateJmsQueues == null) ? 0 : autoCreateJmsQueues.hashCode());
       result = prime * result + ((autoDeleteJmsQueues == null) ? 0 : autoDeleteJmsQueues.hashCode());
-//      result = prime * result + ((autoCreateJmsTopics == null) ? 0 : autoCreateJmsTopics.hashCode());
+      result = prime * result + ((autoCreateJmsTopics == null) ? 0 : autoCreateJmsTopics.hashCode());
       result = prime * result + ((autoDeleteJmsTopics == null) ? 0 : autoDeleteJmsTopics.hashCode());
+      result = prime * result + ((autoCreateQueues == null) ? 0 : autoCreateQueues.hashCode());
+      result = prime * result + ((autoDeleteQueues == null) ? 0 : autoDeleteQueues.hashCode());
+      result = prime * result + ((autoCreateAddresses == null) ? 0 : autoCreateAddresses.hashCode());
+      result = prime * result + ((autoDeleteAddresses == null) ? 0 : autoDeleteAddresses.hashCode());
       result = prime * result + ((managementBrowsePageSize == null) ? 0 : managementBrowsePageSize.hashCode());
       result = prime * result + ((queuePrefetch == null) ? 0 : queuePrefetch.hashCode());
       result = prime * result + ((maxSizeBytesRejectThreshold == null) ? 0 : queuePrefetch.hashCode());
@@ -777,18 +881,36 @@ public class AddressSettings implements Mergeable<AddressSettings>, Serializable
             return false;
       } else if (!autoDeleteJmsQueues.equals(other.autoDeleteJmsQueues))
          return false;
-
-//      if (autoCreateJmsTopics == null) {
-//         if (other.autoCreateJmsTopics != null)
-//            return false;
-//      } else if (!autoCreateJmsTopics.equals(other.autoCreateJmsTopics))
-//         return false;
+      if (autoCreateJmsTopics == null) {
+         if (other.autoCreateJmsTopics != null)
+            return false;
+      } else if (!autoCreateJmsTopics.equals(other.autoCreateJmsTopics))
+         return false;
       if (autoDeleteJmsTopics == null) {
          if (other.autoDeleteJmsTopics != null)
             return false;
       } else if (!autoDeleteJmsTopics.equals(other.autoDeleteJmsTopics))
          return false;
-
+      if (autoCreateQueues == null) {
+         if (other.autoCreateQueues != null)
+            return false;
+      } else if (!autoCreateQueues.equals(other.autoCreateQueues))
+         return false;
+      if (autoDeleteQueues == null) {
+         if (other.autoDeleteQueues != null)
+            return false;
+      } else if (!autoDeleteQueues.equals(other.autoDeleteQueues))
+         return false;
+      if (autoCreateAddresses == null) {
+         if (other.autoCreateAddresses != null)
+            return false;
+      } else if (!autoCreateAddresses.equals(other.autoCreateAddresses))
+         return false;
+      if (autoDeleteAddresses == null) {
+         if (other.autoDeleteAddresses != null)
+            return false;
+      } else if (!autoDeleteAddresses.equals(other.autoDeleteAddresses))
+         return false;
       if (managementBrowsePageSize == null) {
          if (other.managementBrowsePageSize != null)
             return false;
@@ -854,11 +976,20 @@ public class AddressSettings implements Mergeable<AddressSettings>, Serializable
          slowConsumerPolicy +
          ", autoCreateJmsQueues=" +
          autoCreateJmsQueues +
-         ", autoDeleteJmsQueues=" + autoDeleteJmsQueues +
+         ", autoDeleteJmsQueues=" +
+         autoDeleteJmsQueues +
          ", autoCreateJmsTopics=" +
-//         autoCreateJmsTopics +
-//         ", autoDeleteJmsTopics=" +
+         autoCreateJmsTopics +
+         ", autoDeleteJmsTopics=" +
          autoDeleteJmsTopics +
+         ", autoCreateQueues=" +
+         autoCreateQueues +
+         ", autoDeleteQueues=" +
+         autoDeleteQueues +
+         ", autoCreateAddresses=" +
+         autoCreateAddresses +
+         ", autoDeleteAddresses=" +
+         autoDeleteAddresses +
          ", managementBrowsePageSize=" +
          managementBrowsePageSize +
          "]";

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/aefdc671/artemis-server/src/main/resources/schema/artemis-configuration.xsd
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/resources/schema/artemis-configuration.xsd b/artemis-server/src/main/resources/schema/artemis-configuration.xsd
index b40c92c..bfb0054 100644
--- a/artemis-server/src/main/resources/schema/artemis-configuration.xsd
+++ b/artemis-server/src/main/resources/schema/artemis-configuration.xsd
@@ -2399,7 +2399,7 @@
             <xsd:element name="auto-create-jms-queues" type="xsd:boolean" default="true" maxOccurs="1" minOccurs="0">
                <xsd:annotation>
                   <xsd:documentation>
-                     whether or not to automatically create JMS queues when a producer sends or a consumer connects to a
+                     DEPRECATED: whether or not to automatically create JMS queues when a producer sends or a consumer connects to a
                      queue
                   </xsd:documentation>
                </xsd:annotation>
@@ -2408,7 +2408,7 @@
             <xsd:element name="auto-delete-jms-queues" type="xsd:boolean" default="true" maxOccurs="1" minOccurs="0">
                <xsd:annotation>
                   <xsd:documentation>
-                     whether or not to delete auto-created JMS queues when the queue has 0 consumers and 0 messages
+                     DEPRECATED: whether or not to delete auto-created JMS queues when the queue has 0 consumers and 0 messages
                   </xsd:documentation>
                </xsd:annotation>
             </xsd:element>
@@ -2416,7 +2416,7 @@
             <xsd:element name="auto-create-jms-topics" type="xsd:boolean" default="true" maxOccurs="1" minOccurs="0">
                <xsd:annotation>
                   <xsd:documentation>
-                     whether or not to automatically create JMS topics when a producer sends or a consumer subscribes to
+                     DEPRECATED: whether or not to automatically create JMS topics when a producer sends or a consumer subscribes to
                      a topic
                   </xsd:documentation>
                </xsd:annotation>
@@ -2425,7 +2425,42 @@
             <xsd:element name="auto-delete-jms-topics" type="xsd:boolean" default="true" maxOccurs="1" minOccurs="0">
                <xsd:annotation>
                   <xsd:documentation>
-                     whether or not to delete auto-created JMS topics when the last subscription is closed
+                     DEPRECATED: whether or not to delete auto-created JMS topics when the last subscription is closed
+                  </xsd:documentation>
+               </xsd:annotation>
+            </xsd:element>
+
+            <xsd:element name="auto-create-queues" type="xsd:boolean" default="true" maxOccurs="1" minOccurs="0">
+               <xsd:annotation>
+                  <xsd:documentation>
+                     whether or not to automatically create a queue when a client sends a message to or attempts to consume
+                     a message from a queue
+                  </xsd:documentation>
+               </xsd:annotation>
+            </xsd:element>
+
+            <xsd:element name="auto-delete-queues" type="xsd:boolean" default="true" maxOccurs="1" minOccurs="0">
+               <xsd:annotation>
+                  <xsd:documentation>
+                     whether or not to delete auto-created queues when the queue has 0 consumers and 0 messages
+                  </xsd:documentation>
+               </xsd:annotation>
+            </xsd:element>
+
+            <xsd:element name="auto-create-addresses" type="xsd:boolean" default="true" maxOccurs="1" minOccurs="0">
+               <xsd:annotation>
+                  <xsd:documentation>
+                     whether or not to automatically create addresses when a client sends a message to or attempts to
+                     consume a message from a queue mapped to an address that doesn't exist
+                     a queue
+                  </xsd:documentation>
+               </xsd:annotation>
+            </xsd:element>
+
+            <xsd:element name="auto-delete-addresses" type="xsd:boolean" default="true" maxOccurs="1" minOccurs="0">
+               <xsd:annotation>
+                  <xsd:documentation>
+                     whether or not to delete auto-created addresses when it no longer has any queues
                   </xsd:documentation>
                </xsd:annotation>
             </xsd:element>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/aefdc671/artemis-server/src/test/java/org/apache/activemq/artemis/core/settings/AddressSettingsTest.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/test/java/org/apache/activemq/artemis/core/settings/AddressSettingsTest.java b/artemis-server/src/test/java/org/apache/activemq/artemis/core/settings/AddressSettingsTest.java
index 4041a16..6a6ec55 100644
--- a/artemis-server/src/test/java/org/apache/activemq/artemis/core/settings/AddressSettingsTest.java
+++ b/artemis-server/src/test/java/org/apache/activemq/artemis/core/settings/AddressSettingsTest.java
@@ -41,8 +41,12 @@ public class AddressSettingsTest extends ActiveMQTestBase {
       Assert.assertEquals(AddressSettings.DEFAULT_SLOW_CONSUMER_POLICY, addressSettings.getSlowConsumerPolicy());
       Assert.assertEquals(AddressSettings.DEFAULT_AUTO_CREATE_JMS_QUEUES, addressSettings.isAutoCreateJmsQueues());
       Assert.assertEquals(AddressSettings.DEFAULT_AUTO_DELETE_JMS_QUEUES, addressSettings.isAutoDeleteJmsQueues());
-//      Assert.assertEquals(AddressSettings.DEFAULT_AUTO_CREATE_TOPICS, addressSettings.isAutoCreateJmsTopics());
-//      Assert.assertEquals(AddressSettings.DEFAULT_AUTO_DELETE_TOPICS, addressSettings.isAutoDeleteJmsTopics());
+      Assert.assertEquals(AddressSettings.DEFAULT_AUTO_CREATE_TOPICS, addressSettings.isAutoCreateJmsTopics());
+      Assert.assertEquals(AddressSettings.DEFAULT_AUTO_DELETE_TOPICS, addressSettings.isAutoDeleteJmsTopics());
+      Assert.assertEquals(AddressSettings.DEFAULT_AUTO_CREATE_QUEUES, addressSettings.isAutoCreateQueues());
+      Assert.assertEquals(AddressSettings.DEFAULT_AUTO_DELETE_QUEUES, addressSettings.isAutoDeleteQueues());
+      Assert.assertEquals(AddressSettings.DEFAULT_AUTO_CREATE_ADDRESSES, addressSettings.isAutoCreateAddresses());
+      Assert.assertEquals(AddressSettings.DEFAULT_AUTO_DELETE_ADDRESSES, addressSettings.isAutoDeleteAddresses());
    }
 
    @Test

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/aefdc671/artemis-server/src/test/resources/ConfigurationTest-full-config.xml
----------------------------------------------------------------------
diff --git a/artemis-server/src/test/resources/ConfigurationTest-full-config.xml b/artemis-server/src/test/resources/ConfigurationTest-full-config.xml
index 87dbd90..f0eaa36 100644
--- a/artemis-server/src/test/resources/ConfigurationTest-full-config.xml
+++ b/artemis-server/src/test/resources/ConfigurationTest-full-config.xml
@@ -261,6 +261,10 @@
             <auto-delete-jms-queues>true</auto-delete-jms-queues>
             <auto-create-jms-topics>true</auto-create-jms-topics>
             <auto-delete-jms-topics>true</auto-delete-jms-topics>
+            <auto-create-queues>true</auto-create-queues>
+            <auto-delete-queues>true</auto-delete-queues>
+            <auto-create-addresses>true</auto-create-addresses>
+            <auto-delete-addresses>true</auto-delete-addresses>
          </address-setting>
          <address-setting match="a2">
             <dead-letter-address>a2.1</dead-letter-address>
@@ -277,6 +281,10 @@
             <auto-delete-jms-queues>false</auto-delete-jms-queues>
             <auto-create-jms-topics>false</auto-create-jms-topics>
             <auto-delete-jms-topics>false</auto-delete-jms-topics>
+            <auto-create-queues>false</auto-create-queues>
+            <auto-delete-queues>false</auto-delete-queues>
+            <auto-create-addresses>false</auto-create-addresses>
+            <auto-delete-addresses>false</auto-delete-addresses>
          </address-setting>
       </address-settings>
       <resource-limit-settings>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/aefdc671/docs/user-manual/en/queue-attributes.md
----------------------------------------------------------------------
diff --git a/docs/user-manual/en/queue-attributes.md b/docs/user-manual/en/queue-attributes.md
index 22184aa..7a8fe78 100644
--- a/docs/user-manual/en/queue-attributes.md
+++ b/docs/user-manual/en/queue-attributes.md
@@ -88,6 +88,10 @@ entry that would be found in the `broker.xml` file.
           <slow-consumer-threshold>-1</slow-consumer-threshold>
           <slow-consumer-policy>NOTIFY</slow-consumer-policy>
           <slow-consumer-check-period>5</slow-consumer-check-period>
+          <auto-create-jms-queues>true</auto-create-jms-queues> <!-- DEPRECATED see auto-create-queues>
+          <auto-delete-jms-queues>true</auto-delete-jms-queues> <!-- DEPRECATED see auto-delete-queues>
+          <auto-create-jms-topics>true</auto-create-jms-topics> <!-- DEPRECATED see auto-create-addresses>
+          <auto-delete-jms-topics>true</auto-delete-jms-topics> <!-- DEPRECATED see auto-delete-addresses>
           <auto-create-jms-queues>true</auto-create-jms-queues>
           <auto-delete-jms-queues>true</auto-delete-jms-queues>
           <auto-create-jms-topics>true</auto-create-jms-topics>
@@ -179,18 +183,38 @@ create a JMS queue when a JMS message is sent to a queue whose name fits
 the address `match` (remember, a JMS queue is just a core queue which has
 the same address and queue name) or a JMS consumer tries to connect to a
 queue whose name fits the address `match`. Queues which are auto-created
-are durable, non-temporary, and non-transient. Default is `true`.
+are durable, non-temporary, and non-transient. Default is `true`. This is
+_DEPRECATED_.  See `auto-create-queues`.
 
 `auto-delete-jms-queues`. Whether or not the broker should automatically
 delete auto-created JMS queues when they have both 0 consumers and 0 messages.
-Default is `true`.
+Default is `true`. This is _DEPRECATED_.  See `auto-delete-queues`.
 
 `auto-create-jms-topics`. Whether or not the broker should automatically
 create a JMS topic when a JMS message is sent to a topic whose name fits
 the address `match` (remember, a JMS topic is just a core address which has 
 one or more core queues mapped to it) or a JMS consumer tries to subscribe
-to a topic whose name fits the address `match`. Default is `true`.
+to a topic whose name fits the address `match`. Default is `true`. This is
+_DEPRECATED_.  See `auto-create-addresses`.
 
 `auto-delete-jms-topics`. Whether or not the broker should automatically
 delete auto-created JMS topics once the last subscription on the topic has
-been closed. Default is `true`.
+been closed. Default is `true`. This is _DEPRECATED_.  See `auto-delete-addresses`.
+
+`auto-create-queues`. Whether or not the broker should automatically
+create a queue when a message is sent or a consumer tries to connect to a
+queue whose name fits the address `match`. Queues which are auto-created
+are durable, non-temporary, and non-transient. Default is `true`.
+
+`auto-delete-queues`. Whether or not the broker should automatically
+delete auto-created queues when they have both 0 consumers and 0 messages.
+Default is `true`.
+
+`auto-create-addresses`. Whether or not the broker should automatically
+create an address when a message is sent to or a consumer tries to consume
+from a queue which is mapped to an address whose name fits the address `match`.
+Default is `true`.
+
+`auto-delete-addresses`. Whether or not the broker should automatically
+delete auto-created addresses once the address no longer has any queues.
+Default is `true`.

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/aefdc671/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlUsingCoreTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlUsingCoreTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlUsingCoreTest.java
index cb2d9b0..931089c 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlUsingCoreTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlUsingCoreTest.java
@@ -16,12 +16,13 @@
  */
 package org.apache.activemq.artemis.tests.integration.management;
 
+import java.util.Map;
+
 import org.apache.activemq.artemis.api.core.ActiveMQAddressDoesNotExistException;
 import org.apache.activemq.artemis.api.core.management.ActiveMQServerControl;
 import org.apache.activemq.artemis.api.core.management.Parameter;
 import org.apache.activemq.artemis.api.core.management.ResourceNames;
-
-import java.util.Map;
+import org.apache.activemq.artemis.core.settings.impl.AddressSettings;
 
 public class ActiveMQServerControlUsingCoreTest extends ActiveMQServerControlTest {
 
@@ -650,7 +651,37 @@ public class ActiveMQServerControlUsingCoreTest extends ActiveMQServerControlTes
                                         @Parameter(desc = "allow auto-created queues to be deleted automatically", name = "autoDeleteJmsQueues") boolean autoDeleteJmsQueues,
                                         @Parameter(desc = "allow topics to be created automatically", name = "autoCreateJmsTopics") boolean autoCreateJmsTopics,
                                         @Parameter(desc = "allow auto-created topics to be deleted automatically", name = "autoDeleteJmsTopics") boolean autoDeleteJmsTopics) throws Exception {
-            proxy.invokeOperation("addAddressSettings", addressMatch, DLA, expiryAddress, expiryDelay, lastValueQueue, deliveryAttempts, maxSizeBytes, pageSizeBytes, pageMaxCacheSize, redeliveryDelay, redeliveryMultiplier, maxRedeliveryDelay, redistributionDelay, sendToDLAOnNoRoute, addressFullMessagePolicy, slowConsumerThreshold, slowConsumerCheckPeriod, slowConsumerPolicy, autoCreateJmsQueues, autoDeleteJmsQueues, autoCreateJmsTopics, autoDeleteJmsTopics);
+            addAddressSettings(addressMatch, DLA, expiryAddress, expiryDelay, lastValueQueue, deliveryAttempts, maxSizeBytes, pageSizeBytes, pageMaxCacheSize, redeliveryDelay, redeliveryMultiplier, maxRedeliveryDelay, redistributionDelay, sendToDLAOnNoRoute, addressFullMessagePolicy, slowConsumerThreshold, slowConsumerCheckPeriod, slowConsumerPolicy, autoCreateJmsQueues, autoDeleteJmsQueues, autoCreateJmsTopics, autoDeleteJmsTopics, AddressSettings.DEFAULT_AUTO_CREATE_QUEUES, AddressSettings.DEFAULT_AUTO_DELETE_QUEUES, AddressSettings.DEFAULT_AUTO_CREATE_ADDRESSES, AddressSettings.DEFAULT_AUTO_DELETE_ADDRESSES);
+         }
+
+         @Override
+         public void addAddressSettings(@Parameter(desc = "an address match", name = "addressMatch") String addressMatch,
+                                        @Parameter(desc = "the dead letter address setting", name = "DLA") String DLA,
+                                        @Parameter(desc = "the expiry address setting", name = "expiryAddress") String expiryAddress,
+                                        @Parameter(desc = "the expiry delay setting", name = "expiryDelay") long expiryDelay,
+                                        @Parameter(desc = "are any queues created for this address a last value queue", name = "lastValueQueue") boolean lastValueQueue,
+                                        @Parameter(desc = "the delivery attempts", name = "deliveryAttempts") int deliveryAttempts,
+                                        @Parameter(desc = "the max size in bytes", name = "maxSizeBytes") long maxSizeBytes,
+                                        @Parameter(desc = "the page size in bytes", name = "pageSizeBytes") int pageSizeBytes,
+                                        @Parameter(desc = "the max number of pages in the soft memory cache", name = "pageMaxCacheSize") int pageMaxCacheSize,
+                                        @Parameter(desc = "the redelivery delay", name = "redeliveryDelay") long redeliveryDelay,
+                                        @Parameter(desc = "the redelivery delay multiplier", name = "redeliveryMultiplier") double redeliveryMultiplier,
+                                        @Parameter(desc = "the maximum redelivery delay", name = "maxRedeliveryDelay") long maxRedeliveryDelay,
+                                        @Parameter(desc = "the redistribution delay", name = "redistributionDelay") long redistributionDelay,
+                                        @Parameter(desc = "do we send to the DLA when there is no where to route the message", name = "sendToDLAOnNoRoute") boolean sendToDLAOnNoRoute,
+                                        @Parameter(desc = "the policy to use when the address is full", name = "addressFullMessagePolicy") String addressFullMessagePolicy,
+                                        @Parameter(desc = "when a consumer falls below this threshold in terms of messages consumed per second it will be considered 'slow'", name = "slowConsumerThreshold") long slowConsumerThreshold,
+                                        @Parameter(desc = "how often (in seconds) to check for slow consumers", name = "slowConsumerCheckPeriod") long slowConsumerCheckPeriod,
+                                        @Parameter(desc = "the policy to use when a slow consumer is detected", name = "slowConsumerPolicy") String slowConsumerPolicy,
+                                        @Parameter(desc = "allow jms queues to be created automatically", name = "autoCreateJmsQueues") boolean autoCreateJmsQueues,
+                                        @Parameter(desc = "allow auto-created jms queues to be deleted automatically", name = "autoDeleteJmsQueues") boolean autoDeleteJmsQueues,
+                                        @Parameter(desc = "allow jms topics to be created automatically", name = "autoCreateJmsTopics") boolean autoCreateJmsTopics,
+                                        @Parameter(desc = "allow auto-created jms topics to be deleted automatically", name = "autoDeleteJmsTopics") boolean autoDeleteJmsTopics,
+                                        @Parameter(desc = "allow queues to be created automatically", name = "autoCreateQueues") boolean autoCreateQueues,
+                                        @Parameter(desc = "allow auto-created queues to be deleted automatically", name = "autoDeleteQueues") boolean autoDeleteQueues,
+                                        @Parameter(desc = "allow topics to be created automatically", name = "autoCreateAddresses") boolean autoCreateAddresses,
+                                        @Parameter(desc = "allow auto-created topics to be deleted automatically", name = "autoDeleteAddresses") boolean autoDeleteAddresses) throws Exception {
+            proxy.invokeOperation("addAddressSettings", addressMatch, DLA, expiryAddress, expiryDelay, lastValueQueue, deliveryAttempts, maxSizeBytes, pageSizeBytes, pageMaxCacheSize, redeliveryDelay, redeliveryMultiplier, maxRedeliveryDelay, redistributionDelay, sendToDLAOnNoRoute, addressFullMessagePolicy, slowConsumerThreshold, slowConsumerCheckPeriod, slowConsumerPolicy, autoCreateJmsQueues, autoDeleteJmsQueues, autoCreateJmsTopics, autoDeleteJmsTopics, autoCreateQueues, autoDeleteQueues, autoCreateAddresses, autoDeleteAddresses);
          }
 
          @Override

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/aefdc671/tests/integration-tests/src/test/resources/reload-test-jms.xml
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/resources/reload-test-jms.xml b/tests/integration-tests/src/test/resources/reload-test-jms.xml
index e914942..5ff7184 100644
--- a/tests/integration-tests/src/test/resources/reload-test-jms.xml
+++ b/tests/integration-tests/src/test/resources/reload-test-jms.xml
@@ -99,7 +99,7 @@ under the License.
       <address-settings>
          <!--default for catch all-->
          <address-setting match="#">
-            <auto-create-jms-queues>false</auto-create-jms-queues>
+            <auto-create-queues>false</auto-create-queues>
             <dead-letter-address>DLQ</dead-letter-address>
             <expiry-address>ExpiryQueue</expiry-address>
             <redelivery-delay>0</redelivery-delay>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/aefdc671/tests/integration-tests/src/test/resources/reload-test-updated-jms.xml
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/resources/reload-test-updated-jms.xml b/tests/integration-tests/src/test/resources/reload-test-updated-jms.xml
index 5195fed..1a67013 100644
--- a/tests/integration-tests/src/test/resources/reload-test-updated-jms.xml
+++ b/tests/integration-tests/src/test/resources/reload-test-updated-jms.xml
@@ -109,7 +109,7 @@ under the License.
       <address-settings>
          <!--default for catch all-->
          <address-setting match="#">
-            <auto-create-jms-queues>false</auto-create-jms-queues>
+            <auto-create-queues>false</auto-create-queues>
             <dead-letter-address>NewQueue</dead-letter-address>
             <expiry-address>NewQueue</expiry-address>
             <redelivery-delay>0</redelivery-delay>


[14/48] activemq-artemis git commit: Fix checkstyle

Posted by jb...@apache.org.
Fix checkstyle


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

Branch: refs/heads/ARTEMIS-780
Commit: d4988a071abcfca839521f430985b0440246bd22
Parents: c756499
Author: jbertram <jb...@apache.com>
Authored: Tue Nov 15 10:53:33 2016 -0600
Committer: jbertram <jb...@apache.com>
Committed: Tue Nov 15 10:53:33 2016 -0600

----------------------------------------------------------------------
 .../activemq/artemis/tests/integration/stomp/v11/StompV11Test.java  | 1 -
 1 file changed, 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/d4988a07/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/v11/StompV11Test.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/v11/StompV11Test.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/v11/StompV11Test.java
index 6eb57b2..10ebcea 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/v11/StompV11Test.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/v11/StompV11Test.java
@@ -33,7 +33,6 @@ import java.util.concurrent.TimeUnit;
 import org.apache.activemq.artemis.api.core.SimpleString;
 import org.apache.activemq.artemis.core.protocol.stomp.Stomp;
 import org.apache.activemq.artemis.core.server.impl.AddressInfo;
-import org.apache.activemq.artemis.core.settings.impl.AddressSettings;
 import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger;
 import org.apache.activemq.artemis.tests.integration.stomp.StompTestBase;
 import org.apache.activemq.artemis.tests.integration.stomp.util.ClientStompFrame;


[11/48] activemq-artemis git commit: Fix AutoCreateQueueClusterTest

Posted by jb...@apache.org.
Fix AutoCreateQueueClusterTest


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

Branch: refs/heads/ARTEMIS-780
Commit: 98309cceff79f1e0e88e5da4c40f89c55e9e742d
Parents: 7a15abe
Author: jbertram <jb...@apache.com>
Authored: Mon Nov 14 17:36:26 2016 -0600
Committer: jbertram <jb...@apache.com>
Committed: Tue Nov 15 10:38:13 2016 -0600

----------------------------------------------------------------------
 .../artemis/jms/client/ActiveMQSession.java     |  2 ++
 .../jms/cluster/AutoCreateQueueClusterTest.java |  6 +++--
 .../tests/util/JMSClusteredTestBase.java        | 23 +++++++++++++++-----
 3 files changed, 24 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/98309cce/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQSession.java
----------------------------------------------------------------------
diff --git a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQSession.java b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQSession.java
index e0cef1d..f514dba 100644
--- a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQSession.java
+++ b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQSession.java
@@ -301,6 +301,8 @@ public class ActiveMQSession implements QueueSession, TopicSession {
 
             if (!response.isExists()) {
                if (jbd.isQueue() && response.isAutoCreateJmsQueues()) {
+                  // TODO create queue here in such a way that it is deleted when consumerCount == 0
+                  // perhaps just relying on the broker to do it is simplest (i.e. deleteOnNoConsumers)
                   session.createAddress(jbd.getSimpleAddress(), false, true);
                   session.createQueue(jbd.getSimpleAddress(), jbd.getSimpleAddress(), null, true);
                } else if (!jbd.isQueue() && response.isAutoCreateJmsTopics()) {

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/98309cce/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/cluster/AutoCreateQueueClusterTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/cluster/AutoCreateQueueClusterTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/cluster/AutoCreateQueueClusterTest.java
index cda5494..eb3d184 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/cluster/AutoCreateQueueClusterTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/cluster/AutoCreateQueueClusterTest.java
@@ -58,13 +58,15 @@ public class AutoCreateQueueClusterTest extends JMSClusteredTestBase {
 
          Session session2 = conn2.createSession(false, Session.AUTO_ACKNOWLEDGE);
 
-         MessageProducer prod1 = session1.createProducer(ActiveMQJMSClient.createQueue("myQueue"));
+         // TODO the "jms." prefix is required here because the cluster connection only works for queues which start with "jms"
+         MessageProducer prod1 = session1.createProducer(ActiveMQJMSClient.createQueue("jms.myQueue"));
 
          prod1.setDeliveryMode(DeliveryMode.PERSISTENT);
 
          prod1.send(session1.createTextMessage("m1"));
 
-         MessageConsumer cons2 = session2.createConsumer(ActiveMQJMSClient.createQueue("myQueue"));
+         // TODO the "jms." prefix is required here because the cluster connection only works for queues which start with "jms"
+         MessageConsumer cons2 = session2.createConsumer(ActiveMQJMSClient.createQueue("jms.myQueue"));
 
          TextMessage received = (TextMessage) cons2.receive(5000);
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/98309cce/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/util/JMSClusteredTestBase.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/util/JMSClusteredTestBase.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/util/JMSClusteredTestBase.java
index edf0397..30fdfd4 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/util/JMSClusteredTestBase.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/util/JMSClusteredTestBase.java
@@ -169,11 +169,24 @@ public class JMSClusteredTestBase extends ActiveMQTestBase {
       final String destinationLabel = "toServer" + destination;
       final String sourceLabel = "server" + source;
 
-      Configuration configuration = createDefaultInVMConfig(source).setSecurityEnabled(false).setJMXManagementEnabled(true).setPersistenceEnabled(false).addConnectorConfiguration(destinationLabel, new TransportConfiguration(InVMConnectorFactory.class.getName(), generateInVMParams(destination))).addConnectorConfiguration(sourceLabel, new TransportConfiguration(InVMConnectorFactory.class.getName(), generateInVMParams(source))).addClusterConfiguration(new ClusterConnectionConfiguration().setName(destinationLabel).setAddress("jms").setConnectorName(sourceLabel).setRetryInterval(250).setMaxHops(MAX_HOPS).setConfirmationWindowSize(1024).setMessageLoadBalancingType(MessageLoadBalancingType.ON_DEMAND).setStaticConnectors(new ArrayList<String>() {
-         {
-            add(destinationLabel);
-         }
-      }));
+      Configuration configuration = createDefaultInVMConfig(source).setSecurityEnabled(false)
+                                                                   .setJMXManagementEnabled(true)
+                                                                   .setPersistenceEnabled(false)
+                                                                   .addConnectorConfiguration(destinationLabel, new TransportConfiguration(InVMConnectorFactory.class.getName(), generateInVMParams(destination)))
+                                                                   .addConnectorConfiguration(sourceLabel, new TransportConfiguration(InVMConnectorFactory.class.getName(), generateInVMParams(source)))
+                                                                   .addClusterConfiguration(new ClusterConnectionConfiguration().setName(destinationLabel)
+                                                                                                                                // TODO should this be changed?
+                                                                                                                                .setAddress("jms")
+                                                                                                                                .setConnectorName(sourceLabel)
+                                                                                                                                .setRetryInterval(250)
+                                                                                                                                .setMaxHops(MAX_HOPS)
+                                                                                                                                .setConfirmationWindowSize(1024)
+                                                                                                                                .setMessageLoadBalancingType(MessageLoadBalancingType.ON_DEMAND)
+                                                                                                                                .setStaticConnectors(new ArrayList<String>() {
+                                                                                                                                   {
+                                                                                                                                      add(destinationLabel);
+                                                                                                                                   }
+                                                                                                                                }));
 
       configuration.getAddressesSettings().put("#", new AddressSettings().setRedistributionDelay(0));
 


[06/48] activemq-artemis git commit: Fix ActiveMQDynamicProducerResourceTest

Posted by jb...@apache.org.
Fix ActiveMQDynamicProducerResourceTest


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

Branch: refs/heads/ARTEMIS-780
Commit: f51f4356cc75274915ea4cd760674a4447a4c849
Parents: d4a54af
Author: jbertram <jb...@apache.com>
Authored: Mon Nov 14 12:02:05 2016 -0600
Committer: jbertram <jb...@apache.com>
Committed: Tue Nov 15 10:36:42 2016 -0600

----------------------------------------------------------------------
 .../artemis/core/postoffice/impl/SimpleAddressManager.java     | 1 +
 .../activemq/artemis/core/server/impl/ActiveMQServerImpl.java  | 6 +-----
 2 files changed, 2 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f51f4356/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/SimpleAddressManager.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/SimpleAddressManager.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/SimpleAddressManager.java
index 6ed2564..bfdfb8a 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/SimpleAddressManager.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/SimpleAddressManager.java
@@ -29,6 +29,7 @@ import org.apache.activemq.artemis.core.postoffice.Binding;
 import org.apache.activemq.artemis.core.postoffice.Bindings;
 import org.apache.activemq.artemis.core.postoffice.BindingsFactory;
 import org.apache.activemq.artemis.core.server.ActiveMQMessageBundle;
+import org.apache.activemq.artemis.core.server.ActiveMQServerLogger;
 import org.apache.activemq.artemis.core.server.impl.AddressInfo;
 import org.apache.activemq.artemis.core.transaction.Transaction;
 import org.jboss.logging.Logger;

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f51f4356/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
index 28622a5..a4c139b 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
@@ -641,11 +641,7 @@ public class ActiveMQServerImpl implements ActiveMQServer {
          }
       }
 
-      if (autoCreateJmsTopics) {
-         putAddressInfoIfAbsent(new AddressInfo(address));
-      }
-
-      return new BindingQueryResult(getAddressInfo(address) != null, names, autoCreateJmsQueues, autoCreateJmsTopics);
+      return new BindingQueryResult(!names.isEmpty(), names, autoCreateJmsQueues, autoCreateJmsTopics);
    }
 
    @Override


[36/48] activemq-artemis git commit: Fix AddressingTest

Posted by jb...@apache.org.
Fix AddressingTest


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

Branch: refs/heads/ARTEMIS-780
Commit: 5a4a4c99c06052c9051fcb05d00258bb4e113559
Parents: aefdc67
Author: jbertram <jb...@apache.com>
Authored: Mon Nov 21 17:05:24 2016 -0600
Committer: jbertram <jb...@apache.com>
Committed: Wed Nov 23 09:04:36 2016 -0600

----------------------------------------------------------------------
 .../artemis/tests/integration/addressing/AddressingTest.java   | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/5a4a4c99/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/addressing/AddressingTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/addressing/AddressingTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/addressing/AddressingTest.java
index 827e1b3..69d8675 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/addressing/AddressingTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/addressing/AddressingTest.java
@@ -229,7 +229,7 @@ public class AddressingTest extends ActiveMQTestBase {
       SimpleString queueName = SimpleString.toSimpleString(UUID.randomUUID().toString());
       // For each address, create 2 Queues with the same address, assert both queues receive message
       boolean deleteOnNoConsumers = true;
-      Queue q1 = server.createQueue(address, queueName, null, true, false, null, deleteOnNoConsumers, false);
+      Queue q1 = server.createQueue(address, queueName, null, true, false, null, deleteOnNoConsumers, true);
 
       ClientSession session = sessionFactory.createSession();
       session.start();
@@ -246,7 +246,7 @@ public class AddressingTest extends ActiveMQTestBase {
       SimpleString queueName = SimpleString.toSimpleString(UUID.randomUUID().toString());
       // For each address, create 2 Queues with the same address, assert both queues receive message
       boolean deleteOnNoConsumers = false;
-      Queue q1 = server.createQueue(address, queueName, null, true, false, null, deleteOnNoConsumers, false);
+      Queue q1 = server.createQueue(address, queueName, null, true, false, null, deleteOnNoConsumers, true);
 
       ClientSession session = sessionFactory.createSession();
       session.start();
@@ -263,7 +263,7 @@ public class AddressingTest extends ActiveMQTestBase {
       SimpleString queueName = SimpleString.toSimpleString(UUID.randomUUID().toString());
       // For each address, create 2 Queues with the same address, assert both queues receive message
       boolean deleteOnNoConsumers = false;
-      Queue q1 = server.createQueue(address, queueName, null, true, false, 0, deleteOnNoConsumers, false);
+      Queue q1 = server.createQueue(address, queueName, null, true, false, 0, deleteOnNoConsumers, true);
 
       Exception expectedException = null;
       String expectedMessage = "Maximum Consumer Limit Reached on Queue";


[02/48] activemq-artemis git commit: remove unwanted tests

Posted by jb...@apache.org.
remove unwanted tests


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

Branch: refs/heads/ARTEMIS-780
Commit: dca82a6273dfd7398adb7d66fd784fff030a56f0
Parents: a25a8c4
Author: Andy Taylor <an...@gmail.com>
Authored: Thu Nov 10 10:13:45 2016 +0000
Committer: Andy Taylor <an...@gmail.com>
Committed: Tue Nov 15 10:47:04 2016 +0000

----------------------------------------------------------------------
 .../server/management/JMSMessagingProxy.java    |  95 ----
 .../management/TopicControlUsingJMSTest.java    | 436 -------------------
 2 files changed, 531 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dca82a62/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/server/management/JMSMessagingProxy.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/server/management/JMSMessagingProxy.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/server/management/JMSMessagingProxy.java
deleted file mode 100644
index 1e33e91..0000000
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/server/management/JMSMessagingProxy.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.activemq.artemis.tests.integration.jms.server.management;
-
-import javax.jms.Message;
-import javax.jms.Queue;
-import javax.jms.QueueRequestor;
-import javax.jms.QueueSession;
-import javax.jms.Session;
-
-import org.apache.activemq.artemis.api.jms.management.JMSManagementHelper;
-
-public class JMSMessagingProxy {
-
-   // Constants -----------------------------------------------------
-
-   // Attributes ----------------------------------------------------
-
-   private final String resourceName;
-
-   private final Session session;
-
-   private final QueueRequestor requestor;
-
-   // Static --------------------------------------------------------
-
-   // Constructors --------------------------------------------------
-
-   public JMSMessagingProxy(final QueueSession session,
-                            final Queue managementQueue,
-                            final String resourceName) throws Exception {
-      this.session = session;
-
-      this.resourceName = resourceName;
-
-      requestor = new QueueRequestor(session, managementQueue);
-   }
-
-   // Public --------------------------------------------------------
-
-   // Package protected ---------------------------------------------
-
-   // Protected -----------------------------------------------------
-
-   public Object retrieveAttributeValue(final String attributeName) {
-      return retrieveAttributeValue(attributeName, null);
-   }
-
-   public Object retrieveAttributeValue(final String attributeName, final Class desiredType) {
-      try {
-         Message m = session.createMessage();
-         JMSManagementHelper.putAttribute(m, resourceName, attributeName);
-         Message reply = requestor.request(m);
-         return JMSManagementHelper.getResult(reply, desiredType);
-      } catch (Exception e) {
-         throw new IllegalStateException(e);
-      }
-   }
-
-   public Object invokeOperation(final String operationName, final Object... args) throws Exception {
-      return invokeOperation(null, operationName, args);
-   }
-
-   public Object invokeOperation(final Class desiredType,
-                                 final String operationName,
-                                 final Object... args) throws Exception {
-      Message m = session.createMessage();
-      JMSManagementHelper.putOperationInvocation(m, resourceName, operationName, args);
-      Message reply = requestor.request(m);
-      if (JMSManagementHelper.hasOperationSucceeded(reply)) {
-         return JMSManagementHelper.getResult(reply, desiredType);
-      } else {
-         throw new Exception((String) JMSManagementHelper.getResult(reply));
-      }
-   }
-
-   // Private -------------------------------------------------------
-
-   // Inner classes -------------------------------------------------
-
-}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dca82a62/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/server/management/TopicControlUsingJMSTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/server/management/TopicControlUsingJMSTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/server/management/TopicControlUsingJMSTest.java
deleted file mode 100644
index 54c79cc..0000000
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/server/management/TopicControlUsingJMSTest.java
+++ /dev/null
@@ -1,436 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.activemq.artemis.tests.integration.jms.server.management;
-
-import javax.jms.Connection;
-import javax.jms.Message;
-import javax.jms.MessageConsumer;
-import javax.jms.QueueConnection;
-import javax.jms.QueueSession;
-import javax.jms.Session;
-import javax.jms.TopicSubscriber;
-
-import org.apache.activemq.artemis.api.core.TransportConfiguration;
-import org.apache.activemq.artemis.api.jms.ActiveMQJMSClient;
-import org.apache.activemq.artemis.api.jms.JMSFactoryType;
-import org.apache.activemq.artemis.core.config.Configuration;
-import org.apache.activemq.artemis.core.registry.JndiBindingRegistry;
-import org.apache.activemq.artemis.core.remoting.impl.invm.InVMConnectorFactory;
-import org.apache.activemq.artemis.core.server.ActiveMQServer;
-import org.apache.activemq.artemis.core.server.ActiveMQServers;
-import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
-import org.apache.activemq.artemis.jms.client.ActiveMQDestination;
-import org.apache.activemq.artemis.jms.client.ActiveMQQueue;
-import org.apache.activemq.artemis.jms.client.ActiveMQTopic;
-import org.apache.activemq.artemis.jms.server.impl.JMSServerManagerImpl;
-import org.apache.activemq.artemis.tests.integration.management.ManagementTestBase;
-import org.apache.activemq.artemis.tests.unit.util.InVMNamingContext;
-import org.apache.activemq.artemis.utils.RandomUtil;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
-
-import static org.apache.activemq.artemis.tests.util.RandomUtil.randomString;
-
-public class TopicControlUsingJMSTest extends ManagementTestBase {
-
-   // Constants -----------------------------------------------------
-
-   // Attributes ----------------------------------------------------
-
-   private ActiveMQServer server;
-
-   private JMSServerManagerImpl serverManager;
-
-   private String clientID;
-
-   private String subscriptionName;
-
-   protected ActiveMQTopic topic;
-
-   protected JMSMessagingProxy proxy;
-
-   private QueueConnection connection;
-
-   private QueueSession session;
-
-   private final String topicBinding = "/topic/" + randomString();
-
-   // Static --------------------------------------------------------
-
-   // Constructors --------------------------------------------------
-
-   // Public --------------------------------------------------------
-
-   @Test
-   public void testGetAttributes() throws Exception {
-      Assert.assertEquals(topic.getTopicName(), proxy.retrieveAttributeValue("name"));
-      Assert.assertEquals(topic.getAddress(), proxy.retrieveAttributeValue("address"));
-      Assert.assertEquals(topic.isTemporary(), proxy.retrieveAttributeValue("temporary"));
-      Object[] bindings = (Object[]) proxy.retrieveAttributeValue("" + "RegistryBindings");
-      assertEquals(1, bindings.length);
-      Assert.assertEquals(topicBinding, bindings[0]);
-   }
-
-   @Test
-   public void testGetXXXSubscriptionsCount() throws Exception {
-      Connection connection_1 = JMSUtil.createConnection(InVMConnectorFactory.class.getName());
-
-      // 1 non-durable subscriber, 2 durable subscribers
-      JMSUtil.createConsumer(connection_1, topic);
-
-      Connection connection_2 = JMSUtil.createConnection(InVMConnectorFactory.class.getName());
-      JMSUtil.createDurableSubscriber(connection_2, topic, clientID, subscriptionName);
-      Connection connection_3 = JMSUtil.createConnection(InVMConnectorFactory.class.getName());
-      JMSUtil.createDurableSubscriber(connection_3, topic, clientID + "2", subscriptionName + "2");
-
-      Assert.assertEquals(3, proxy.retrieveAttributeValue("subscriptionCount", Integer.class));
-      Assert.assertEquals(1, proxy.retrieveAttributeValue("nonDurableSubscriptionCount", Integer.class));
-      Assert.assertEquals(2, proxy.retrieveAttributeValue("durableSubscriptionCount", Integer.class));
-
-      connection_1.close();
-      connection_2.close();
-      connection_3.close();
-   }
-
-   @Test
-   public void testGetXXXMessagesCount() throws Exception {
-      // 1 non-durable subscriber, 2 durable subscribers
-      Connection connection_1 = JMSUtil.createConnection(InVMConnectorFactory.class.getName());
-      JMSUtil.createConsumer(connection_1, topic);
-      Connection connection_2 = JMSUtil.createConnection(InVMConnectorFactory.class.getName());
-      JMSUtil.createDurableSubscriber(connection_2, topic, clientID, subscriptionName);
-      Connection connection_3 = JMSUtil.createConnection(InVMConnectorFactory.class.getName());
-      JMSUtil.createDurableSubscriber(connection_3, topic, clientID + "2", subscriptionName + "2");
-
-      Assert.assertEquals(0L, proxy.retrieveAttributeValue("messageCount", Long.class));
-      Assert.assertEquals(0, proxy.retrieveAttributeValue("nonDurableMessageCount", Integer.class));
-      Assert.assertEquals(0, proxy.retrieveAttributeValue("durableMessageCount", Integer.class));
-
-      JMSUtil.sendMessages(topic, 2);
-
-      waitForAttributeEqualsValue("messageCount", 3L * 2L, 3000, Long.class);
-      waitForAttributeEqualsValue("nonDurableMessageCount", 1 * 2, 3000, Integer.class);
-      waitForAttributeEqualsValue("durableMessageCount", 2 * 2, 3000, Integer.class);
-
-      connection_1.close();
-      connection_2.close();
-      connection_3.close();
-   }
-
-   @Test
-   public void testListXXXSubscriptionsCount() throws Exception {
-      // 1 non-durable subscriber, 2 durable subscribers
-      Connection connection_1 = JMSUtil.createConnection(InVMConnectorFactory.class.getName());
-      JMSUtil.createConsumer(connection_1, topic);
-      Connection connection_2 = JMSUtil.createConnection(InVMConnectorFactory.class.getName());
-      JMSUtil.createDurableSubscriber(connection_2, topic, clientID, subscriptionName);
-      Connection connection_3 = JMSUtil.createConnection(InVMConnectorFactory.class.getName());
-      JMSUtil.createDurableSubscriber(connection_3, topic, clientID + "2", subscriptionName + "2");
-
-      Assert.assertEquals(3, ((Object[]) proxy.invokeOperation("listAllSubscriptions")).length);
-      Assert.assertEquals(1, ((Object[]) proxy.invokeOperation("listNonDurableSubscriptions")).length);
-      Assert.assertEquals(2, ((Object[]) proxy.invokeOperation("listDurableSubscriptions")).length);
-
-      connection_1.close();
-      connection_2.close();
-      connection_3.close();
-   }
-
-   @Test
-   public void testCountMessagesForSubscription() throws Exception {
-      String key = "key";
-      long matchingValue = RandomUtil.randomLong();
-      long unmatchingValue = matchingValue + 1;
-
-      Connection connection = JMSUtil.createConnection(InVMConnectorFactory.class.getName());
-      JMSUtil.createDurableSubscriber(connection, topic, clientID, subscriptionName);
-
-      Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
-      JMSUtil.sendMessageWithProperty(session, topic, key, matchingValue);
-      JMSUtil.sendMessageWithProperty(session, topic, key, unmatchingValue);
-      JMSUtil.sendMessageWithProperty(session, topic, key, matchingValue);
-
-      waitForAttributeEqualsValue("messageCount", 3L, 3000, Long.class);
-
-      Assert.assertEquals(2, proxy.invokeOperation(Integer.class, "countMessagesForSubscription", clientID, subscriptionName, key + " =" +
-         matchingValue));
-      Assert.assertEquals(1, proxy.invokeOperation(Integer.class, "countMessagesForSubscription", clientID, subscriptionName, key + " =" +
-         unmatchingValue));
-
-      connection.close();
-   }
-
-   @Test
-   public void testCountMessagesForUnknownSubscription() throws Exception {
-      String unknownSubscription = RandomUtil.randomString();
-
-      try {
-         proxy.invokeOperation("countMessagesForSubscription", clientID, unknownSubscription, null);
-         Assert.fail();
-      } catch (Exception e) {
-      }
-   }
-
-   @Test
-   public void testCountMessagesForUnknownClientID() throws Exception {
-      String unknownClientID = RandomUtil.randomString();
-
-      try {
-         proxy.invokeOperation("countMessagesForSubscription", unknownClientID, subscriptionName, null);
-         Assert.fail();
-      } catch (Exception e) {
-      }
-   }
-
-   @Test
-   public void testDropDurableSubscriptionWithExistingSubscription() throws Exception {
-      Connection connection = JMSUtil.createConnection(InVMConnectorFactory.class.getName());
-
-      JMSUtil.createDurableSubscriber(connection, topic, clientID, subscriptionName);
-
-      Assert.assertEquals(1, proxy.retrieveAttributeValue("durableSubscriptionCount", Integer.class));
-
-      connection.close();
-
-      proxy.invokeOperation("dropDurableSubscription", clientID, subscriptionName);
-
-      Assert.assertEquals(0, proxy.retrieveAttributeValue("durableSubscriptionCount", Integer.class));
-   }
-
-   @Test
-   public void testDropDurableSubscriptionWithUnknownSubscription() throws Exception {
-      Connection connection = JMSUtil.createConnection(InVMConnectorFactory.class.getName());
-
-      JMSUtil.createDurableSubscriber(connection, topic, clientID, subscriptionName);
-
-      Assert.assertEquals(1, proxy.retrieveAttributeValue("durableSubscriptionCount", Integer.class));
-
-      try {
-         proxy.invokeOperation("dropDurableSubscription", clientID, "this subscription does not exist");
-         Assert.fail("should throw an exception");
-      } catch (Exception e) {
-
-      }
-
-      Assert.assertEquals(1, proxy.retrieveAttributeValue("durableSubscriptionCount", Integer.class));
-
-      connection.close();
-   }
-
-   @Test
-   public void testDropAllSubscriptions() throws Exception {
-      Connection connection_1 = JMSUtil.createConnection(InVMConnectorFactory.class.getName());
-      TopicSubscriber durableSubscriber_1 = JMSUtil.createDurableSubscriber(connection_1, topic, clientID, subscriptionName);
-      Connection connection_2 = JMSUtil.createConnection(InVMConnectorFactory.class.getName());
-      TopicSubscriber durableSubscriber_2 = JMSUtil.createDurableSubscriber(connection_2, topic, clientID + "2", subscriptionName + "2");
-
-      Assert.assertEquals(2, proxy.retrieveAttributeValue("subscriptionCount", Integer.class));
-
-      durableSubscriber_1.close();
-      durableSubscriber_2.close();
-
-      Assert.assertEquals(2, proxy.retrieveAttributeValue("subscriptionCount", Integer.class));
-      proxy.invokeOperation("dropAllSubscriptions");
-
-      Assert.assertEquals(0, proxy.retrieveAttributeValue("subscriptionCount", Integer.class));
-
-      connection_1.close();
-      connection_2.close();
-   }
-
-   @Test
-   public void testRemoveAllMessages() throws Exception {
-      Connection connection_1 = JMSUtil.createConnection(InVMConnectorFactory.class.getName());
-      JMSUtil.createDurableSubscriber(connection_1, topic, clientID, subscriptionName);
-      Connection connection_2 = JMSUtil.createConnection(InVMConnectorFactory.class.getName());
-      JMSUtil.createDurableSubscriber(connection_2, topic, clientID + "2", subscriptionName + "2");
-
-      JMSUtil.sendMessages(topic, 3);
-
-      waitForAttributeEqualsValue("messageCount", 3L * 2L, 3000, Long.class);
-
-      int removedCount = (Integer) proxy.invokeOperation(Integer.class, "removeMessages", "");
-      Assert.assertEquals(3 * 2, removedCount);
-      Assert.assertEquals(0L, proxy.retrieveAttributeValue("messageCount", Long.class));
-
-      connection_1.close();
-      connection_2.close();
-   }
-
-   @Test
-   public void testListMessagesForSubscription() throws Exception {
-      Connection connection = JMSUtil.createConnection(InVMConnectorFactory.class.getName());
-
-      JMSUtil.createDurableSubscriber(connection, topic, clientID, subscriptionName);
-
-      JMSUtil.sendMessages(topic, 3);
-
-      Object[] data = (Object[]) proxy.invokeOperation("listMessagesForSubscription", ActiveMQDestination.createQueueNameForDurableSubscription(true, clientID, subscriptionName));
-      Assert.assertEquals(3, data.length);
-
-      connection.close();
-   }
-
-   @Test
-   public void testListMessagesForSubscriptionWithUnknownClientID() throws Exception {
-      String unknownClientID = RandomUtil.randomString();
-
-      try {
-         proxy.invokeOperation("listMessagesForSubscription", ActiveMQDestination.createQueueNameForDurableSubscription(true, unknownClientID, subscriptionName));
-         Assert.fail();
-      } catch (Exception e) {
-      }
-   }
-
-   @Test
-   public void testListMessagesForSubscriptionWithUnknownSubscription() throws Exception {
-      String unknownSubscription = RandomUtil.randomString();
-
-      try {
-         proxy.invokeOperation("listMessagesForSubscription", ActiveMQDestination.createQueueNameForDurableSubscription(true, clientID, unknownSubscription));
-         Assert.fail();
-      } catch (Exception e) {
-      }
-   }
-
-   @Test
-   public void testGetMessagesAdded() throws Exception {
-      Connection connection_1 = JMSUtil.createConnection(InVMConnectorFactory.class.getName());
-      JMSUtil.createConsumer(connection_1, topic);
-      Connection connection_2 = JMSUtil.createConnection(InVMConnectorFactory.class.getName());
-      JMSUtil.createDurableSubscriber(connection_2, topic, clientID, subscriptionName);
-      Connection connection_3 = JMSUtil.createConnection(InVMConnectorFactory.class.getName());
-      JMSUtil.createDurableSubscriber(connection_3, topic, clientID + "2", subscriptionName + "2");
-
-      assertEquals(0, proxy.retrieveAttributeValue("messagesAdded", Integer.class));
-
-      JMSUtil.sendMessages(topic, 2);
-
-      waitForAttributeEqualsValue("messagesAdded", 3L * 2L, 3000, Long.class);
-
-      connection_1.close();
-      connection_2.close();
-      connection_3.close();
-   }
-
-   @Test
-   public void testGetMessagesDelivering() throws Exception {
-      Connection connection_1 = JMSUtil.createConnection(InVMConnectorFactory.class.getName());
-      MessageConsumer cons_1 = JMSUtil.createConsumer(connection_1, topic, Session.CLIENT_ACKNOWLEDGE);
-      Connection connection_2 = JMSUtil.createConnection(InVMConnectorFactory.class.getName());
-      MessageConsumer cons_2 = JMSUtil.createDurableSubscriber(connection_2, topic, clientID, subscriptionName, Session.CLIENT_ACKNOWLEDGE);
-      Connection connection_3 = JMSUtil.createConnection(InVMConnectorFactory.class.getName());
-      MessageConsumer cons_3 = JMSUtil.createDurableSubscriber(connection_3, topic, clientID + "2", subscriptionName + "2", Session.CLIENT_ACKNOWLEDGE);
-
-      assertEquals(0, proxy.retrieveAttributeValue("deliveringCount", Integer.class));
-
-      JMSUtil.sendMessages(topic, 2);
-
-      assertEquals(0, proxy.retrieveAttributeValue("deliveringCount", Integer.class));
-
-      connection_1.start();
-      connection_2.start();
-      connection_3.start();
-
-      Message msg_1 = null;
-      Message msg_2 = null;
-      Message msg_3 = null;
-      for (int i = 0; i < 2; i++) {
-         msg_1 = cons_1.receive(5000);
-         assertNotNull(msg_1);
-         msg_2 = cons_2.receive(5000);
-         assertNotNull(msg_2);
-         msg_3 = cons_3.receive(5000);
-         assertNotNull(msg_3);
-      }
-
-      assertEquals(3 * 2, proxy.retrieveAttributeValue("deliveringCount", Integer.class));
-
-      msg_1.acknowledge();
-      assertEquals(2 * 2, proxy.retrieveAttributeValue("deliveringCount", Integer.class));
-      msg_2.acknowledge();
-      assertEquals(1 * 2, proxy.retrieveAttributeValue("deliveringCount", Integer.class));
-      msg_3.acknowledge();
-      assertEquals(0, proxy.retrieveAttributeValue("deliveringCount", Integer.class));
-
-      connection_1.close();
-      connection_2.close();
-      connection_3.close();
-   }
-
-   // Package protected ---------------------------------------------
-
-   // Protected -----------------------------------------------------
-
-   @Override
-   @Before
-   public void setUp() throws Exception {
-      super.setUp();
-
-      Configuration config = createDefaultInVMConfig().setJMXManagementEnabled(true);
-      server = addServer(ActiveMQServers.newActiveMQServer(config, mbeanServer, false));
-      server.start();
-
-      serverManager = new JMSServerManagerImpl(server);
-      serverManager.start();
-      serverManager.setRegistry(new JndiBindingRegistry(new InVMNamingContext()));
-      serverManager.activated();
-
-      clientID = RandomUtil.randomString();
-      subscriptionName = RandomUtil.randomString();
-
-      String topicName = RandomUtil.randomString();
-      serverManager.createTopic(false, topicName, topicBinding);
-      topic = (ActiveMQTopic) ActiveMQJMSClient.createTopic(topicName);
-
-      ActiveMQConnectionFactory cf = ActiveMQJMSClient.createConnectionFactoryWithoutHA(JMSFactoryType.CF, new TransportConfiguration(INVM_CONNECTOR_FACTORY));
-      connection = cf.createQueueConnection();
-      session = connection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
-      connection.start();
-
-      ActiveMQQueue managementQueue = (ActiveMQQueue) ActiveMQJMSClient.createQueue("activemq.management");
-      proxy = new JMSMessagingProxy(session, managementQueue, topic.getTopicName());
-   }
-
-   // Private -------------------------------------------------------
-
-   private void waitForAttributeEqualsValue(String attribute, Object expected, long timeout) throws Exception {
-      waitForAttributeEqualsValue(attribute, expected, timeout, null);
-   }
-
-   private void waitForAttributeEqualsValue(String attribute,
-                                            Object expected,
-                                            long timeout,
-                                            Class desiredType) throws Exception {
-      long timeToWait = System.currentTimeMillis() + timeout;
-      Object actual = null;
-
-      while (System.currentTimeMillis() < timeToWait) {
-         actual = proxy.retrieveAttributeValue(attribute, desiredType);
-         if (expected.equals(actual)) {
-            return;
-         }
-         Thread.sleep(100);
-      }
-      Assert.assertEquals(expected, actual);
-   }
-
-   // Inner classes -------------------------------------------------
-
-}


[28/48] activemq-artemis git commit: Fix Joram tests

Posted by jb...@apache.org.
Fix Joram tests


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

Branch: refs/heads/ARTEMIS-780
Commit: 62a5cfd1204f69616dcb140fe2369026379cb4d8
Parents: edc947d
Author: jbertram <jb...@apache.com>
Authored: Sat Nov 19 11:03:20 2016 -0600
Committer: jbertram <jb...@apache.com>
Committed: Wed Nov 23 09:04:35 2016 -0600

----------------------------------------------------------------------
 .../impl/journal/AbstractJournalStorageManager.java    |  1 +
 .../artemis/core/postoffice/impl/PostOfficeImpl.java   |  3 +--
 .../artemis/core/server/impl/ActiveMQServerImpl.java   | 13 +++++++++----
 .../activemq/artemis/core/server/impl/AddressInfo.java | 11 +++++++++++
 .../jtests/jms/conform/session/TopicSessionTest.java   |  2 ++
 5 files changed, 24 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/62a5cfd1/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/AbstractJournalStorageManager.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/AbstractJournalStorageManager.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/AbstractJournalStorageManager.java
index b4247ae..ee40f4e 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/AbstractJournalStorageManager.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/AbstractJournalStorageManager.java
@@ -1278,6 +1278,7 @@ public abstract class AbstractJournalStorageManager implements StorageManager {
       try {
          long recordID = idGenerator.generateID();
          bindingEncoding.setId(recordID);
+         addressInfo.setId(recordID);
          bindingsJournal.appendAddRecordTransactional(tx, recordID, JournalRecordIds.ADDRESS_BINDING_RECORD, bindingEncoding);
       } finally {
          readUnLock();

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/62a5cfd1/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 1c0c343..dc73680 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
@@ -450,8 +450,7 @@ public class PostOfficeImpl implements PostOffice, NotificationListener, Binding
       synchronized (addressLock) {
          Bindings bindingsForAddress = getBindingsForAddress(address);
          if (bindingsForAddress.getBindings().size() > 0) {
-            return null;
-//            throw new IllegalStateException("Address has bindings");
+            throw ActiveMQMessageBundle.BUNDLE.addressHasBindings(address);
          }
          managementService.unregisterAddress(address);
          return addressManager.removeAddressInfo(address);

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/62a5cfd1/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
index b865361..16dccbb 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
@@ -2271,6 +2271,11 @@ public class ActiveMQServerImpl implements ActiveMQServer {
       if (putAddressInfoIfAbsent(addressInfo) != null) {
          throw ActiveMQMessageBundle.BUNDLE.addressAlreadyExists(addressInfo.getName());
       }
+
+      // TODO: is this the right way to do this?
+      long txID = storageManager.generateID();
+      storageManager.addAddressBinding(txID, addressInfo);
+      storageManager.commitBindings(txID);
    }
 
    @Override
@@ -2292,10 +2297,9 @@ public class ActiveMQServerImpl implements ActiveMQServer {
       }
 
       // TODO: is this the right way to do this?
-      //      long txID = storageManager.generateID();
-      //      storageManager.deleteAddressBinding(txID, getAddressInfo(address).getID());
-      //      storageManager.commitBindings(txID);
-
+      long txID = storageManager.generateID();
+      storageManager.deleteAddressBinding(txID, getAddressInfo(address).getId());
+      storageManager.commitBindings(txID);
    }
 
    @Override
@@ -2347,6 +2351,7 @@ public class ActiveMQServerImpl implements ActiveMQServer {
 
       final long txID = storageManager.generateID();
       final long queueID = storageManager.generateID();
+      final long addressID = storageManager.generateID();
 
       final QueueConfig.Builder queueConfigBuilder;
       if (addressName == null) {

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/62a5cfd1/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/AddressInfo.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/AddressInfo.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/AddressInfo.java
index a92e8d3..9653a4e 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/AddressInfo.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/AddressInfo.java
@@ -21,6 +21,8 @@ import org.apache.activemq.artemis.api.core.SimpleString;
 
 public class AddressInfo {
 
+   private long id;
+
    private final SimpleString name;
 
    private RoutingType routingType = RoutingType.MULTICAST;
@@ -84,10 +86,19 @@ public class AddressInfo {
       return name;
    }
 
+   public void setId(long id) {
+      this.id = id;
+   }
+
+   public long getId() {
+      return id;
+   }
+
    @Override
    public String toString() {
       StringBuffer buff = new StringBuffer();
       buff.append("Address [name=" + name);
+      buff.append(", id=" + id);
       buff.append(", routingType=" + routingType);
       buff.append(", defaultMaxQueueConsumers=" + defaultMaxQueueConsumers);
       buff.append(", defaultDeleteOnNoConsumers=" + defaultDeleteOnNoConsumers);

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/62a5cfd1/tests/joram-tests/src/test/java/org/objectweb/jtests/jms/conform/session/TopicSessionTest.java
----------------------------------------------------------------------
diff --git a/tests/joram-tests/src/test/java/org/objectweb/jtests/jms/conform/session/TopicSessionTest.java b/tests/joram-tests/src/test/java/org/objectweb/jtests/jms/conform/session/TopicSessionTest.java
index 7ad6c76..6eab31d 100644
--- a/tests/joram-tests/src/test/java/org/objectweb/jtests/jms/conform/session/TopicSessionTest.java
+++ b/tests/joram-tests/src/test/java/org/objectweb/jtests/jms/conform/session/TopicSessionTest.java
@@ -115,6 +115,8 @@ public class TopicSessionTest extends PubSubTestCase {
          TextMessage m = (TextMessage) subscriber.receive(TestConfig.TIMEOUT);
          Assert.assertTrue(m != null);
          Assert.assertEquals("test", m.getText());
+         subscriber.close();
+         subscriberSession.unsubscribe("testTopic");
       } catch (JMSException e) {
          fail(e);
       }


[30/48] activemq-artemis git commit: Add deleteAddress role

Posted by jb...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b7e7492b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/StompTestBase.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/StompTestBase.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/StompTestBase.java
index dbe2762..2cde849 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/StompTestBase.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/StompTestBase.java
@@ -177,7 +177,7 @@ public abstract class StompTestBase extends ActiveMQTestBase {
          securityManager.getConfiguration().addRole(defUser, role);
          config.getSecurityRoles().put("#", new HashSet<Role>() {
             {
-               add(new Role(role, true, true, true, true, true, true, true, true, true));
+               add(new Role(role, true, true, true, true, true, true, true, true, true, true));
             }
          });
       }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b7e7492b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/security/impl/ActiveMQSecurityManagerImplTest.java
----------------------------------------------------------------------
diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/security/impl/ActiveMQSecurityManagerImplTest.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/security/impl/ActiveMQSecurityManagerImplTest.java
index 0df0e89..eccdb5f 100644
--- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/security/impl/ActiveMQSecurityManagerImplTest.java
+++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/security/impl/ActiveMQSecurityManagerImplTest.java
@@ -59,22 +59,22 @@ public class ActiveMQSecurityManagerImplTest extends ActiveMQTestBase {
       Assert.assertTrue(securityManager.validateUser("guest", "password"));
       Assert.assertFalse(securityManager.validateUser(null, "wrongpass"));
       HashSet<Role> roles = new HashSet<>();
-      roles.add(new Role("guest", true, true, true, true, true, true, true, true, true));
+      roles.add(new Role("guest", true, true, true, true, true, true, true, true, true, true));
       Assert.assertTrue(securityManager.validateUserAndRole(null, null, roles, CheckType.CREATE_DURABLE_QUEUE));
       Assert.assertTrue(securityManager.validateUserAndRole(null, null, roles, CheckType.SEND));
       Assert.assertTrue(securityManager.validateUserAndRole(null, null, roles, CheckType.CONSUME));
       roles = new HashSet<>();
-      roles.add(new Role("guest", true, true, false, true, true, true, true, true, true));
+      roles.add(new Role("guest", true, true, false, true, true, true, true, true, true, true));
       Assert.assertFalse(securityManager.validateUserAndRole(null, null, roles, CheckType.CREATE_DURABLE_QUEUE));
       Assert.assertTrue(securityManager.validateUserAndRole(null, null, roles, CheckType.SEND));
       Assert.assertTrue(securityManager.validateUserAndRole(null, null, roles, CheckType.CONSUME));
       roles = new HashSet<>();
-      roles.add(new Role("guest", true, false, false, true, true, true, true, true, true));
+      roles.add(new Role("guest", true, false, false, true, true, true, true, true, true, true));
       Assert.assertFalse(securityManager.validateUserAndRole(null, null, roles, CheckType.CREATE_DURABLE_QUEUE));
       Assert.assertTrue(securityManager.validateUserAndRole(null, null, roles, CheckType.SEND));
       Assert.assertFalse(securityManager.validateUserAndRole(null, null, roles, CheckType.CONSUME));
       roles = new HashSet<>();
-      roles.add(new Role("guest", false, false, false, true, true, true, true, true, true));
+      roles.add(new Role("guest", false, false, false, true, true, true, true, true, true, true));
       Assert.assertFalse(securityManager.validateUserAndRole(null, null, roles, CheckType.CREATE_DURABLE_QUEUE));
       Assert.assertFalse(securityManager.validateUserAndRole(null, null, roles, CheckType.SEND));
       Assert.assertFalse(securityManager.validateUserAndRole(null, null, roles, CheckType.CONSUME));
@@ -124,19 +124,19 @@ public class ActiveMQSecurityManagerImplTest extends ActiveMQTestBase {
       securityManager.getConfiguration().addRole("newuser1", "role3");
       securityManager.getConfiguration().addRole("newuser1", "role4");
       HashSet<Role> roles = new HashSet<>();
-      roles.add(new Role("role1", true, true, true, true, true, true, true, true, true));
+      roles.add(new Role("role1", true, true, true, true, true, true, true, true, true, true));
       Assert.assertTrue(securityManager.validateUserAndRole("newuser1", "newpassword1", roles, CheckType.SEND));
       roles = new HashSet<>();
-      roles.add(new Role("role2", true, true, true, true, true, true, true, true, true));
+      roles.add(new Role("role2", true, true, true, true, true, true, true, true, true, true));
       Assert.assertTrue(securityManager.validateUserAndRole("newuser1", "newpassword1", roles, CheckType.SEND));
       roles = new HashSet<>();
-      roles.add(new Role("role3", true, true, true, true, true, true, true, true, true));
+      roles.add(new Role("role3", true, true, true, true, true, true, true, true, true, true));
       Assert.assertTrue(securityManager.validateUserAndRole("newuser1", "newpassword1", roles, CheckType.SEND));
       roles = new HashSet<>();
-      roles.add(new Role("role4", true, true, true, true, true, true, true, true, true));
+      roles.add(new Role("role4", true, true, true, true, true, true, true, true, true, true));
       Assert.assertTrue(securityManager.validateUserAndRole("newuser1", "newpassword1", roles, CheckType.SEND));
       roles = new HashSet<>();
-      roles.add(new Role("role5", true, true, true, true, true, true, true, true, true));
+      roles.add(new Role("role5", true, true, true, true, true, true, true, true, true, true));
       Assert.assertFalse(securityManager.validateUserAndRole("newuser1", "newpassword1", roles, CheckType.SEND));
    }
 
@@ -150,19 +150,19 @@ public class ActiveMQSecurityManagerImplTest extends ActiveMQTestBase {
       securityManager.getConfiguration().removeRole("newuser1", "role2");
       securityManager.getConfiguration().removeRole("newuser1", "role4");
       HashSet<Role> roles = new HashSet<>();
-      roles.add(new Role("role1", true, true, true, true, true, true, true, true, true));
+      roles.add(new Role("role1", true, true, true, true, true, true, true, true, true, true));
       Assert.assertTrue(securityManager.validateUserAndRole("newuser1", "newpassword1", roles, CheckType.SEND));
       roles = new HashSet<>();
-      roles.add(new Role("role2", true, true, true, true, true, true, true, true, true));
+      roles.add(new Role("role2", true, true, true, true, true, true, true, true, true, true));
       Assert.assertFalse(securityManager.validateUserAndRole("newuser1", "newpassword1", roles, CheckType.SEND));
       roles = new HashSet<>();
-      roles.add(new Role("role3", true, true, true, true, true, true, true, true, true));
+      roles.add(new Role("role3", true, true, true, true, true, true, true, true, true, true));
       Assert.assertTrue(securityManager.validateUserAndRole("newuser1", "newpassword1", roles, CheckType.SEND));
       roles = new HashSet<>();
-      roles.add(new Role("role4", true, true, true, true, true, true, true, true, true));
+      roles.add(new Role("role4", true, true, true, true, true, true, true, true, true, true));
       Assert.assertFalse(securityManager.validateUserAndRole("newuser1", "newpassword1", roles, CheckType.SEND));
       roles = new HashSet<>();
-      roles.add(new Role("role5", true, true, true, true, true, true, true, true, true));
+      roles.add(new Role("role5", true, true, true, true, true, true, true, true, true, true));
       Assert.assertFalse(securityManager.validateUserAndRole("newuser1", "newpassword1", roles, CheckType.SEND));
    }
 }


[12/48] activemq-artemis git commit: Fix SessionTest

Posted by jb...@apache.org.
Fix SessionTest


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

Branch: refs/heads/ARTEMIS-780
Commit: 7a15abe7438d543847a17d88863ffc72606d0866
Parents: 6afbae7
Author: jbertram <jb...@apache.com>
Authored: Mon Nov 14 17:10:01 2016 -0600
Committer: jbertram <jb...@apache.com>
Committed: Tue Nov 15 10:38:13 2016 -0600

----------------------------------------------------------------------
 .../activemq/artemis/tests/integration/client/SessionTest.java     | 2 ++
 1 file changed, 2 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/7a15abe7/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/SessionTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/SessionTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/SessionTest.java
index 2f72d8b..7f97100 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/SessionTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/SessionTest.java
@@ -34,6 +34,7 @@ import org.apache.activemq.artemis.core.client.impl.ClientSessionFactoryInternal
 import org.apache.activemq.artemis.core.client.impl.ClientSessionInternal;
 import org.apache.activemq.artemis.core.server.ActiveMQServer;
 import org.apache.activemq.artemis.core.server.Queue;
+import org.apache.activemq.artemis.core.settings.impl.AddressSettings;
 import org.apache.activemq.artemis.spi.core.protocol.RemotingConnection;
 import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
 import org.apache.activemq.artemis.tests.util.CountDownSessionFailureListener;
@@ -228,6 +229,7 @@ public class SessionTest extends ActiveMQTestBase {
 
    @Test
    public void testQueueQueryNoQ() throws Exception {
+      server.getAddressSettingsRepository().addMatch("#", new AddressSettings().setAutoCreateJmsQueues(false));
       cf = createSessionFactory(locator);
       ClientSession clientSession = cf.createSession(false, true, true);
       QueueQuery resp = clientSession.queueQuery(new SimpleString(queueName));


[19/48] activemq-artemis git commit: Fix StompV12Test.testHeaderRepetitive

Posted by jb...@apache.org.
Fix StompV12Test.testHeaderRepetitive


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

Branch: refs/heads/ARTEMIS-780
Commit: 1e7b0ed6fafc5d58e3ce6f98d100eedb2cfb4002
Parents: 2f54575
Author: jbertram <jb...@apache.com>
Authored: Tue Nov 15 17:16:40 2016 -0600
Committer: jbertram <jb...@apache.com>
Committed: Wed Nov 23 09:04:34 2016 -0600

----------------------------------------------------------------------
 .../artemis/tests/integration/stomp/v12/StompV12Test.java        | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/1e7b0ed6/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/v12/StompV12Test.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/v12/StompV12Test.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/v12/StompV12Test.java
index dc8cea0..d30ba53 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/v12/StompV12Test.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/v12/StompV12Test.java
@@ -378,7 +378,7 @@ public class StompV12Test extends StompTestBase {
       //subscribe
       StompClientConnection newConn = StompClientConnectionFactory.createClientConnection("1.2", hostname, port);
       newConn.connect(defUser, defPass);
-      subscribe(newConn, "a-sub");
+      subscribe(newConn, "a-sub", null, null, true);
 
       frame = newConn.receiveFrame();
 
@@ -389,7 +389,7 @@ public class StompV12Test extends StompTestBase {
       Assert.assertEquals("value1", frame.getHeader("foo"));
 
       //unsub
-      unsubscribe(newConn, "a-sub");
+      unsubscribe(newConn, "a-sub", true);
 
       newConn.disconnect();
 


[32/48] activemq-artemis git commit: Fix examples

Posted by jb...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/07ab2001/examples/features/ha/scale-down/src/main/resources/activemq/server1/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/ha/scale-down/src/main/resources/activemq/server1/broker.xml b/examples/features/ha/scale-down/src/main/resources/activemq/server1/broker.xml
index 6211cd3..9150adf 100644
--- a/examples/features/ha/scale-down/src/main/resources/activemq/server1/broker.xml
+++ b/examples/features/ha/scale-down/src/main/resources/activemq/server1/broker.xml
@@ -68,7 +68,6 @@ under the License.
 
       <cluster-connections>
          <cluster-connection name="my-cluster">
-            <address>jms</address>
             <connector-ref>netty-connector</connector-ref>
             <retry-interval>500</retry-interval>
             <reconnect-attempts>5</reconnect-attempts>
@@ -94,7 +93,7 @@ under the License.
 
       <security-settings>
          <!--security for example queue-->
-         <security-setting match="jms.queue.exampleQueue">
+         <security-setting match="exampleQueue">
             <permission type="createDurableQueue" roles="guest"/>
             <permission type="deleteDurableQueue" roles="guest"/>
             <permission type="createNonDurableQueue" roles="guest"/>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/07ab2001/examples/features/ha/transaction-failover/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/ha/transaction-failover/src/main/resources/activemq/server0/broker.xml b/examples/features/ha/transaction-failover/src/main/resources/activemq/server0/broker.xml
index 916fdf5..ab54ff0 100644
--- a/examples/features/ha/transaction-failover/src/main/resources/activemq/server0/broker.xml
+++ b/examples/features/ha/transaction-failover/src/main/resources/activemq/server0/broker.xml
@@ -75,7 +75,6 @@ under the License.
 
       <cluster-connections>
          <cluster-connection name="my-cluster">
-            <address>jms</address>
             <connector-ref>netty-connector</connector-ref>
             <discovery-group-ref discovery-group-name="dg-group1"/>
          </cluster-connection>
@@ -84,7 +83,7 @@ under the License.
 
       <security-settings>
          <!--security for example queue-->
-         <security-setting match="jms.queue.exampleQueue">
+         <security-setting match="exampleQueue">
             <permission type="createDurableQueue" roles="guest"/>
             <permission type="deleteDurableQueue" roles="guest"/>
             <permission type="createNonDurableQueue" roles="guest"/>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/07ab2001/examples/features/ha/transaction-failover/src/main/resources/activemq/server1/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/ha/transaction-failover/src/main/resources/activemq/server1/broker.xml b/examples/features/ha/transaction-failover/src/main/resources/activemq/server1/broker.xml
index 055f04a..0407877 100644
--- a/examples/features/ha/transaction-failover/src/main/resources/activemq/server1/broker.xml
+++ b/examples/features/ha/transaction-failover/src/main/resources/activemq/server1/broker.xml
@@ -74,7 +74,6 @@ under the License.
 
       <cluster-connections>
          <cluster-connection name="my-cluster">
-            <address>jms</address>
             <connector-ref>netty-connector</connector-ref>
             <discovery-group-ref discovery-group-name="dg-group1"/>
          </cluster-connection>
@@ -84,7 +83,7 @@ under the License.
 
       <security-settings>
          <!--security for example queue-->
-         <security-setting match="jms.queue.exampleQueue">
+         <security-setting match="exampleQueue">
             <permission type="createDurableQueue" roles="guest"/>
             <permission type="deleteDurableQueue" roles="guest"/>
             <permission type="createNonDurableQueue" roles="guest"/>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/07ab2001/examples/features/standard/bridge/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/bridge/src/main/resources/activemq/server0/broker.xml b/examples/features/standard/bridge/src/main/resources/activemq/server0/broker.xml
index 8375901..ad12305 100644
--- a/examples/features/standard/bridge/src/main/resources/activemq/server0/broker.xml
+++ b/examples/features/standard/bridge/src/main/resources/activemq/server0/broker.xml
@@ -50,8 +50,8 @@ under the License.
       <!-- We need to create a core queue for the JMS queue explicitly because the bridge will be deployed
       before the JMS queue is deployed, so the first time, it otherwise won't find the queue -->
       <queues>
-         <queue name="jms.queue.sausage-factory">
-            <address>jms.queue.sausage-factory</address>
+         <queue name="sausage-factory">
+            <address>sausage-factory</address>
          </queue>
       </queues>
 
@@ -59,8 +59,8 @@ under the License.
       We specify a filter with the bridge, and a transformer too. The filter and transformer are optional -->
       <bridges>
          <bridge name="my-bridge">
-            <queue-name>jms.queue.sausage-factory</queue-name>
-            <forwarding-address>jms.queue.mincing-machine</forwarding-address>
+            <queue-name>sausage-factory</queue-name>
+            <forwarding-address>mincing-machine</forwarding-address>
             <filter string="name='aardvark'"/>
             <transformer-class-name>org.apache.activemq.artemis.jms.example.HatColourChangeTransformer</transformer-class-name>
             <reconnect-attempts>-1</reconnect-attempts>
@@ -74,7 +74,7 @@ under the License.
 
       <security-settings>
          <!--security for example queue-->
-         <security-setting match="jms.queue.#">
+         <security-setting match="#">
             <permission type="createDurableQueue" roles="guest"/>
             <permission type="deleteDurableQueue" roles="guest"/>
             <permission type="createNonDurableQueue" roles="guest"/>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/07ab2001/examples/features/standard/bridge/src/main/resources/activemq/server1/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/bridge/src/main/resources/activemq/server1/broker.xml b/examples/features/standard/bridge/src/main/resources/activemq/server1/broker.xml
index 4d6c6e5..9aa1392 100644
--- a/examples/features/standard/bridge/src/main/resources/activemq/server1/broker.xml
+++ b/examples/features/standard/bridge/src/main/resources/activemq/server1/broker.xml
@@ -45,7 +45,7 @@ under the License.
 
       <security-settings>
          <!--security for example queue-->
-         <security-setting match="jms.queue.#">
+         <security-setting match="#">
             <permission type="createDurableQueue" roles="guest"/>
             <permission type="deleteDurableQueue" roles="guest"/>
             <permission type="createNonDurableQueue" roles="guest"/>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/07ab2001/examples/features/standard/cdi/pom.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/cdi/pom.xml b/examples/features/standard/cdi/pom.xml
index e6e00ae..22915cc 100644
--- a/examples/features/standard/cdi/pom.xml
+++ b/examples/features/standard/cdi/pom.xml
@@ -137,6 +137,18 @@
                            <clientClass>org.apache.activemq.artemis.core.example.CDIExample</clientClass>
                         </configuration>
                      </execution>
+                     <execution>
+                        <id>stop</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
+                        <configuration>
+                           <ignore>${noServer}</ignore>
+                           <args>
+                              <param>stop</param>
+                           </args>
+                        </configuration>
+                     </execution>
                   </executions>
                   <dependencies>
                      <dependency>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/07ab2001/examples/features/standard/dead-letter/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/dead-letter/src/main/resources/activemq/server0/broker.xml b/examples/features/standard/dead-letter/src/main/resources/activemq/server0/broker.xml
index a7f3030..3325561 100644
--- a/examples/features/standard/dead-letter/src/main/resources/activemq/server0/broker.xml
+++ b/examples/features/standard/dead-letter/src/main/resources/activemq/server0/broker.xml
@@ -49,7 +49,7 @@ under the License.
 
       <security-settings>
          <!--security for example queue-->
-         <security-setting match="jms.#">
+         <security-setting match="#">
             <permission type="createDurableQueue" roles="guest"/>
             <permission type="deleteDurableQueue" roles="guest"/>
             <permission type="createNonDurableQueue" roles="guest"/>
@@ -61,8 +61,8 @@ under the License.
 
       <address-settings>
          <!--override the max-delivery-attempts and dead letter address for the example queue-->
-         <address-setting match="jms.queue.exampleQueue">
-            <dead-letter-address>jms.queue.deadLetterQueue</dead-letter-address>
+         <address-setting match="exampleQueue">
+            <dead-letter-address>deadLetterQueue</dead-letter-address>
             <max-delivery-attempts>3</max-delivery-attempts>
          </address-setting>
       </address-settings>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/07ab2001/examples/features/standard/delayed-redelivery/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/delayed-redelivery/src/main/resources/activemq/server0/broker.xml b/examples/features/standard/delayed-redelivery/src/main/resources/activemq/server0/broker.xml
index e4412b9..7171ad0 100644
--- a/examples/features/standard/delayed-redelivery/src/main/resources/activemq/server0/broker.xml
+++ b/examples/features/standard/delayed-redelivery/src/main/resources/activemq/server0/broker.xml
@@ -49,7 +49,7 @@ under the License.
 
       <security-settings>
          <!--security for example queue-->
-         <security-setting match="jms.#">
+         <security-setting match="#">
             <permission type="createDurableQueue" roles="guest"/>
             <permission type="deleteDurableQueue" roles="guest"/>
             <permission type="createNonDurableQueue" roles="guest"/>
@@ -61,7 +61,7 @@ under the License.
 
       <address-settings>
          <!--override the redelivery-delay  for the example queue-->
-         <address-setting match="jms.queue.exampleQueue">
+         <address-setting match="exampleQueue">
             <redelivery-delay>5000</redelivery-delay>
          </address-setting>
       </address-settings>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/07ab2001/examples/features/standard/divert/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/divert/src/main/resources/activemq/server0/broker.xml b/examples/features/standard/divert/src/main/resources/activemq/server0/broker.xml
index 9ad847c..ac264c1 100644
--- a/examples/features/standard/divert/src/main/resources/activemq/server0/broker.xml
+++ b/examples/features/standard/divert/src/main/resources/activemq/server0/broker.xml
@@ -66,23 +66,23 @@ under the License.
       <!-- We need to create a core queue for the JMS queue explicitly because the bridge will be deployed
       before the JMS queue is deployed, so the first time, it otherwise won't find the queue -->
       <queues>
-         <queue name="jms.queue.priceForwarding">
-            <address>jms.queue.priceForwarding</address>
+         <queue name="priceForwarding">
+            <address>priceForwarding</address>
          </queue>
       </queues>
 
       <diverts>
          <divert name="order-divert">
             <routing-name>order-divert</routing-name>
-            <address>jms.queue.orders</address>
-            <forwarding-address>jms.topic.spyTopic</forwarding-address>
+            <address>orders</address>
+            <forwarding-address>spyTopic</forwarding-address>
             <exclusive>false</exclusive>
          </divert>
 
          <divert name="prices-divert">
             <routing-name>prices-divert</routing-name>
-            <address>jms.topic.priceUpdates</address>
-            <forwarding-address>jms.queue.priceForwarding</forwarding-address>
+            <address>priceUpdates</address>
+            <forwarding-address>priceForwarding</forwarding-address>
             <filter string="office='New York'"/>
             <transformer-class-name>org.apache.activemq.artemis.jms.example.AddForwardingTimeTransformer
             </transformer-class-name>
@@ -94,8 +94,8 @@ under the License.
 
       <bridges>
          <bridge name="price-forward-bridge">
-            <queue-name>jms.queue.priceForwarding</queue-name>
-            <forwarding-address>jms.topic.newYorkPriceUpdates</forwarding-address>
+            <queue-name>priceForwarding</queue-name>
+            <forwarding-address>newYorkPriceUpdates</forwarding-address>
             <reconnect-attempts>-1</reconnect-attempts>
             <static-connectors>
                <connector-ref>newyork-connector</connector-ref>
@@ -107,7 +107,7 @@ under the License.
 
       <security-settings>
          <!--security for example -->
-         <security-setting match="jms.#">
+         <security-setting match="#">
             <permission type="createDurableQueue" roles="guest"/>
             <permission type="deleteDurableQueue" roles="guest"/>
             <permission type="createNonDurableQueue" roles="guest"/>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/07ab2001/examples/features/standard/divert/src/main/resources/activemq/server1/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/divert/src/main/resources/activemq/server1/broker.xml b/examples/features/standard/divert/src/main/resources/activemq/server1/broker.xml
index 26d6d95..778607e 100644
--- a/examples/features/standard/divert/src/main/resources/activemq/server1/broker.xml
+++ b/examples/features/standard/divert/src/main/resources/activemq/server1/broker.xml
@@ -50,7 +50,7 @@ under the License.
 
       <security-settings>
          <!--security for example queue-->
-         <security-setting match="jms.#">
+         <security-setting match="#">
             <permission type="createDurableQueue" roles="guest"/>
             <permission type="deleteDurableQueue" roles="guest"/>
             <permission type="createNonDurableQueue" roles="guest"/>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/07ab2001/examples/features/standard/durable-subscription/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/durable-subscription/src/main/resources/activemq/server0/broker.xml b/examples/features/standard/durable-subscription/src/main/resources/activemq/server0/broker.xml
index 8e319fa..08c7c40 100644
--- a/examples/features/standard/durable-subscription/src/main/resources/activemq/server0/broker.xml
+++ b/examples/features/standard/durable-subscription/src/main/resources/activemq/server0/broker.xml
@@ -47,7 +47,7 @@ under the License.
 
       <security-settings>
          <!--security for example topic-->
-         <security-setting match="jms.topic.exampleTopic">
+         <security-setting match="exampleTopic">
             <permission type="createDurableQueue" roles="guest"/>
             <permission type="deleteDurableQueue" roles="guest"/>
             <permission type="createNonDurableQueue" roles="guest"/>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/07ab2001/examples/features/standard/expiry/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/expiry/src/main/resources/activemq/server0/broker.xml b/examples/features/standard/expiry/src/main/resources/activemq/server0/broker.xml
index 731baaa..32805f1 100644
--- a/examples/features/standard/expiry/src/main/resources/activemq/server0/broker.xml
+++ b/examples/features/standard/expiry/src/main/resources/activemq/server0/broker.xml
@@ -49,7 +49,7 @@ under the License.
 
       <security-settings>
          <!--security for example queue-->
-         <security-setting match="jms.#">
+         <security-setting match="#">
             <permission type="createDurableQueue" roles="guest"/>
             <permission type="deleteDurableQueue" roles="guest"/>
             <permission type="createNonDurableQueue" roles="guest"/>
@@ -61,8 +61,8 @@ under the License.
 
       <address-settings>
          <!--override the expiry address for the example-->
-         <address-setting match="jms.queue.exampleQueue">
-            <expiry-address>jms.queue.expiryQueue</expiry-address>
+         <address-setting match="exampleQueue">
+            <expiry-address>expiryQueue</expiry-address>
          </address-setting>
       </address-settings>
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/07ab2001/examples/features/standard/http-transport/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/http-transport/src/main/resources/activemq/server0/broker.xml b/examples/features/standard/http-transport/src/main/resources/activemq/server0/broker.xml
index d1a4d2a..f91e249 100644
--- a/examples/features/standard/http-transport/src/main/resources/activemq/server0/broker.xml
+++ b/examples/features/standard/http-transport/src/main/resources/activemq/server0/broker.xml
@@ -47,7 +47,7 @@ under the License.
 
       <security-settings>
          <!--security for example queue-->
-         <security-setting match="jms.queue.exampleQueue">
+         <security-setting match="exampleQueue">
             <permission type="createDurableQueue" roles="guest"/>
             <permission type="deleteDurableQueue" roles="guest"/>
             <permission type="createNonDurableQueue" roles="guest"/>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/07ab2001/examples/features/standard/interceptor/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/interceptor/src/main/resources/activemq/server0/broker.xml b/examples/features/standard/interceptor/src/main/resources/activemq/server0/broker.xml
index 49e780b..531829c 100644
--- a/examples/features/standard/interceptor/src/main/resources/activemq/server0/broker.xml
+++ b/examples/features/standard/interceptor/src/main/resources/activemq/server0/broker.xml
@@ -51,7 +51,7 @@ under the License.
 
       <security-settings>
          <!--security for example queue-->
-         <security-setting match="jms.queue.exampleQueue">
+         <security-setting match="exampleQueue">
             <permission type="createDurableQueue" roles="guest"/>
             <permission type="deleteDurableQueue" roles="guest"/>
             <permission type="createNonDurableQueue" roles="guest"/>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/07ab2001/examples/features/standard/jms-bridge/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/jms-bridge/src/main/resources/activemq/server0/broker.xml b/examples/features/standard/jms-bridge/src/main/resources/activemq/server0/broker.xml
index cf211a7..3b9df04 100644
--- a/examples/features/standard/jms-bridge/src/main/resources/activemq/server0/broker.xml
+++ b/examples/features/standard/jms-bridge/src/main/resources/activemq/server0/broker.xml
@@ -41,7 +41,7 @@ under the License.
       </acceptors>
 
       <security-settings>
-         <security-setting match="jms.#">
+         <security-setting match="#">
             <permission type="consume" roles="guest"/>
             <permission type="send" roles="guest"/>
             <permission type="createNonDurableQueue" roles="guest"/>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/07ab2001/examples/features/standard/jms-bridge/src/main/resources/activemq/server1/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/jms-bridge/src/main/resources/activemq/server1/broker.xml b/examples/features/standard/jms-bridge/src/main/resources/activemq/server1/broker.xml
index 8ec2378..39089f8 100644
--- a/examples/features/standard/jms-bridge/src/main/resources/activemq/server1/broker.xml
+++ b/examples/features/standard/jms-bridge/src/main/resources/activemq/server1/broker.xml
@@ -41,7 +41,7 @@ under the License.
       </acceptors>
 
       <security-settings>
-         <security-setting match="jms.#">
+         <security-setting match="#">
             <permission type="consume" roles="guest"/>
             <permission type="send" roles="guest"/>
             <permission type="createNonDurableQueue" roles="guest"/>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/07ab2001/examples/features/standard/jms-shared-consumer/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/jms-shared-consumer/src/main/resources/activemq/server0/broker.xml b/examples/features/standard/jms-shared-consumer/src/main/resources/activemq/server0/broker.xml
index 8e319fa..08c7c40 100644
--- a/examples/features/standard/jms-shared-consumer/src/main/resources/activemq/server0/broker.xml
+++ b/examples/features/standard/jms-shared-consumer/src/main/resources/activemq/server0/broker.xml
@@ -47,7 +47,7 @@ under the License.
 
       <security-settings>
          <!--security for example topic-->
-         <security-setting match="jms.topic.exampleTopic">
+         <security-setting match="exampleTopic">
             <permission type="createDurableQueue" roles="guest"/>
             <permission type="deleteDurableQueue" roles="guest"/>
             <permission type="createNonDurableQueue" roles="guest"/>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/07ab2001/examples/features/standard/jmx/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/jmx/src/main/resources/activemq/server0/broker.xml b/examples/features/standard/jmx/src/main/resources/activemq/server0/broker.xml
index 90a6178..b251d37 100644
--- a/examples/features/standard/jmx/src/main/resources/activemq/server0/broker.xml
+++ b/examples/features/standard/jmx/src/main/resources/activemq/server0/broker.xml
@@ -50,7 +50,7 @@ under the License.
 
       <security-settings>
          <!--security for example queue-->
-         <security-setting match="jms.queue.exampleQueue">
+         <security-setting match="exampleQueue">
             <permission type="createDurableQueue" roles="guest"/>
             <permission type="deleteDurableQueue" roles="guest"/>
             <permission type="createNonDurableQueue" roles="guest"/>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/07ab2001/examples/features/standard/large-message/src/main/java/org/apache/activemq/artemis/jms/example/LargeMessageExample.java
----------------------------------------------------------------------
diff --git a/examples/features/standard/large-message/src/main/java/org/apache/activemq/artemis/jms/example/LargeMessageExample.java b/examples/features/standard/large-message/src/main/java/org/apache/activemq/artemis/jms/example/LargeMessageExample.java
index 702fe41..da47577 100644
--- a/examples/features/standard/large-message/src/main/java/org/apache/activemq/artemis/jms/example/LargeMessageExample.java
+++ b/examples/features/standard/large-message/src/main/java/org/apache/activemq/artemis/jms/example/LargeMessageExample.java
@@ -46,7 +46,7 @@ public class LargeMessageExample {
     * This may take some considerable time to create, send and consume - if it takes too long or you
     * don't have enough disk space just reduce the file size here
     */
-   private static final long FILE_SIZE = 2L * 1024 * 1024 * 1024; // 2 GiB message
+   private static final long FILE_SIZE = 2L;// * 1024 * 1024 * 1024; // 2 GiB message
 
    public static void main(final String[] args) throws Exception {
       Process server = null;

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/07ab2001/examples/features/standard/last-value-queue/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/last-value-queue/src/main/resources/activemq/server0/broker.xml b/examples/features/standard/last-value-queue/src/main/resources/activemq/server0/broker.xml
index 267d8c9..18eb207 100644
--- a/examples/features/standard/last-value-queue/src/main/resources/activemq/server0/broker.xml
+++ b/examples/features/standard/last-value-queue/src/main/resources/activemq/server0/broker.xml
@@ -46,7 +46,7 @@ under the License.
 
       <security-settings>
          <!--security for example queue-->
-         <security-setting match="jms.queue.exampleQueue">
+         <security-setting match="exampleQueue">
             <permission type="createDurableQueue" roles="guest"/>
             <permission type="deleteDurableQueue" roles="guest"/>
             <permission type="createNonDurableQueue" roles="guest"/>
@@ -58,7 +58,7 @@ under the License.
       </security-settings>
 
       <address-settings>
-         <address-setting match="jms.queue.exampleQueue">
+         <address-setting match="exampleQueue">
             <last-value-queue>true</last-value-queue>
          </address-setting>
       </address-settings>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/07ab2001/examples/features/standard/management-notifications/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/management-notifications/src/main/resources/activemq/server0/broker.xml b/examples/features/standard/management-notifications/src/main/resources/activemq/server0/broker.xml
index 279f2d2..e74c8bb 100644
--- a/examples/features/standard/management-notifications/src/main/resources/activemq/server0/broker.xml
+++ b/examples/features/standard/management-notifications/src/main/resources/activemq/server0/broker.xml
@@ -41,7 +41,7 @@ under the License.
       <paging-directory>./data/messaging/paging</paging-directory>
 
 
-      <management-notification-address>jms.topic.notificationsTopic</management-notification-address>
+      <management-notification-address>notificationsTopic</management-notification-address>
 
       <!-- Netty standard TCP acceptor -->
       <acceptors>
@@ -52,7 +52,7 @@ under the License.
 
       <security-settings>
          <!--security for example queue-->
-         <security-setting match="jms.queue.exampleQueue">
+         <security-setting match="exampleQueue">
             <permission type="createDurableQueue" roles="guest"/>
             <permission type="deleteDurableQueue" roles="guest"/>
             <permission type="createNonDurableQueue" roles="guest"/>
@@ -62,7 +62,7 @@ under the License.
          </security-setting>
 
          <!--security for notification queue-->
-         <security-setting match="jms.topic.notificationsTopic">
+         <security-setting match="notificationsTopic">
             <permission type="consume" roles="guest"/>
             <permission type="createNonDurableQueue" roles="guest"/>
             <permission type="deleteNonDurableQueue" roles="guest"/>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/07ab2001/examples/features/standard/management/src/main/java/org/apache/activemq/artemis/jms/example/ManagementExample.java
----------------------------------------------------------------------
diff --git a/examples/features/standard/management/src/main/java/org/apache/activemq/artemis/jms/example/ManagementExample.java b/examples/features/standard/management/src/main/java/org/apache/activemq/artemis/jms/example/ManagementExample.java
index f1ceb3a..a463a13 100644
--- a/examples/features/standard/management/src/main/java/org/apache/activemq/artemis/jms/example/ManagementExample.java
+++ b/examples/features/standard/management/src/main/java/org/apache/activemq/artemis/jms/example/ManagementExample.java
@@ -30,6 +30,8 @@ import javax.naming.InitialContext;
 
 import org.apache.activemq.artemis.api.jms.ActiveMQJMSClient;
 import org.apache.activemq.artemis.api.jms.management.JMSManagementHelper;
+import org.apache.activemq.artemis.api.core.management.ResourceNames;
+import org.apache.activemq.artemis.api.core.FilterConstants;
 
 /**
  * An example that shows how to manage ActiveMQ Artemis using JMS messages.
@@ -81,7 +83,7 @@ public class ManagementExample {
          // Step 13. Use a helper class to fill the JMS message with management information:
          // * the name of the resource to manage
          // * in this case, we want to retrieve the value of the messageCount of the queue
-         JMSManagementHelper.putAttribute(m, "exampleQueue", "messageCount");
+         JMSManagementHelper.putAttribute(m, ResourceNames.QUEUE + "exampleQueue", "messageCount");
 
          // Step 14. Use the requestor to send the request and wait for the reply
          Message reply = requestor.request(m);
@@ -97,7 +99,7 @@ public class ManagementExample {
          // * the object name of the resource to manage (i.e. the queue)
          // * in this case, we want to call the "removeMessage" operation with the JMS MessageID
          // of the message sent to the queue in step 8.
-         JMSManagementHelper.putOperationInvocation(m, "exampleQueue", "removeMessage", message.getJMSMessageID());
+         JMSManagementHelper.putOperationInvocation(m, ResourceNames.QUEUE + "exampleQueue", "removeMessages", FilterConstants.ACTIVEMQ_USERID + " = '" + message.getJMSMessageID() + "'");
 
          // Step 18 Use the requestor to send the request and wait for the reply
          reply = requestor.request(m);
@@ -107,8 +109,8 @@ public class ManagementExample {
          System.out.println("operation invocation has succeeded: " + success);
 
          // Step 20. Use a helper class to retrieve the operation result
-         // in that case, a boolean which is true if the message was removed, false else
-         boolean messageRemoved = (Boolean) JMSManagementHelper.getResult(reply);
+         // in that case, a long which is 1 if the message was removed, 0 else
+         boolean messageRemoved = 1 == (long) JMSManagementHelper.getResult(reply);
          System.out.println("message has been removed: " + messageRemoved);
 
          // Step 21. Create a JMS Message Consumer on the queue

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/07ab2001/examples/features/standard/management/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/management/src/main/resources/activemq/server0/broker.xml b/examples/features/standard/management/src/main/resources/activemq/server0/broker.xml
index dc62e6f..218e621 100644
--- a/examples/features/standard/management/src/main/resources/activemq/server0/broker.xml
+++ b/examples/features/standard/management/src/main/resources/activemq/server0/broker.xml
@@ -38,7 +38,7 @@ under the License.
       <paging-directory>./data/messaging/paging</paging-directory>
 
 
-      <management-address>jms.queue.activemq.management</management-address>
+      <management-address>activemq.management</management-address>
 
       <!-- Netty standard TCP acceptor -->
       <acceptors>
@@ -48,7 +48,7 @@ under the License.
       <security-settings>
 
          <!--security for example queue-->
-         <security-setting match="jms.queue.exampleQueue">
+         <security-setting match="exampleQueue">
             <permission type="createDurableQueue" roles="guest"/>
             <permission type="deleteDurableQueue" roles="guest"/>
             <permission type="createNonDurableQueue" roles="guest"/>
@@ -58,12 +58,12 @@ under the License.
          </security-setting>
 
          <!--security for management queue-->
-         <security-setting match="jms.queue.activemq.management">
+         <security-setting match="activemq.management">
             <permission type="manage" roles="guest"/>
          </security-setting>
 
          <!-- security settings for JMS temporary queue -->
-         <security-setting match="jms.tempqueue.#">
+         <security-setting match="#">
             <permission type="createNonDurableQueue" roles="guest"/>
             <permission type="deleteNonDurableQueue" roles="guest"/>
             <permission type="consume" roles="guest"/>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/07ab2001/examples/features/standard/message-counters/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/message-counters/src/main/resources/activemq/server0/broker.xml b/examples/features/standard/message-counters/src/main/resources/activemq/server0/broker.xml
index f946982..39bba47 100644
--- a/examples/features/standard/message-counters/src/main/resources/activemq/server0/broker.xml
+++ b/examples/features/standard/message-counters/src/main/resources/activemq/server0/broker.xml
@@ -55,7 +55,7 @@ under the License.
 
       <security-settings>
          <!--security for example queue-->
-         <security-setting match="jms.queue.exampleQueue">
+         <security-setting match="exampleQueue">
             <permission type="createDurableQueue" roles="guest"/>
             <permission type="deleteDurableQueue" roles="guest"/>
             <permission type="createNonDurableQueue" roles="guest"/>
@@ -65,7 +65,7 @@ under the License.
          </security-setting>
 
          <!--security for dead letter queue-->
-         <security-setting match="jms.queue.expiryQueue">
+         <security-setting match="expiryQueue">
             <permission type="createDurableQueue" roles="guest"/>
             <permission type="deleteDurableQueue" roles="guest"/>
             <permission type="createNonDurableQueue" roles="guest"/>
@@ -77,8 +77,8 @@ under the License.
 
       <address-settings>
          <!--override the expiry address for the example-->
-         <address-setting match="jms.queue.exampleQueue">
-            <expiry-address>jms.queue.expiryQueue</expiry-address>
+         <address-setting match="exampleQueue">
+            <expiry-address>expiryQueue</expiry-address>
          </address-setting>
       </address-settings>
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/07ab2001/examples/features/standard/paging/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/paging/src/main/resources/activemq/server0/broker.xml b/examples/features/standard/paging/src/main/resources/activemq/server0/broker.xml
index 04c77c4..1da9ff5 100644
--- a/examples/features/standard/paging/src/main/resources/activemq/server0/broker.xml
+++ b/examples/features/standard/paging/src/main/resources/activemq/server0/broker.xml
@@ -54,7 +54,7 @@ under the License.
 
       <security-settings>
          <!--security for example queue-->
-         <security-setting match="jms.queue.exampleQueue">
+         <security-setting match="exampleQueue">
             <permission type="createDurableQueue" roles="guest"/>
             <permission type="deleteDurableQueue" roles="guest"/>
             <permission type="createNonDurableQueue" roles="guest"/>
@@ -63,7 +63,7 @@ under the License.
             <permission type="send" roles="guest"/>
          </security-setting>
 
-         <security-setting match="jms.queue.pagingQueue">
+         <security-setting match="pagingQueue">
             <permission type="createDurableQueue" roles="guest"/>
             <permission type="deleteDurableQueue" roles="guest"/>
             <permission type="createNonDurableQueue" roles="guest"/>
@@ -74,12 +74,12 @@ under the License.
       </security-settings>
 
       <address-settings>
-         <address-setting match="jms.queue.pagingQueue">
+         <address-setting match="pagingQueue">
             <max-size-bytes>100000</max-size-bytes>
             <page-size-bytes>20000</page-size-bytes>
          </address-setting>
 
-         <address-setting match="jms.queue.exampleQueue">
+         <address-setting match="exampleQueue">
             <max-size-bytes>10485760</max-size-bytes>
             <page-size-bytes>1048576</page-size-bytes>
          </address-setting>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/07ab2001/examples/features/standard/pre-acknowledge/src/main/java/org/apache/activemq/artemis/jms/example/PreacknowledgeExample.java
----------------------------------------------------------------------
diff --git a/examples/features/standard/pre-acknowledge/src/main/java/org/apache/activemq/artemis/jms/example/PreacknowledgeExample.java b/examples/features/standard/pre-acknowledge/src/main/java/org/apache/activemq/artemis/jms/example/PreacknowledgeExample.java
index 8a3fe10..d840c32 100644
--- a/examples/features/standard/pre-acknowledge/src/main/java/org/apache/activemq/artemis/jms/example/PreacknowledgeExample.java
+++ b/examples/features/standard/pre-acknowledge/src/main/java/org/apache/activemq/artemis/jms/example/PreacknowledgeExample.java
@@ -31,6 +31,7 @@ import javax.jms.TextMessage;
 import org.apache.activemq.artemis.api.jms.ActiveMQJMSClient;
 import org.apache.activemq.artemis.api.jms.ActiveMQJMSConstants;
 import org.apache.activemq.artemis.api.jms.management.JMSManagementHelper;
+import org.apache.activemq.artemis.api.core.management.ResourceNames;
 import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
 
 /**
@@ -113,7 +114,7 @@ public class PreacknowledgeExample {
 
       Message m = session.createMessage();
 
-      JMSManagementHelper.putAttribute(m, "exampleQueue", "messageCount");
+      JMSManagementHelper.putAttribute(m, ResourceNames.QUEUE + "exampleQueue", "messageCount");
 
       Message response = requestor.request(m);
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/07ab2001/examples/features/standard/pre-acknowledge/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/pre-acknowledge/src/main/resources/activemq/server0/broker.xml b/examples/features/standard/pre-acknowledge/src/main/resources/activemq/server0/broker.xml
index 4379ab8..c13644b 100644
--- a/examples/features/standard/pre-acknowledge/src/main/resources/activemq/server0/broker.xml
+++ b/examples/features/standard/pre-acknowledge/src/main/resources/activemq/server0/broker.xml
@@ -45,7 +45,7 @@ under the License.
       <!-- Other config -->
 
       <security-settings>
-         <security-setting match="jms.#">
+         <security-setting match="#">
             <permission type="createDurableQueue" roles="guest"/>
             <permission type="deleteDurableQueue" roles="guest"/>
             <permission type="createNonDurableQueue" roles="guest"/>
@@ -54,7 +54,7 @@ under the License.
             <permission type="send" roles="guest"/>
          </security-setting>
 
-         <security-setting match="jms.queue.activemq.management">
+         <security-setting match="activemq.management">
             <permission type="manage" roles="guest"/>
          </security-setting>
       </security-settings>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/07ab2001/examples/features/standard/queue-requestor/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/queue-requestor/src/main/resources/activemq/server0/broker.xml b/examples/features/standard/queue-requestor/src/main/resources/activemq/server0/broker.xml
index 612b35b..64a5ba3 100644
--- a/examples/features/standard/queue-requestor/src/main/resources/activemq/server0/broker.xml
+++ b/examples/features/standard/queue-requestor/src/main/resources/activemq/server0/broker.xml
@@ -46,7 +46,7 @@ under the License.
 
       <security-settings>
          <!--security for example queues -->
-         <security-setting match="jms.queue.#">
+         <security-setting match="#">
             <permission type="createDurableQueue" roles="guest"/>
             <permission type="deleteDurableQueue" roles="guest"/>
             <permission type="createNonDurableQueue" roles="guest"/>
@@ -55,7 +55,7 @@ under the License.
             <permission type="send" roles="guest"/>
          </security-setting>
          <!-- security settings for JMS temporary queue -->
-         <security-setting match="jms.tempqueue.#">
+         <security-setting match="#">
             <permission type="createNonDurableQueue" roles="guest"/>
             <permission type="deleteNonDurableQueue" roles="guest"/>
             <permission type="consume" roles="guest"/>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/07ab2001/examples/features/standard/reattach-node/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/reattach-node/src/main/resources/activemq/server0/broker.xml b/examples/features/standard/reattach-node/src/main/resources/activemq/server0/broker.xml
index f646990..ec41710 100644
--- a/examples/features/standard/reattach-node/src/main/resources/activemq/server0/broker.xml
+++ b/examples/features/standard/reattach-node/src/main/resources/activemq/server0/broker.xml
@@ -61,7 +61,7 @@ under the License.
       <security-settings>
 
          <!--security for example queue-->
-         <security-setting match="jms.queue.exampleQueue">
+         <security-setting match="exampleQueue">
             <permission type="createDurableQueue" roles="guest"/>
             <permission type="deleteDurableQueue" roles="guest"/>
             <permission type="createNonDurableQueue" roles="guest"/>
@@ -70,7 +70,7 @@ under the License.
             <permission type="send" roles="guest"/>
          </security-setting>
 
-         <security-setting match="jms.queue.activemq.management">
+         <security-setting match="activemq.management">
             <permission type="consume" roles="guest"/>
             <permission type="send" roles="guest"/>
             <permission type="manage" roles="guest"/>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/07ab2001/examples/features/standard/security-ldap/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/security-ldap/src/main/resources/activemq/server0/broker.xml b/examples/features/standard/security-ldap/src/main/resources/activemq/server0/broker.xml
index 667ac95..bb96922 100644
--- a/examples/features/standard/security-ldap/src/main/resources/activemq/server0/broker.xml
+++ b/examples/features/standard/security-ldap/src/main/resources/activemq/server0/broker.xml
@@ -52,7 +52,7 @@ under the License.
 
       <security-settings>
          <!-- any user can have full control of generic topics -->
-         <security-setting match="jms.topic.#">
+         <security-setting match="#">
             <permission type="createDurableQueue" roles="user"/>
             <permission type="deleteDurableQueue" roles="user"/>
             <permission type="createNonDurableQueue" roles="user"/>
@@ -61,7 +61,7 @@ under the License.
             <permission type="consume" roles="user"/>
          </security-setting>
 
-         <security-setting match="jms.topic.news.europe.#">
+         <security-setting match="news.europe.#">
             <permission type="createDurableQueue" roles="user"/>
             <permission type="deleteDurableQueue" roles="user"/>
             <permission type="createNonDurableQueue" roles="user"/>
@@ -70,7 +70,7 @@ under the License.
             <permission type="consume" roles="news-user"/>
          </security-setting>
 
-         <security-setting match="jms.topic.news.us.#">
+         <security-setting match="news.us.#">
             <permission type="createDurableQueue" roles="user"/>
             <permission type="deleteDurableQueue" roles="user"/>
             <permission type="createNonDurableQueue" roles="user"/>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/07ab2001/examples/features/standard/security/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/security/src/main/resources/activemq/server0/broker.xml b/examples/features/standard/security/src/main/resources/activemq/server0/broker.xml
index e2dc187..28612c4 100644
--- a/examples/features/standard/security/src/main/resources/activemq/server0/broker.xml
+++ b/examples/features/standard/security/src/main/resources/activemq/server0/broker.xml
@@ -49,7 +49,7 @@ under the License.
 
       <security-settings>
          <!-- any user can have full control of generic topics -->
-         <security-setting match="jms.topic.#">
+         <security-setting match="#">
             <permission type="createDurableQueue" roles="user"/>
             <permission type="deleteDurableQueue" roles="user"/>
             <permission type="createNonDurableQueue" roles="user"/>
@@ -58,7 +58,7 @@ under the License.
             <permission type="consume" roles="user"/>
          </security-setting>
 
-         <security-setting match="jms.topic.news.europe.#">
+         <security-setting match="news.europe.#">
             <permission type="createDurableQueue" roles="user"/>
             <permission type="deleteDurableQueue" roles="user"/>
             <permission type="createNonDurableQueue" roles="user"/>
@@ -67,7 +67,7 @@ under the License.
             <permission type="consume" roles="news-user"/>
          </security-setting>
 
-         <security-setting match="jms.topic.news.us.#">
+         <security-setting match="news.us.#">
             <permission type="createDurableQueue" roles="user"/>
             <permission type="deleteDurableQueue" roles="user"/>
             <permission type="createNonDurableQueue" roles="user"/>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/07ab2001/examples/features/standard/ssl-enabled-dual-authentication/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/ssl-enabled-dual-authentication/src/main/resources/activemq/server0/broker.xml b/examples/features/standard/ssl-enabled-dual-authentication/src/main/resources/activemq/server0/broker.xml
index 14fa849..438a751 100644
--- a/examples/features/standard/ssl-enabled-dual-authentication/src/main/resources/activemq/server0/broker.xml
+++ b/examples/features/standard/ssl-enabled-dual-authentication/src/main/resources/activemq/server0/broker.xml
@@ -47,7 +47,7 @@ under the License.
 
       <security-settings>
          <!--security for example queue-->
-         <security-setting match="jms.queue.exampleQueue">
+         <security-setting match="exampleQueue">
             <permission type="consume" roles="consumers"/>
             <permission type="send" roles="producers"/>
          </security-setting>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/07ab2001/examples/features/standard/ssl-enabled/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/ssl-enabled/src/main/resources/activemq/server0/broker.xml b/examples/features/standard/ssl-enabled/src/main/resources/activemq/server0/broker.xml
index 4bf6371..1b209d8 100644
--- a/examples/features/standard/ssl-enabled/src/main/resources/activemq/server0/broker.xml
+++ b/examples/features/standard/ssl-enabled/src/main/resources/activemq/server0/broker.xml
@@ -46,7 +46,7 @@ under the License.
 
       <security-settings>
          <!--security for example queue-->
-         <security-setting match="jms.queue.exampleQueue">
+         <security-setting match="exampleQueue">
             <permission type="createDurableQueue" roles="guest"/>
             <permission type="deleteDurableQueue" roles="guest"/>
             <permission type="createNonDurableQueue" roles="guest"/>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/07ab2001/examples/features/standard/static-selector/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/static-selector/src/main/resources/activemq/server0/broker.xml b/examples/features/standard/static-selector/src/main/resources/activemq/server0/broker.xml
index 59ce149..e9cde42 100644
--- a/examples/features/standard/static-selector/src/main/resources/activemq/server0/broker.xml
+++ b/examples/features/standard/static-selector/src/main/resources/activemq/server0/broker.xml
@@ -43,8 +43,8 @@ under the License.
       </acceptors>
 
       <queues>
-         <queue name="jms.queue.exampleQueue">
-            <address>jms.queue.exampleQueue</address>
+         <queue name="exampleQueue">
+            <address>exampleQueue</address>
             <filter string="color='red'"/>
          </queue>
       </queues>
@@ -53,7 +53,7 @@ under the License.
 
       <security-settings>
          <!--security for example queue-->
-         <security-setting match="jms.queue.exampleQueue">
+         <security-setting match="exampleQueue">
             <permission type="createDurableQueue" roles="guest"/>
             <permission type="deleteDurableQueue" roles="guest"/>
             <permission type="createNonDurableQueue" roles="guest"/>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/07ab2001/examples/features/standard/temp-queue/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/temp-queue/src/main/resources/activemq/server0/broker.xml b/examples/features/standard/temp-queue/src/main/resources/activemq/server0/broker.xml
index 2dd2df9..15fd199 100644
--- a/examples/features/standard/temp-queue/src/main/resources/activemq/server0/broker.xml
+++ b/examples/features/standard/temp-queue/src/main/resources/activemq/server0/broker.xml
@@ -45,7 +45,7 @@ under the License.
       <!-- Other config -->
       <security-settings>
          <!--security for example queues -->
-         <security-setting match="jms.queue.#">
+         <security-setting match="#">
             <permission type="createDurableQueue" roles="guest"/>
             <permission type="deleteDurableQueue" roles="guest"/>
             <permission type="createNonDurableQueue" roles="guest"/>
@@ -54,7 +54,7 @@ under the License.
             <permission type="send" roles="guest"/>
          </security-setting>
          <!-- security settings for JMS temporary queue -->
-         <security-setting match="jms.tempqueue.#">
+         <security-setting match="#">
             <permission type="createNonDurableQueue" roles="guest"/>
             <permission type="deleteNonDurableQueue" roles="guest"/>
             <permission type="consume" roles="guest"/>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/07ab2001/examples/features/standard/topic-selector-example1/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/topic-selector-example1/src/main/resources/activemq/server0/broker.xml b/examples/features/standard/topic-selector-example1/src/main/resources/activemq/server0/broker.xml
index d45eb5d..030aa73 100644
--- a/examples/features/standard/topic-selector-example1/src/main/resources/activemq/server0/broker.xml
+++ b/examples/features/standard/topic-selector-example1/src/main/resources/activemq/server0/broker.xml
@@ -46,7 +46,7 @@ under the License.
 
       <security-settings>
          <!--security for example topic-->
-         <security-setting match="jms.topic.exampleTopic">
+         <security-setting match="exampleTopic">
             <permission type="createDurableQueue" roles="guest"/>
             <permission type="deleteDurableQueue" roles="guest"/>
             <permission type="createNonDurableQueue" roles="guest"/>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/07ab2001/examples/features/standard/topic-selector-example2/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/topic-selector-example2/src/main/resources/activemq/server0/broker.xml b/examples/features/standard/topic-selector-example2/src/main/resources/activemq/server0/broker.xml
index d45eb5d..030aa73 100644
--- a/examples/features/standard/topic-selector-example2/src/main/resources/activemq/server0/broker.xml
+++ b/examples/features/standard/topic-selector-example2/src/main/resources/activemq/server0/broker.xml
@@ -46,7 +46,7 @@ under the License.
 
       <security-settings>
          <!--security for example topic-->
-         <security-setting match="jms.topic.exampleTopic">
+         <security-setting match="exampleTopic">
             <permission type="createDurableQueue" roles="guest"/>
             <permission type="deleteDurableQueue" roles="guest"/>
             <permission type="createNonDurableQueue" roles="guest"/>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/07ab2001/examples/features/sub-modules/aerogear/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/sub-modules/aerogear/src/main/resources/activemq/server0/broker.xml b/examples/features/sub-modules/aerogear/src/main/resources/activemq/server0/broker.xml
index 1095761..3751be0 100644
--- a/examples/features/sub-modules/aerogear/src/main/resources/activemq/server0/broker.xml
+++ b/examples/features/sub-modules/aerogear/src/main/resources/activemq/server0/broker.xml
@@ -45,8 +45,8 @@ under the License.
       <!-- We need to create a core queue for the JMS queue explicitly because the connector will be deployed
        before the JMS queue is deployed, so the first time, it otherwise won't find the queue -->
       <queues>
-         <queue name="jms.queue.exampleQueue">
-            <address>jms.queue.exampleQueue</address>
+         <queue name="exampleQueue">
+            <address>exampleQueue</address>
          </queue>
       </queues>
 
@@ -54,7 +54,7 @@ under the License.
          <connector-service name="aerogear-connector">
             <factory-class>org.apache.activemq.artemis.integration.aerogear.AeroGearConnectorServiceFactory</factory-class>
             <param key="endpoint" value="${endpoint}"/>
-            <param key="queue" value="jms.queue.exampleQueue"/>
+            <param key="queue" value="exampleQueue"/>
             <param key="application-id" value="${applicationid}"/>
             <param key="master-secret" value="${mastersecret}"/>
          </connector-service>
@@ -64,7 +64,7 @@ under the License.
 
       <security-settings>
          <!--security for example queue-->
-         <security-setting match="jms.queue.exampleQueue">
+         <security-setting match="exampleQueue">
             <permission type="createDurableQueue" roles="guest"/>
             <permission type="deleteDurableQueue" roles="guest"/>
             <permission type="createNonDurableQueue" roles="guest"/>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/07ab2001/examples/protocols/amqp/proton-cpp/src/main/java/org/apache/activemq/artemis/jms/example/ProtonCPPExample.java
----------------------------------------------------------------------
diff --git a/examples/protocols/amqp/proton-cpp/src/main/java/org/apache/activemq/artemis/jms/example/ProtonCPPExample.java b/examples/protocols/amqp/proton-cpp/src/main/java/org/apache/activemq/artemis/jms/example/ProtonCPPExample.java
index a166dc2..0c389f4 100644
--- a/examples/protocols/amqp/proton-cpp/src/main/java/org/apache/activemq/artemis/jms/example/ProtonCPPExample.java
+++ b/examples/protocols/amqp/proton-cpp/src/main/java/org/apache/activemq/artemis/jms/example/ProtonCPPExample.java
@@ -30,6 +30,7 @@ import javax.naming.InitialContext;
 
 import org.apache.activemq.artemis.api.jms.ActiveMQJMSClient;
 import org.apache.activemq.artemis.api.jms.management.JMSManagementHelper;
+import org.apache.activemq.artemis.api.core.management.ResourceNames;
 
 /**
  * This example demonstrates the use of ActiveMQ Artemis "pre-acknowledge" functionality where
@@ -107,7 +108,7 @@ public class ProtonCPPExample {
 
       Message m = session.createMessage();
 
-      JMSManagementHelper.putAttribute(m, "exampleQueue", "messageCount");
+      JMSManagementHelper.putAttribute(m, ResourceNames.QUEUE + "exampleQueue", "messageCount");
 
       Message response = requestor.request(m);
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/07ab2001/examples/protocols/stomp/stomp-dual-authentication/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/protocols/stomp/stomp-dual-authentication/src/main/resources/activemq/server0/broker.xml b/examples/protocols/stomp/stomp-dual-authentication/src/main/resources/activemq/server0/broker.xml
index 14fa849..438a751 100644
--- a/examples/protocols/stomp/stomp-dual-authentication/src/main/resources/activemq/server0/broker.xml
+++ b/examples/protocols/stomp/stomp-dual-authentication/src/main/resources/activemq/server0/broker.xml
@@ -47,7 +47,7 @@ under the License.
 
       <security-settings>
          <!--security for example queue-->
-         <security-setting match="jms.queue.exampleQueue">
+         <security-setting match="exampleQueue">
             <permission type="consume" roles="consumers"/>
             <permission type="send" roles="producers"/>
          </security-setting>


[08/48] activemq-artemis git commit: Fix SessionTest

Posted by jb...@apache.org.
Fix SessionTest


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

Branch: refs/heads/ARTEMIS-780
Commit: 56861146c41b338d09127fb024b46dff2d065fe7
Parents: c5a95f9
Author: jbertram <jb...@apache.com>
Authored: Mon Nov 14 14:07:58 2016 -0600
Committer: jbertram <jb...@apache.com>
Committed: Tue Nov 15 10:36:43 2016 -0600

----------------------------------------------------------------------
 .../java/org/apache/activemq/artemis/jms/tests/SessionTest.java    | 2 ++
 1 file changed, 2 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/56861146/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/SessionTest.java
----------------------------------------------------------------------
diff --git a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/SessionTest.java b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/SessionTest.java
index 016b052..1ff79d0 100644
--- a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/SessionTest.java
+++ b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/SessionTest.java
@@ -170,6 +170,7 @@ public class SessionTest extends ActiveMQServerTestCase {
    @Test
    public void testCreateNonExistentTopic() throws Exception {
       getJmsServer().getAddressSettingsRepository().addMatch("#", new AddressSettings().setAutoCreateJmsQueues(false));
+      getJmsServer().getAddressSettingsRepository().addMatch("#", new AddressSettings().setAutoCreateJmsTopics(false));
       Connection conn = getConnectionFactory().createConnection();
       Session sess = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
       try {
@@ -198,6 +199,7 @@ public class SessionTest extends ActiveMQServerTestCase {
    @Test
    public void testCreateTopicWhileQueueWithSameNameExists() throws Exception {
       getJmsServer().getAddressSettingsRepository().addMatch("#", new AddressSettings().setAutoCreateJmsQueues(false));
+      getJmsServer().getAddressSettingsRepository().addMatch("#", new AddressSettings().setAutoCreateJmsTopics(false));
       Connection conn = getConnectionFactory().createConnection();
       Session sess = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
       try {


[21/48] activemq-artemis git commit: Fix some failures in ProtonTest

Posted by jb...@apache.org.
Fix some failures in ProtonTest


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

Branch: refs/heads/ARTEMIS-780
Commit: 4ccfc730b42a1a57900eb8a8645141acfacfe717
Parents: 6b441b7
Author: jbertram <jb...@apache.com>
Authored: Tue Nov 15 13:34:49 2016 -0600
Committer: jbertram <jb...@apache.com>
Committed: Wed Nov 23 09:04:34 2016 -0600

----------------------------------------------------------------------
 .../activemq/artemis/tests/integration/amqp/ProtonTest.java      | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/4ccfc730/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/ProtonTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/ProtonTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/ProtonTest.java
index d1f4546..b017c31 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/ProtonTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/ProtonTest.java
@@ -63,6 +63,7 @@ import javax.jms.TopicSession;
 import javax.jms.TopicSubscriber;
 
 import org.apache.activemq.artemis.api.core.SimpleString;
+import org.apache.activemq.artemis.api.core.management.ResourceNames;
 import org.apache.activemq.artemis.core.postoffice.Bindings;
 import org.apache.activemq.artemis.core.remoting.CloseListener;
 import org.apache.activemq.artemis.core.remoting.impl.netty.NettyConnector;
@@ -775,6 +776,7 @@ public class ProtonTest extends ProtonTestBase {
       Exception expectedException = null;
       try {
          session.createSender("AnAddressThatDoesNotExist");
+         fail("Creating a sender here on an address that doesn't exist should fail");
       } catch (Exception e) {
          expectedException = e;
       }
@@ -896,7 +898,7 @@ public class ProtonTest extends ProtonTestBase {
 
          //create request message for getQueueNames query
          AmqpMessage request = new AmqpMessage();
-         request.setApplicationProperty("_AMQ_ResourceName", "core.server");
+         request.setApplicationProperty("_AMQ_ResourceName", ResourceNames.BROKER);
          request.setApplicationProperty("_AMQ_OperationName", "getQueueNames");
          request.setReplyToAddress(destinationAddress);
          request.setText("[]");


[43/48] activemq-artemis git commit: User ServerSession to create Stomp queues/addresses

Posted by jb...@apache.org.
User ServerSession to create Stomp queues/addresses


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

Branch: refs/heads/ARTEMIS-780
Commit: 40a555900a331272c2d7ef290a34b54a0ff370ef
Parents: d1b62a5
Author: jbertram <jb...@apache.com>
Authored: Tue Nov 22 10:31:30 2016 -0600
Committer: jbertram <jb...@apache.com>
Committed: Wed Nov 23 09:04:37 2016 -0600

----------------------------------------------------------------------
 .../core/protocol/stomp/StompConnection.java    | 25 +++++++++++++-------
 .../core/ServerSessionPacketHandler.java        |  2 +-
 .../artemis/core/server/ServerSession.java      |  2 +-
 .../core/server/impl/ServerSessionImpl.java     |  4 ++--
 4 files changed, 21 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/40a55590/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompConnection.java
----------------------------------------------------------------------
diff --git a/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompConnection.java b/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompConnection.java
index 52d3f3b..3a734eb 100644
--- a/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompConnection.java
+++ b/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompConnection.java
@@ -39,8 +39,10 @@ import org.apache.activemq.artemis.core.remoting.FailureListener;
 import org.apache.activemq.artemis.core.remoting.impl.netty.TransportConstants;
 import org.apache.activemq.artemis.core.server.ActiveMQServerLogger;
 import org.apache.activemq.artemis.core.server.ServerMessage;
+import org.apache.activemq.artemis.core.server.ServerSession;
 import org.apache.activemq.artemis.core.server.impl.AddressInfo;
 import org.apache.activemq.artemis.core.server.impl.ServerMessageImpl;
+import org.apache.activemq.artemis.core.settings.impl.AddressSettings;
 import org.apache.activemq.artemis.spi.core.protocol.RemotingConnection;
 import org.apache.activemq.artemis.spi.core.remoting.Acceptor;
 import org.apache.activemq.artemis.spi.core.remoting.Connection;
@@ -259,21 +261,24 @@ public final class StompConnection implements RemotingConnection {
 
    public boolean autoCreateDestinationIfPossible(String queue, AddressInfo.RoutingType routingType) throws ActiveMQStompException {
       boolean result = false;
+      ServerSession session = getSession().getSession();
 
       try {
          if (manager.getServer().getAddressInfo(SimpleString.toSimpleString(queue)) == null) {
-            // TODO check here to see if auto-creation is enabled
-            if (routingType != null && routingType.equals(AddressInfo.RoutingType.MULTICAST) && manager.getServer().getAddressSettingsRepository().getMatch(queue).isAutoCreateAddresses()) {
-               manager.getServer().createOrUpdateAddressInfo(new AddressInfo(SimpleString.toSimpleString(queue)).setAutoCreated(true));
+            AddressSettings addressSettings = manager.getServer().getAddressSettingsRepository().getMatch(queue);
+            if (routingType != null && routingType.equals(AddressInfo.RoutingType.MULTICAST) && addressSettings.isAutoCreateAddresses()) {
+               session.createAddress(SimpleString.toSimpleString(queue), true, true);
+               result = true;
             } else {
-               if (manager.getServer().getAddressSettingsRepository().getMatch(queue).isAutoCreateAddresses()) {
-                  manager.getServer().createOrUpdateAddressInfo(new AddressInfo(SimpleString.toSimpleString(queue)).setRoutingType(AddressInfo.RoutingType.ANYCAST).setAutoCreated(true));
+               if (addressSettings.isAutoCreateAddresses()) {
+                  session.createAddress(SimpleString.toSimpleString(queue), false, true);
+                  result = true;
                }
-               if (manager.getServer().getAddressSettingsRepository().getMatch(queue).isAutoCreateQueues()) {
-                  manager.getServer().createQueue(SimpleString.toSimpleString(queue), SimpleString.toSimpleString(queue), null, null, true, false, true);
+               if (addressSettings.isAutoCreateQueues()) {
+                  session.createQueue(SimpleString.toSimpleString(queue), SimpleString.toSimpleString(queue), null, false, true, null, null, true);
+                  result = true;
                }
             }
-            result = true;
          }
       } catch (ActiveMQQueueExistsException e) {
          // ignore
@@ -559,6 +564,10 @@ public final class StompConnection implements RemotingConnection {
       return manager.createServerMessage();
    }
 
+   public StompSession getSession() throws ActiveMQStompException {
+      return getSession(null);
+   }
+
    public StompSession getSession(String txID) throws ActiveMQStompException {
       StompSession session = null;
       try {

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/40a55590/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/ServerSessionPacketHandler.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/ServerSessionPacketHandler.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/ServerSessionPacketHandler.java
index ac8d68a..184462b 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/ServerSessionPacketHandler.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/ServerSessionPacketHandler.java
@@ -227,7 +227,7 @@ public class ServerSessionPacketHandler implements ChannelHandler {
                case CREATE_ADDRESS: {
                   CreateAddressMessage request = (CreateAddressMessage) packet;
                   requiresResponse = request.isRequiresResponse();
-                  session.createAddress(request.getAddress(), request.isMulticast());
+                  session.createAddress(request.getAddress(), request.isMulticast(), request.isAutoCreated());
                   if (requiresResponse) {
                      response = new NullResponseMessage();
                   }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/40a55590/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ServerSession.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ServerSession.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ServerSession.java
index 28d283d..23426ca 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ServerSession.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ServerSession.java
@@ -108,7 +108,7 @@ public interface ServerSession extends SecurityAuth {
                      boolean temporary,
                      boolean durable) throws Exception;
 
-   AddressInfo createAddress(final SimpleString address, final boolean multicast) throws Exception;
+   AddressInfo createAddress(final SimpleString address, final boolean multicast, final boolean autoCreated) throws Exception;
 
    void deleteQueue(SimpleString name) throws Exception;
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/40a55590/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ServerSessionImpl.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ServerSessionImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ServerSessionImpl.java
index e4e9135..e6de6cd 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ServerSessionImpl.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ServerSessionImpl.java
@@ -537,11 +537,11 @@ public class ServerSessionImpl implements ServerSession, FailureListener {
    }
 
    @Override
-   public AddressInfo createAddress(final SimpleString address, final boolean multicast) throws Exception {
+   public AddressInfo createAddress(final SimpleString address, final boolean multicast, final boolean autoCreated) throws Exception {
       securityCheck(address, CheckType.CREATE_ADDRESS, this);
       AddressInfo.RoutingType routingType = multicast ? AddressInfo.RoutingType.MULTICAST : AddressInfo.RoutingType.ANYCAST;
 
-      AddressInfo addressInfo = server.createOrUpdateAddressInfo(new AddressInfo(address).setRoutingType(routingType));
+      AddressInfo addressInfo = server.createOrUpdateAddressInfo(new AddressInfo(address).setRoutingType(routingType).setAutoCreated(autoCreated));
 
       return addressInfo;
    }


[13/48] activemq-artemis git commit: Fix NonExistentQueueTest

Posted by jb...@apache.org.
Fix NonExistentQueueTest


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

Branch: refs/heads/ARTEMIS-780
Commit: 6afbae762b51d3958965cb0917a58c06a6b8dda7
Parents: 3bd5705
Author: jbertram <jb...@apache.com>
Authored: Mon Nov 14 17:04:51 2016 -0600
Committer: jbertram <jb...@apache.com>
Committed: Tue Nov 15 10:38:13 2016 -0600

----------------------------------------------------------------------
 .../artemis/jms/client/ActiveMQMessageProducer.java |  4 ++--
 .../jms/jms2client/NonExistentQueueTest.java        | 16 +---------------
 2 files changed, 3 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6afbae76/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQMessageProducer.java
----------------------------------------------------------------------
diff --git a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQMessageProducer.java b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQMessageProducer.java
index 1270c19..5cbd40f 100644
--- a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQMessageProducer.java
+++ b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQMessageProducer.java
@@ -414,9 +414,9 @@ public class ActiveMQMessageProducer implements MessageProducer, QueueSender, To
                      }
                   } else if (!destination.isQueue() && query.isAutoCreateJmsTopics()) {
                      clientSession.createAddress(address, true, true);
+                  } else if ((destination.isQueue() && !query.isAutoCreateJmsQueues()) || (!destination.isQueue() && !query.isAutoCreateJmsTopics())) {
+                     throw new InvalidDestinationException("Destination " + address + " does not exist");
                   }
-               } else if (!query.isExists() && ((destination.isQueue() && !query.isAutoCreateJmsQueues()) || (!destination.isQueue() && !query.isAutoCreateJmsTopics()))) {
-                  throw new InvalidDestinationException("Destination " + address + " does not exist");
                } else {
                   connection.addKnownDestination(address);
                }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6afbae76/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/jms2client/NonExistentQueueTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/jms2client/NonExistentQueueTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/jms2client/NonExistentQueueTest.java
index 88dc68b..64d2af3 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/jms2client/NonExistentQueueTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/jms2client/NonExistentQueueTest.java
@@ -25,9 +25,7 @@ import javax.jms.JMSException;
 import javax.jms.JMSProducer;
 import javax.jms.JMSRuntimeException;
 import javax.jms.MessageProducer;
-import javax.jms.Queue;
 import javax.jms.Session;
-import java.util.Random;
 
 import org.apache.activemq.artemis.api.core.TransportConfiguration;
 import org.apache.activemq.artemis.api.jms.ActiveMQJMSClient;
@@ -36,26 +34,14 @@ import org.apache.activemq.artemis.core.remoting.impl.invm.InVMConnectorFactory;
 import org.apache.activemq.artemis.core.settings.impl.AddressSettings;
 import org.apache.activemq.artemis.tests.util.JMSTestBase;
 import org.junit.Assert;
-import org.junit.Before;
 import org.junit.Test;
 
 public class NonExistentQueueTest extends JMSTestBase {
 
-   private JMSContext context;
-   private final Random random = new Random();
-   private Queue queue;
-
-   @Override
-   @Before
-   public void setUp() throws Exception {
-      super.setUp();
-      context = createContext();
-      queue = createQueue(JmsContextTest.class.getSimpleName() + "Queue1");
-   }
-
    @Test
    public void sendToNonExistentDestination() throws Exception {
       server.getAddressSettingsRepository().addMatch("#", new AddressSettings().setAutoCreateJmsQueues(false));
+      server.getAddressSettingsRepository().addMatch("#", new AddressSettings().setAutoCreateJmsTopics(false));
       Destination destination = ActiveMQJMSClient.createTopic("DoesNotExist");
       TransportConfiguration transportConfiguration = new TransportConfiguration(InVMConnectorFactory.class.getName());
       ConnectionFactory localConnectionFactory = ActiveMQJMSClient.createConnectionFactoryWithoutHA(JMSFactoryType.CF, transportConfiguration);


[16/48] activemq-artemis git commit: CLI WORK

Posted by jb...@apache.org.
CLI WORK


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

Branch: refs/heads/ARTEMIS-780
Commit: bd4b7cecc09701096e5eb8b02b737a9a4990d11e
Parents: d4988a0
Author: Martyn Taylor <mt...@redhat.com>
Authored: Fri Nov 11 14:08:49 2016 +0000
Committer: Martyn Taylor <mt...@redhat.com>
Committed: Wed Nov 16 15:24:45 2016 +0000

----------------------------------------------------------------------
 .../apache/activemq/artemis/cli/Artemis.java    |  15 +-
 .../cli/commands/address/AddressAction.java     |  77 +++++++
 .../cli/commands/address/CreateAddress.java     |  72 ++++++
 .../cli/commands/address/DeleteAddress.java     |  61 +++++
 .../cli/commands/address/HelpAddress.java       |  56 +++++
 .../commands/destination/CreateDestination.java | 147 ------------
 .../commands/destination/DeleteDestination.java | 121 ----------
 .../commands/destination/DestinationAction.java | 128 -----------
 .../commands/destination/HelpDestination.java   |  56 -----
 .../artemis/cli/commands/queue/CreateQueue.java | 101 +++++++++
 .../artemis/cli/commands/queue/DeleteQueue.java |  69 ++++++
 .../artemis/cli/commands/queue/HelpQueue.java   |  56 +++++
 .../artemis/cli/commands/queue/QueueAction.java |  77 +++++++
 .../apache/activemq/cli/test/ArtemisTest.java   |   5 +-
 .../artemis/api/core/ActiveMQException.java     |   1 -
 .../core/management/ActiveMQServerControl.java  |  19 ++
 .../impl/ActiveMQServerControlImpl.java         |  25 ++
 .../core/server/ActiveMQMessageBundle.java      |   3 +
 .../artemis/core/server/ActiveMQServer.java     |  15 +-
 .../core/server/ActiveMQServerLogger.java       |   2 +-
 .../activemq/artemis/core/server/Queue.java     |   2 +
 .../core/server/impl/ActiveMQServerImpl.java    |  39 ++--
 .../artemis/core/server/impl/QueueImpl.java     |  13 +-
 .../core/server/impl/ServerSessionImpl.java     |   2 +-
 .../management/impl/ManagementServiceImpl.java  |   1 -
 .../integration/addressing/AddressingTest.java  |  10 +-
 .../integration/cli/DestinationCommandTest.java | 226 ------------------
 .../integration/cli/DummyServerConsumer.java    | 204 +++++++++++++++++
 .../tests/integration/cli/QueueCommandTest.java | 227 +++++++++++++++++++
 .../ActiveMQServerControlUsingCoreTest.java     |  11 +
 .../integration/mqtt/imported/MQTTTest.java     |   4 +-
 31 files changed, 1126 insertions(+), 719 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/bd4b7cec/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 17c4457..94779fc 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
@@ -30,9 +30,11 @@ import org.apache.activemq.artemis.cli.commands.Kill;
 import org.apache.activemq.artemis.cli.commands.Mask;
 import org.apache.activemq.artemis.cli.commands.Run;
 import org.apache.activemq.artemis.cli.commands.Stop;
-import org.apache.activemq.artemis.cli.commands.destination.CreateDestination;
-import org.apache.activemq.artemis.cli.commands.destination.DeleteDestination;
-import org.apache.activemq.artemis.cli.commands.destination.HelpDestination;
+import org.apache.activemq.artemis.cli.commands.address.CreateAddress;
+import org.apache.activemq.artemis.cli.commands.address.DeleteAddress;
+import org.apache.activemq.artemis.cli.commands.queue.CreateQueue;
+import org.apache.activemq.artemis.cli.commands.queue.DeleteQueue;
+import org.apache.activemq.artemis.cli.commands.queue.HelpQueue;
 import org.apache.activemq.artemis.cli.commands.messages.Browse;
 import org.apache.activemq.artemis.cli.commands.messages.Consumer;
 import org.apache.activemq.artemis.cli.commands.messages.Producer;
@@ -128,8 +130,11 @@ public class Artemis {
       String instance = artemisInstance != null ? artemisInstance.getAbsolutePath() : System.getProperty("artemis.instance");
       Cli.CliBuilder<Action> builder = Cli.<Action>builder("artemis").withDescription("ActiveMQ Artemis Command Line").withCommand(HelpAction.class).withCommand(Producer.class).withCommand(Consumer.class).withCommand(Browse.class).withCommand(Mask.class).withDefaultCommand(HelpAction.class);
 
-      builder.withGroup("destination").withDescription("Destination tools group (create|delete) (example ./artemis destination create)").
-         withDefaultCommand(HelpDestination.class).withCommands(CreateDestination.class, DeleteDestination.class);
+      builder.withGroup("queue").withDescription("Queue tools group (create|delete) (example ./artemis queue create)").
+         withDefaultCommand(HelpQueue.class).withCommands(CreateQueue.class, DeleteQueue.class);
+
+      builder.withGroup("address").withDescription("Queue tools group (create|delete) (example ./artemis queue create)").
+         withDefaultCommand(HelpQueue.class).withCommands(CreateAddress.class, DeleteAddress.class);
 
       if (instance != null) {
          builder.withGroup("data").withDescription("data tools group (print|exp|imp|exp|encode|decode|compact) (example ./artemis data print)").

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/bd4b7cec/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/address/AddressAction.java
----------------------------------------------------------------------
diff --git a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/address/AddressAction.java b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/address/AddressAction.java
new file mode 100644
index 0000000..c2f1716
--- /dev/null
+++ b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/address/AddressAction.java
@@ -0,0 +1,77 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.activemq.artemis.cli.commands.address;
+
+import io.airlift.airline.Option;
+import org.apache.activemq.artemis.api.core.client.ActiveMQClient;
+import org.apache.activemq.artemis.api.core.client.ClientMessage;
+import org.apache.activemq.artemis.api.core.client.ClientRequestor;
+import org.apache.activemq.artemis.api.core.client.ClientSession;
+import org.apache.activemq.artemis.api.core.client.ClientSessionFactory;
+import org.apache.activemq.artemis.api.core.client.ServerLocator;
+import org.apache.activemq.artemis.api.core.management.ManagementHelper;
+import org.apache.activemq.artemis.cli.commands.messages.ConnectionAbstract;
+import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
+
+public abstract class AddressAction extends ConnectionAbstract {
+
+   @Option(name = "--name", description = "address name")
+   String name;
+
+   public void performCoreManagement(ManagementCallback<ClientMessage> cb) throws Exception {
+
+      try (ActiveMQConnectionFactory factory = createConnectionFactory();
+         ServerLocator locator = factory.getServerLocator();
+           ClientSessionFactory sessionFactory = locator.createSessionFactory();
+           ClientSession session = sessionFactory.createSession(user, password, false, true, true, false, ActiveMQClient.DEFAULT_ACK_BATCH_SIZE)) {
+         session.start();
+         ClientRequestor requestor = new ClientRequestor(session, "activemq.management");
+         ClientMessage message = session.createMessage(false);
+
+         cb.setUpInvocation(message);
+
+         ClientMessage reply = requestor.request(message);
+
+         if (ManagementHelper.hasOperationSucceeded(reply)) {
+            cb.requestSuccessful(reply);
+         } else {
+            cb.requestFailed(reply);
+         }
+      }
+   }
+
+   public void setName(String name) {
+      this.name = name;
+   }
+
+   public String getName() {
+      if (name == null) {
+         name = input("--name", "Please provide the destination name:", "");
+      }
+
+      return name;
+   }
+
+   public interface ManagementCallback<T> {
+
+      void setUpInvocation(T message) throws Exception;
+
+      void requestSuccessful(T reply) throws Exception;
+
+      void requestFailed(T reply) throws Exception;
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/bd4b7cec/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/address/CreateAddress.java
----------------------------------------------------------------------
diff --git a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/address/CreateAddress.java b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/address/CreateAddress.java
new file mode 100644
index 0000000..0474050
--- /dev/null
+++ b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/address/CreateAddress.java
@@ -0,0 +1,72 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.activemq.artemis.cli.commands.address;
+
+import io.airlift.airline.Command;
+import io.airlift.airline.Option;
+import org.apache.activemq.artemis.api.core.client.ClientMessage;
+import org.apache.activemq.artemis.api.core.management.ManagementHelper;
+import org.apache.activemq.artemis.cli.commands.ActionContext;
+
+@Command(name = "create", description = "create a queue or topic")
+public class CreateAddress extends AddressAction {
+
+   @Option(name = "--address", description = "address of the core queue (default queue's name)")
+   String address;
+
+   @Option(name = "--durable", description = "whether the queue is durable or not (default false)")
+   boolean durable = false;
+
+   @Option(name = "--autoCreateAddress", description = "auto create an address for this queue if one doesn't exist")
+   boolean autoCreateAddress = true;
+
+   @Override
+   public Object execute(ActionContext context) throws Exception {
+      super.execute(context);
+      createQueue(context);
+      return null;
+   }
+
+   public String getAddress() {
+      if (address == null || "".equals(address.trim())) {
+         address = getName();
+      }
+      return address.trim();
+   }
+
+   private void createQueue(final ActionContext context) throws Exception {
+      performCoreManagement(new ManagementCallback<ClientMessage>() {
+         @Override
+         public void setUpInvocation(ClientMessage message) throws Exception {
+            String address = getAddress();
+            ManagementHelper.putOperationInvocation(message, "broker", "createQueue", address, getName(), durable);
+         }
+
+         @Override
+         public void requestSuccessful(ClientMessage reply) throws Exception {
+            context.out.println("Core queue " + getName() + " created successfully.");
+         }
+
+         @Override
+         public void requestFailed(ClientMessage reply) throws Exception {
+            String errMsg = (String) ManagementHelper.getResult(reply, String.class);
+            context.err.println("Failed to create queue " + getName() + ". Reason: " + errMsg);
+         }
+      });
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/bd4b7cec/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/address/DeleteAddress.java
----------------------------------------------------------------------
diff --git a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/address/DeleteAddress.java b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/address/DeleteAddress.java
new file mode 100644
index 0000000..d6ce7f6
--- /dev/null
+++ b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/address/DeleteAddress.java
@@ -0,0 +1,61 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.activemq.artemis.cli.commands.address;
+
+import io.airlift.airline.Command;
+import io.airlift.airline.Option;
+import org.apache.activemq.artemis.api.core.client.ClientMessage;
+import org.apache.activemq.artemis.api.core.management.ManagementHelper;
+import org.apache.activemq.artemis.cli.commands.ActionContext;
+
+@Command(name = "delete", description = "delete a queue")
+public class DeleteAddress extends AddressAction {
+
+   @Option(name = "--removeConsumers", description = "whether deleting destination with consumers or not (default false)")
+   boolean removeConsumers = false;
+
+   @Option(name = "--autoDeleteAddress", description = "delete the address if this it's last last queue")
+   boolean autoDeleteAddress = false;
+
+   @Override
+   public Object execute(ActionContext context) throws Exception {
+      super.execute(context);
+      deleteQueue(context);
+      return null;
+   }
+
+   private void deleteQueue(final ActionContext context) throws Exception {
+      performCoreManagement(new ManagementCallback<ClientMessage>() {
+         @Override
+         public void setUpInvocation(ClientMessage message) throws Exception {
+            ManagementHelper.putOperationInvocation(message, "broker", "destroyQueue", getName(), removeConsumers);
+         }
+
+         @Override
+         public void requestSuccessful(ClientMessage reply) throws Exception {
+            context.out.println("Queue " + getName() + " deleted successfully.");
+         }
+
+         @Override
+         public void requestFailed(ClientMessage reply) throws Exception {
+            String errMsg = (String) ManagementHelper.getResult(reply, String.class);
+            context.err.println("Failed to delete queue " + getName() + ". Reason: " + errMsg);
+         }
+      });
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/bd4b7cec/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/address/HelpAddress.java
----------------------------------------------------------------------
diff --git a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/address/HelpAddress.java b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/address/HelpAddress.java
new file mode 100644
index 0000000..c086c01
--- /dev/null
+++ b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/address/HelpAddress.java
@@ -0,0 +1,56 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.activemq.artemis.cli.commands.address;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+
+import io.airlift.airline.Help;
+import org.apache.activemq.artemis.cli.commands.Action;
+import org.apache.activemq.artemis.cli.commands.ActionContext;
+
+public class HelpAddress extends Help implements Action {
+
+   @Override
+   public boolean isVerbose() {
+      return false;
+   }
+
+   @Override
+   public void setHomeValues(File brokerHome, File brokerInstance) {
+   }
+
+   @Override
+   public String getBrokerInstance() {
+      return null;
+   }
+
+   @Override
+   public String getBrokerHome() {
+      return null;
+   }
+
+   @Override
+   public Object execute(ActionContext context) throws Exception {
+      List<String> commands = new ArrayList<>(1);
+      commands.add("queue");
+      help(global, commands);
+      return null;
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/bd4b7cec/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/destination/CreateDestination.java
----------------------------------------------------------------------
diff --git a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/destination/CreateDestination.java b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/destination/CreateDestination.java
deleted file mode 100644
index 4cbaaa6..0000000
--- a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/destination/CreateDestination.java
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.activemq.artemis.cli.commands.destination;
-
-import javax.jms.Message;
-
-import io.airlift.airline.Command;
-import io.airlift.airline.Option;
-import org.apache.activemq.artemis.api.core.client.ClientMessage;
-import org.apache.activemq.artemis.api.core.management.ManagementHelper;
-import org.apache.activemq.artemis.api.jms.management.JMSManagementHelper;
-import org.apache.activemq.artemis.cli.commands.ActionContext;
-
-@Command(name = "create", description = "create a queue or topic")
-public class CreateDestination extends DestinationAction {
-
-   @Option(name = "--filter", description = "queue's filter string (default null)")
-   String filter = null;
-
-   @Option(name = "--address", description = "address of the core queue (default queue's name)")
-   String address;
-
-   @Option(name = "--durable", description = "whether the queue is durable or not (default false)")
-   boolean durable = false;
-
-   @Option(name = "--bindings", description = "comma separated jndi binding names (default null)")
-   String bindings = null;
-
-   @Override
-   public Object execute(ActionContext context) throws Exception {
-      super.execute(context);
-
-      if (JMS_QUEUE.equals(destType)) {
-         createJmsQueue(context);
-      } else if (CORE_QUEUE.equals(destType)) {
-         createCoreQueue(context);
-      } else if (JMS_TOPIC.equals(destType)) {
-         createJmsTopic(context);
-      } else {
-         throw new IllegalArgumentException("--type can only be one of " + JMS_QUEUE + ", " + JMS_TOPIC + " and " + CORE_QUEUE);
-      }
-      return null;
-   }
-
-   private void createJmsTopic(final ActionContext context) throws Exception {
-      performJmsManagement(new ManagementCallback<Message>() {
-         @Override
-         public void setUpInvocation(Message message) throws Exception {
-            JMSManagementHelper.putOperationInvocation(message, "jms.server", "createTopic", getName(), bindings);
-         }
-
-         @Override
-         public void requestSuccessful(Message reply) throws Exception {
-            boolean result = (boolean) JMSManagementHelper.getResult(reply, Boolean.class);
-            if (result) {
-               context.out.println("Topic " + getName() + " created successfully.");
-            } else {
-               context.err.println("Failed to create topic " + getName() + ".");
-            }
-         }
-
-         @Override
-         public void requestFailed(Message reply) throws Exception {
-            String errorMsg = (String) JMSManagementHelper.getResult(reply, String.class);
-            context.err.println("Failed to create topic " + getName() + ". Reason: " + errorMsg);
-         }
-      });
-   }
-
-   public String getAddress() {
-      if (address == null || "".equals(address.trim())) {
-         address = getName();
-      }
-      return address.trim();
-   }
-
-   private void createCoreQueue(final ActionContext context) throws Exception {
-      performCoreManagement(new ManagementCallback<ClientMessage>() {
-         @Override
-         public void setUpInvocation(ClientMessage message) throws Exception {
-            String address = getAddress();
-            ManagementHelper.putOperationInvocation(message, "core.server", "createQueue", address, getName(), filter, durable);
-         }
-
-         @Override
-         public void requestSuccessful(ClientMessage reply) throws Exception {
-            context.out.println("Core queue " + getName() + " created successfully.");
-         }
-
-         @Override
-         public void requestFailed(ClientMessage reply) throws Exception {
-            String errMsg = (String) ManagementHelper.getResult(reply, String.class);
-            context.err.println("Failed to create queue " + getName() + ". Reason: " + errMsg);
-         }
-      });
-   }
-
-   private void createJmsQueue(final ActionContext context) throws Exception {
-
-      performJmsManagement(new ManagementCallback<Message>() {
-
-         @Override
-         public void setUpInvocation(Message message) throws Exception {
-            JMSManagementHelper.putOperationInvocation(message, "jms.server", "createQueue", getName(), bindings, filter, durable);
-         }
-
-         @Override
-         public void requestSuccessful(Message reply) throws Exception {
-            boolean result = (boolean) JMSManagementHelper.getResult(reply, Boolean.class);
-            if (result) {
-               context.out.println("Jms queue " + getName() + " created successfully.");
-            } else {
-               context.err.println("Failed to create jms queue " + getName() + ".");
-            }
-         }
-
-         @Override
-         public void requestFailed(Message reply) throws Exception {
-            String errorMsg = (String) JMSManagementHelper.getResult(reply, String.class);
-            context.err.println("Failed to create jms queue " + getName() + ". Reason: " + errorMsg);
-         }
-      });
-   }
-
-   public void setFilter(String filter) {
-      this.filter = filter;
-   }
-
-   public void setBindings(String bindings) {
-      this.bindings = bindings;
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/bd4b7cec/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/destination/DeleteDestination.java
----------------------------------------------------------------------
diff --git a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/destination/DeleteDestination.java b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/destination/DeleteDestination.java
deleted file mode 100644
index 93dbf5e..0000000
--- a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/destination/DeleteDestination.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.activemq.artemis.cli.commands.destination;
-
-import javax.jms.Message;
-
-import io.airlift.airline.Command;
-import io.airlift.airline.Option;
-import org.apache.activemq.artemis.api.core.client.ClientMessage;
-import org.apache.activemq.artemis.api.core.management.ManagementHelper;
-import org.apache.activemq.artemis.api.jms.management.JMSManagementHelper;
-import org.apache.activemq.artemis.cli.commands.ActionContext;
-
-@Command(name = "delete", description = "delete a queue or topic")
-public class DeleteDestination extends DestinationAction {
-
-   @Option(name = "--removeConsumers", description = "whether deleting destination with consumers or not (default false)")
-   boolean removeConsumers = false;
-
-   @Override
-   public Object execute(ActionContext context) throws Exception {
-      super.execute(context);
-
-      if (JMS_QUEUE.equals(destType)) {
-         deleteJmsQueue(context);
-      } else if (CORE_QUEUE.equals(destType)) {
-         deleteCoreQueue(context);
-      } else if (JMS_TOPIC.equals(destType)) {
-         deleteJmsTopic(context);
-      } else {
-         throw new IllegalArgumentException("--type can only be one of " + JMS_QUEUE + ", " + JMS_TOPIC + " and " + CORE_QUEUE);
-      }
-      return null;
-   }
-
-   private void deleteJmsTopic(final ActionContext context) throws Exception {
-      performJmsManagement(new ManagementCallback<Message>() {
-         @Override
-         public void setUpInvocation(Message message) throws Exception {
-            JMSManagementHelper.putOperationInvocation(message, "jms.server", "destroyTopic", getName(), removeConsumers);
-         }
-
-         @Override
-         public void requestSuccessful(Message reply) throws Exception {
-            boolean result = (boolean) JMSManagementHelper.getResult(reply, Boolean.class);
-            if (result) {
-               context.out.println("Topic " + getName() + " deleted successfully.");
-            } else {
-               context.err.println("Failed to delete topic " + getName());
-            }
-         }
-
-         @Override
-         public void requestFailed(Message reply) throws Exception {
-            String errorMsg = (String) JMSManagementHelper.getResult(reply, String.class);
-            context.err.println("Failed to delete topic " + getName() + ". Reason: " + errorMsg);
-         }
-      });
-   }
-
-   private void deleteJmsQueue(final ActionContext context) throws Exception {
-      performJmsManagement(new ManagementCallback<Message>() {
-         @Override
-         public void setUpInvocation(Message message) throws Exception {
-            JMSManagementHelper.putOperationInvocation(message, "jms.server", "destroyQueue", getName(), removeConsumers);
-         }
-
-         @Override
-         public void requestSuccessful(Message reply) throws Exception {
-            boolean result = (boolean) JMSManagementHelper.getResult(reply, Boolean.class);
-            if (result) {
-               context.out.println("Jms queue " + getName() + " deleted successfully.");
-            } else {
-               context.err.println("Failed to delete queue " + getName());
-            }
-         }
-
-         @Override
-         public void requestFailed(Message reply) throws Exception {
-            String errorMsg = (String) JMSManagementHelper.getResult(reply, String.class);
-            context.err.println("Failed to create " + getName() + " with reason: " + errorMsg);
-         }
-      });
-   }
-
-   private void deleteCoreQueue(final ActionContext context) throws Exception {
-      performCoreManagement(new ManagementCallback<ClientMessage>() {
-         @Override
-         public void setUpInvocation(ClientMessage message) throws Exception {
-            ManagementHelper.putOperationInvocation(message, "core.server", "destroyQueue", getName());
-         }
-
-         @Override
-         public void requestSuccessful(ClientMessage reply) throws Exception {
-            context.out.println("Queue " + getName() + " deleted successfully.");
-         }
-
-         @Override
-         public void requestFailed(ClientMessage reply) throws Exception {
-            String errMsg = (String) ManagementHelper.getResult(reply, String.class);
-            context.err.println("Failed to delete queue " + getName() + ". Reason: " + errMsg);
-         }
-      });
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/bd4b7cec/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/destination/DestinationAction.java
----------------------------------------------------------------------
diff --git a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/destination/DestinationAction.java b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/destination/DestinationAction.java
deleted file mode 100644
index 55353d9..0000000
--- a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/destination/DestinationAction.java
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.activemq.artemis.cli.commands.destination;
-
-import javax.jms.Message;
-import javax.jms.Queue;
-import javax.jms.QueueRequestor;
-import javax.jms.Session;
-
-import io.airlift.airline.Option;
-import org.apache.activemq.artemis.api.core.client.ActiveMQClient;
-import org.apache.activemq.artemis.api.core.client.ClientMessage;
-import org.apache.activemq.artemis.api.core.client.ClientRequestor;
-import org.apache.activemq.artemis.api.core.client.ClientSession;
-import org.apache.activemq.artemis.api.core.client.ClientSessionFactory;
-import org.apache.activemq.artemis.api.core.client.ServerLocator;
-import org.apache.activemq.artemis.api.core.management.ManagementHelper;
-import org.apache.activemq.artemis.api.jms.ActiveMQJMSClient;
-import org.apache.activemq.artemis.api.jms.management.JMSManagementHelper;
-import org.apache.activemq.artemis.cli.commands.messages.ConnectionAbstract;
-import org.apache.activemq.artemis.jms.client.ActiveMQConnection;
-import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
-import org.apache.activemq.artemis.jms.client.ActiveMQSession;
-
-public abstract class DestinationAction extends ConnectionAbstract {
-
-   public static final String JMS_QUEUE = "jms-queue";
-   public static final String JMS_TOPIC = "topic";
-   public static final String CORE_QUEUE = "core-queue";
-
-   @Option(name = "--type", description = "type of destination to be created (one of jms-queue, topic and core-queue, default jms-queue")
-   String destType = JMS_QUEUE;
-
-   @Option(name = "--name", description = "destination name")
-   String name;
-
-   public void performJmsManagement(ManagementCallback<Message> cb) throws Exception {
-
-      try (ActiveMQConnectionFactory factory = createConnectionFactory();
-           ActiveMQConnection connection = (ActiveMQConnection) factory.createConnection();
-           ActiveMQSession session = (ActiveMQSession) connection.createSession(false, Session.AUTO_ACKNOWLEDGE)) {
-
-         Queue managementQueue = ActiveMQJMSClient.createQueue("activemq.management");
-         QueueRequestor requestor = new QueueRequestor(session, managementQueue);
-
-         connection.start();
-
-         Message message = session.createMessage();
-
-         cb.setUpInvocation(message);
-
-         Message reply = requestor.request(message);
-
-         boolean result = JMSManagementHelper.hasOperationSucceeded(reply);
-
-         if (result) {
-            cb.requestSuccessful(reply);
-         } else {
-            cb.requestFailed(reply);
-         }
-      }
-   }
-
-   public void performCoreManagement(ManagementCallback<ClientMessage> cb) throws Exception {
-
-      try (ActiveMQConnectionFactory factory = createConnectionFactory();
-         ServerLocator locator = factory.getServerLocator();
-           ClientSessionFactory sessionFactory = locator.createSessionFactory();
-           ClientSession session = sessionFactory.createSession(user, password, false, true, true, false, ActiveMQClient.DEFAULT_ACK_BATCH_SIZE)) {
-         session.start();
-         ClientRequestor requestor = new ClientRequestor(session, "activemq.management");
-         ClientMessage message = session.createMessage(false);
-
-         cb.setUpInvocation(message);
-
-         ClientMessage reply = requestor.request(message);
-
-         if (ManagementHelper.hasOperationSucceeded(reply)) {
-            cb.requestSuccessful(reply);
-         } else {
-            cb.requestFailed(reply);
-         }
-      }
-   }
-
-   public void setName(String name) {
-      this.name = name;
-   }
-
-   public String getName() {
-      if (name == null) {
-         name = input("--name", "Please provide the destination name:", "");
-      }
-
-      return name;
-   }
-
-   public String getDestType() {
-      return destType;
-   }
-
-   public void setDestType(String destType) {
-      this.destType = destType;
-   }
-
-   public interface ManagementCallback<T> {
-
-      void setUpInvocation(T message) throws Exception;
-
-      void requestSuccessful(T reply) throws Exception;
-
-      void requestFailed(T reply) throws Exception;
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/bd4b7cec/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/destination/HelpDestination.java
----------------------------------------------------------------------
diff --git a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/destination/HelpDestination.java b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/destination/HelpDestination.java
deleted file mode 100644
index 3455520..0000000
--- a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/destination/HelpDestination.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.activemq.artemis.cli.commands.destination;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.List;
-
-import io.airlift.airline.Help;
-import org.apache.activemq.artemis.cli.commands.Action;
-import org.apache.activemq.artemis.cli.commands.ActionContext;
-
-public class HelpDestination extends Help implements Action {
-
-   @Override
-   public boolean isVerbose() {
-      return false;
-   }
-
-   @Override
-   public void setHomeValues(File brokerHome, File brokerInstance) {
-   }
-
-   @Override
-   public String getBrokerInstance() {
-      return null;
-   }
-
-   @Override
-   public String getBrokerHome() {
-      return null;
-   }
-
-   @Override
-   public Object execute(ActionContext context) throws Exception {
-      List<String> commands = new ArrayList<>(1);
-      commands.add("destination");
-      help(global, commands);
-      return null;
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/bd4b7cec/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/queue/CreateQueue.java
----------------------------------------------------------------------
diff --git a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/queue/CreateQueue.java b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/queue/CreateQueue.java
new file mode 100644
index 0000000..fba9369
--- /dev/null
+++ b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/queue/CreateQueue.java
@@ -0,0 +1,101 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.activemq.artemis.cli.commands.queue;
+
+import io.airlift.airline.Command;
+import io.airlift.airline.Option;
+import org.apache.activemq.artemis.api.core.client.ClientMessage;
+import org.apache.activemq.artemis.api.core.management.ManagementHelper;
+import org.apache.activemq.artemis.cli.commands.ActionContext;
+
+@Command(name = "create", description = "create a queue or topic")
+public class CreateQueue extends QueueAction {
+
+   @Option(name = "--filter", description = "queue's filter string (default null)")
+   String filter = null;
+
+   @Option(name = "--address", description = "address of the queue (default queue's name)")
+   String address;
+
+   @Option(name = "--durable", description = "whether the queue is durable or not (default false)")
+   boolean durable = false;
+
+   @Option(name = "--deleteOnNoConsumers", description = "whether to delete this queue when it's last consumers disconnects)")
+   boolean deleteOnNoConsumers = false;
+
+   @Option(name = "--maxConsumers", description = "Maximum number of consumers allowed on this queue at any one time (default no limit)")
+   int maxConsumers = -1;
+
+   @Option(name = "--autoCreateAddress", description = "Auto create the address (if it doesn't exist) with default values")
+   boolean autoCreateAddress = false;
+
+   @Override
+   public Object execute(ActionContext context) throws Exception {
+      super.execute(context);
+      createQueue(context);
+      return null;
+   }
+
+   public String getAddress() {
+      if (address == null || "".equals(address.trim())) {
+         address = getName();
+      }
+      return address.trim();
+   }
+
+   private void createQueue(final ActionContext context) throws Exception {
+      performCoreManagement(new ManagementCallback<ClientMessage>() {
+         @Override
+         public void setUpInvocation(ClientMessage message) throws Exception {
+            String address = getAddress();
+            ManagementHelper.putOperationInvocation(message, "broker", "createQueue", address, getName(), filter, durable, maxConsumers, deleteOnNoConsumers, autoCreateAddress);
+         }
+
+         @Override
+         public void requestSuccessful(ClientMessage reply) throws Exception {
+            context.out.println("Core queue " + getName() + " created successfully.");
+         }
+
+         @Override
+         public void requestFailed(ClientMessage reply) throws Exception {
+            String errMsg = (String) ManagementHelper.getResult(reply, String.class);
+            context.err.println("Failed to create queue " + getName() + ". Reason: " + errMsg);
+         }
+      });
+   }
+
+   public void setFilter(String filter) {
+      this.filter = filter;
+   }
+
+   public void setAutoCreateAddress(boolean autoCreateAddress) {
+      this.autoCreateAddress = autoCreateAddress;
+   }
+
+   public void setMaxConsumers(int maxConsumers) {
+      this.maxConsumers = maxConsumers;
+   }
+
+   public void setDeleteOnNoConsumers(boolean deleteOnNoConsumers) {
+      this.deleteOnNoConsumers = deleteOnNoConsumers;
+   }
+
+   public void setAddress(String address) {
+      this.address = address;
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/bd4b7cec/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/queue/DeleteQueue.java
----------------------------------------------------------------------
diff --git a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/queue/DeleteQueue.java b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/queue/DeleteQueue.java
new file mode 100644
index 0000000..5d92e81
--- /dev/null
+++ b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/queue/DeleteQueue.java
@@ -0,0 +1,69 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.activemq.artemis.cli.commands.queue;
+
+import io.airlift.airline.Command;
+import io.airlift.airline.Option;
+import org.apache.activemq.artemis.api.core.client.ClientMessage;
+import org.apache.activemq.artemis.api.core.management.ManagementHelper;
+import org.apache.activemq.artemis.cli.commands.ActionContext;
+
+@Command(name = "delete", description = "delete a queue")
+public class DeleteQueue extends QueueAction {
+
+   @Option(name = "--removeConsumers", description = "whether deleting destination with consumers or not (default false)")
+   boolean removeConsumers = false;
+
+   @Option(name = "--autoDeleteAddress", description = "delete the address if this it's last last queue")
+   boolean autoDeleteAddress = false;
+
+   @Override
+   public Object execute(ActionContext context) throws Exception {
+      super.execute(context);
+      deleteQueue(context);
+      return null;
+   }
+
+   private void deleteQueue(final ActionContext context) throws Exception {
+      performCoreManagement(new ManagementCallback<ClientMessage>() {
+         @Override
+         public void setUpInvocation(ClientMessage message) throws Exception {
+            ManagementHelper.putOperationInvocation(message, "broker", "destroyQueue", getName(), removeConsumers);
+         }
+
+         @Override
+         public void requestSuccessful(ClientMessage reply) throws Exception {
+            context.out.println("Queue " + getName() + " deleted successfully.");
+         }
+
+         @Override
+         public void requestFailed(ClientMessage reply) throws Exception {
+            String errMsg = (String) ManagementHelper.getResult(reply, String.class);
+            context.err.println("Failed to delete queue " + getName() + ". Reason: " + errMsg);
+         }
+      });
+   }
+
+   public void setRemoveConsumers(boolean removeConsumers) {
+      this.removeConsumers = removeConsumers;
+   }
+
+   public void setAutoDeleteAddress(boolean autoDeleteAddress) {
+      this.autoDeleteAddress = autoDeleteAddress;
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/bd4b7cec/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/queue/HelpQueue.java
----------------------------------------------------------------------
diff --git a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/queue/HelpQueue.java b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/queue/HelpQueue.java
new file mode 100644
index 0000000..687e0f4
--- /dev/null
+++ b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/queue/HelpQueue.java
@@ -0,0 +1,56 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.activemq.artemis.cli.commands.queue;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+
+import io.airlift.airline.Help;
+import org.apache.activemq.artemis.cli.commands.Action;
+import org.apache.activemq.artemis.cli.commands.ActionContext;
+
+public class HelpQueue extends Help implements Action {
+
+   @Override
+   public boolean isVerbose() {
+      return false;
+   }
+
+   @Override
+   public void setHomeValues(File brokerHome, File brokerInstance) {
+   }
+
+   @Override
+   public String getBrokerInstance() {
+      return null;
+   }
+
+   @Override
+   public String getBrokerHome() {
+      return null;
+   }
+
+   @Override
+   public Object execute(ActionContext context) throws Exception {
+      List<String> commands = new ArrayList<>(1);
+      commands.add("queue");
+      help(global, commands);
+      return null;
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/bd4b7cec/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/queue/QueueAction.java
----------------------------------------------------------------------
diff --git a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/queue/QueueAction.java b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/queue/QueueAction.java
new file mode 100644
index 0000000..dc839ef
--- /dev/null
+++ b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/queue/QueueAction.java
@@ -0,0 +1,77 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.activemq.artemis.cli.commands.queue;
+
+import io.airlift.airline.Option;
+import org.apache.activemq.artemis.api.core.client.ActiveMQClient;
+import org.apache.activemq.artemis.api.core.client.ClientMessage;
+import org.apache.activemq.artemis.api.core.client.ClientRequestor;
+import org.apache.activemq.artemis.api.core.client.ClientSession;
+import org.apache.activemq.artemis.api.core.client.ClientSessionFactory;
+import org.apache.activemq.artemis.api.core.client.ServerLocator;
+import org.apache.activemq.artemis.api.core.management.ManagementHelper;
+import org.apache.activemq.artemis.cli.commands.messages.ConnectionAbstract;
+import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
+
+public abstract class QueueAction extends ConnectionAbstract {
+
+   @Option(name = "--name", description = "queue name")
+   String name;
+
+   public void performCoreManagement(ManagementCallback<ClientMessage> cb) throws Exception {
+
+      try (ActiveMQConnectionFactory factory = createConnectionFactory();
+         ServerLocator locator = factory.getServerLocator();
+           ClientSessionFactory sessionFactory = locator.createSessionFactory();
+           ClientSession session = sessionFactory.createSession(user, password, false, true, true, false, ActiveMQClient.DEFAULT_ACK_BATCH_SIZE)) {
+         session.start();
+         ClientRequestor requestor = new ClientRequestor(session, "activemq.management");
+         ClientMessage message = session.createMessage(false);
+
+         cb.setUpInvocation(message);
+
+         ClientMessage reply = requestor.request(message);
+
+         if (ManagementHelper.hasOperationSucceeded(reply)) {
+            cb.requestSuccessful(reply);
+         } else {
+            cb.requestFailed(reply);
+         }
+      }
+   }
+
+   public void setName(String name) {
+      this.name = name;
+   }
+
+   public String getName() {
+      if (name == null) {
+         name = input("--name", "Please provide the destination name:", "");
+      }
+
+      return name;
+   }
+
+   public interface ManagementCallback<T> {
+
+      void setUpInvocation(T message) throws Exception;
+
+      void requestSuccessful(T reply) throws Exception;
+
+      void requestFailed(T reply) throws Exception;
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/bd4b7cec/artemis-cli/src/test/java/org/apache/activemq/cli/test/ArtemisTest.java
----------------------------------------------------------------------
diff --git a/artemis-cli/src/test/java/org/apache/activemq/cli/test/ArtemisTest.java b/artemis-cli/src/test/java/org/apache/activemq/cli/test/ArtemisTest.java
index cac6229..dd306e9 100644
--- a/artemis-cli/src/test/java/org/apache/activemq/cli/test/ArtemisTest.java
+++ b/artemis-cli/src/test/java/org/apache/activemq/cli/test/ArtemisTest.java
@@ -536,13 +536,16 @@ public class ArtemisTest {
 
 
       // This is usually set when run from the command line via artemis.profile
-      Run.setEmbedded(true);
+      Run.setEmbedded(false);
       Artemis.main("create", instanceFolder.getAbsolutePath(), "--force", "--silent", "--no-web", "--queues", queues, "--topics", topics, "--no-autotune", "--require-login");
       System.setProperty("artemis.instance", instanceFolder.getAbsolutePath());
 
       // Some exceptions may happen on the initialization, but they should be ok on start the basic core protocol
       Artemis.internalExecute("run");
 
+      Artemis.main("queue", "create", "--name", "q1", "--address", "q1", "--user", "admin", "--password", "admin");
+      Artemis.main("queue", "create", "--name", "t2", "--address", "t2", "--user", "admin", "--password", "admin");
+
       try {
          try (ServerLocator locator = ServerLocatorImpl.newLocator("tcp://localhost:61616");
               ClientSessionFactory factory = locator.createSessionFactory();

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/bd4b7cec/artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/ActiveMQException.java
----------------------------------------------------------------------
diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/ActiveMQException.java b/artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/ActiveMQException.java
index 6404c74..16e2b41 100644
--- a/artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/ActiveMQException.java
+++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/ActiveMQException.java
@@ -76,5 +76,4 @@ public class ActiveMQException extends Exception {
    public String toString() {
       return this.getClass().getSimpleName() + "[errorType=" + type + " message=" + getMessage() + "]";
    }
-
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/bd4b7cec/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/ActiveMQServerControl.java
----------------------------------------------------------------------
diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/ActiveMQServerControl.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/ActiveMQServerControl.java
index 7772459..4384d54 100644
--- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/ActiveMQServerControl.java
+++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/ActiveMQServerControl.java
@@ -490,6 +490,25 @@ public interface ActiveMQServerControl {
                     @Parameter(name = "durable", desc = "Is the queue durable?") boolean durable) throws Exception;
 
    /**
+    * Create a queue.
+    * <br>
+    * If {@code address} is {@code null} it will be defaulted to {@code name}.
+    * <br>
+    * This method throws a {@link org.apache.activemq.artemis.api.core.ActiveMQQueueExistsException}) exception if the queue already exits.
+    *
+    * @param address address to bind the queue to
+    * @param name    name of the queue
+    * @param durable whether the queue is durable
+    */
+   @Operation(desc = "Create a queue with the specified address, name and durability", impact = MBeanOperationInfo.ACTION)
+   void createQueue(@Parameter(name = "address", desc = "Address of the queue") String address,
+                    @Parameter(name = "name", desc = "Name of the queue") String name,
+                    @Parameter(name = "filter", desc = "Filter of the queue") String filter,
+                    @Parameter(name = "durable", desc = "Is the queue durable?") boolean durable,
+                    @Parameter(name = "maxConsumers", desc = "The maximum number of consumers allowed on this queue at any one time") int maxConsumers,
+                    @Parameter(name = "deleteOnNoConsumers", desc = "Delete this queue when the last consumer disconnects") boolean deleteOnNoConsumers,
+                    @Parameter(name = "autoCreateAddress", desc = "Create an address with default values should a matching address not be found") boolean autoCreateAddress) throws Exception;
+   /**
     * Deploy a durable queue.
     * <br>
     * If {@code address} is {@code null} it will be defaulted to {@code name}.

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/bd4b7cec/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/ActiveMQServerControlImpl.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/ActiveMQServerControlImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/ActiveMQServerControlImpl.java
index a183187..f2a193f 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/ActiveMQServerControlImpl.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/ActiveMQServerControlImpl.java
@@ -49,6 +49,7 @@ import org.apache.activemq.artemis.api.core.management.AddressControl;
 import org.apache.activemq.artemis.api.core.management.BridgeControl;
 import org.apache.activemq.artemis.api.core.management.CoreNotificationType;
 import org.apache.activemq.artemis.api.core.management.DivertControl;
+import org.apache.activemq.artemis.api.core.management.Parameter;
 import org.apache.activemq.artemis.api.core.management.QueueControl;
 import org.apache.activemq.artemis.core.client.impl.Topology;
 import org.apache.activemq.artemis.core.client.impl.TopologyMemberImpl;
@@ -633,6 +634,30 @@ public class ActiveMQServerControlImpl extends AbstractControl implements Active
    }
 
    @Override
+   public void createQueue(@Parameter(name = "address", desc = "Address of the queue") String address,
+                           @Parameter(name = "name", desc = "Name of the queue") String name,
+                           @Parameter(name = "filter", desc = "Filter of the queue") String filterStr,
+                           @Parameter(name = "durable", desc = "Is the queue durable?") boolean durable,
+                           @Parameter(name = "maxConsumers", desc = "The maximum number of consumers allowed on this queue at any one time") int maxConsumers,
+                           @Parameter(name = "deleteOnNoConsumers", desc = "Delete this queue when the last consumer disconnects") boolean deleteOnNoConsumers,
+                           @Parameter(name = "autoCreateAddress", desc = "Create an address with default values if one does not exist") boolean autoCreateAddress) throws Exception {
+      checkStarted();
+
+      clearIO();
+
+      SimpleString filter = filterStr == null ? null : new SimpleString(filterStr);
+      try {
+         if (filterStr != null && !filterStr.trim().equals("")) {
+            filter = new SimpleString(filterStr);
+         }
+
+         server.createQueue(SimpleString.toSimpleString(address), new SimpleString(name), filter, durable, false, maxConsumers, deleteOnNoConsumers, autoCreateAddress);
+      } finally {
+         blockOnIO();
+      }
+   }
+
+   @Override
    public void createQueue(final String address,
                            final String name,
                            final String filterStr,

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/bd4b7cec/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQMessageBundle.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQMessageBundle.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQMessageBundle.java
index 6d8cf30..a64e4fc 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQMessageBundle.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQMessageBundle.java
@@ -390,4 +390,7 @@ public interface ActiveMQMessageBundle {
 
    @Message(id = 119202, value = "Invalid Queue Configuration for Queue {0}, Address {1}.  Expected {2} to be {3} but was {4}", format = Message.Format.MESSAGE_FORMAT)
    ActiveMQInvalidQueueConfiguration invalidQueueConfiguration(SimpleString address, SimpleString queueName, String queuePropertyName, Object expectedValue, Object actualValue);
+
+   @Message(id = 119203, value = "Address Does Not Exist: {0}", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQInvalidQueueConfiguration addressDoesNotExist(SimpleString address);
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/bd4b7cec/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQServer.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQServer.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQServer.java
index 5dc22d6..723ddf4 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQServer.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQServer.java
@@ -281,7 +281,8 @@ public interface ActiveMQServer extends ActiveMQComponent {
                      boolean durable,
                      boolean temporary,
                      Integer maxConsumers,
-                     Boolean deleteOnNoConsumers) throws Exception;
+                     Boolean deleteOnNoConsumers,
+                     boolean autoCreateAddress) throws Exception;
 
    Queue createQueue(SimpleString address,
                      SimpleString queueName,
@@ -297,7 +298,8 @@ public interface ActiveMQServer extends ActiveMQComponent {
                      boolean durable,
                      boolean temporary,
                      Integer maxConsumers,
-                     Boolean deleteOnNoConsumers) throws Exception;
+                     Boolean deleteOnNoConsumers,
+                     boolean autoCreateAddress) throws Exception;
 
    Queue createQueue(SimpleString address,
                      SimpleString queueName,
@@ -315,7 +317,8 @@ public interface ActiveMQServer extends ActiveMQComponent {
                      boolean temporary,
                      boolean autoCreated,
                      Integer maxConsumers,
-                     Boolean deleteOnNoConsumers) throws Exception;
+                     Boolean deleteOnNoConsumers,
+                     boolean autoCreateAddress) throws Exception;
 
    Queue deployQueue(SimpleString address,
                      SimpleString queueName,
@@ -343,7 +346,8 @@ public interface ActiveMQServer extends ActiveMQComponent {
                      boolean temporary,
                      boolean autoCreated,
                      Integer maxConsumers,
-                     Boolean deleteOnNoConsumers) throws Exception;
+                     Boolean deleteOnNoConsumers,
+                     boolean autoCreateAddress) throws Exception;
 
    void destroyQueue(SimpleString queueName) throws Exception;
 
@@ -406,7 +410,8 @@ public interface ActiveMQServer extends ActiveMQComponent {
                      boolean transientQueue,
                      boolean autoCreated,
                      Integer maxConsumers,
-                     Boolean deleteOnNoConsumers) throws Exception;
+                     Boolean deleteOnNoConsumers,
+                     boolean autoCreateAddress) throws Exception;
 
    /*
          * add a ProtocolManagerFactory to be used. Note if @see Configuration#isResolveProtocols is tur then this factory will

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/bd4b7cec/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 51aa57b..9907f7f 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
@@ -785,7 +785,7 @@ public interface ActiveMQServerLogger extends BasicLogger {
       format = Message.Format.MESSAGE_FORMAT)
    void noQueueIdDefined(ServerMessage message, ServerMessage messageCopy, SimpleString idsHeaderName);
 
-   @LogMessage(level = Logger.Level.WARN)
+   @LogMessage(level = Logger.Level.TRACE)
    @Message(id = 222111, value = "exception while invoking {0} on {1}",
       format = Message.Format.MESSAGE_FORMAT)
    void managementOperationError(@Cause Exception e, String op, String resourceName);

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/bd4b7cec/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/Queue.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/Queue.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/Queue.java
index 2b845d5..0120a53 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/Queue.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/Queue.java
@@ -106,6 +106,8 @@ public interface Queue extends Bindable {
 
    void deleteQueue(boolean removeConsumers) throws Exception;
 
+   void deleteQueue(boolean removeConsumers, boolean autoDeleteAddress) throws Exception;
+
    void destroyPaging() throws Exception;
 
    long getMessageCount();

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/bd4b7cec/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
index a4c139b..1e1424d 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
@@ -1406,8 +1406,9 @@ public class ActiveMQServerImpl implements ActiveMQServer {
                             final boolean durable,
                             final boolean temporary,
                             final Integer maxConsumers,
-                            final Boolean deleteOnNoConsumers) throws Exception {
-      return createQueue(address, queueName, filterString, null, durable, temporary, false, false, false, maxConsumers, deleteOnNoConsumers);
+                            final Boolean deleteOnNoConsumers,
+                            final boolean autoCreateAddress) throws Exception {
+      return createQueue(address, queueName, filterString, null, durable, temporary, false, false, false, maxConsumers, deleteOnNoConsumers, autoCreateAddress);
    }
 
    @Override
@@ -1428,8 +1429,9 @@ public class ActiveMQServerImpl implements ActiveMQServer {
                             boolean durable,
                             boolean temporary,
                             Integer maxConsumers,
-                            Boolean deleteOnNoConsumers) throws Exception {
-      return createQueue(address, queueName, filter, user, durable, temporary, false, false, false, maxConsumers, deleteOnNoConsumers);
+                            Boolean deleteOnNoConsumers,
+                            boolean autoCreateAddress) throws Exception {
+      return createQueue(address, queueName, filter, user, durable, temporary, false, false, false, maxConsumers, deleteOnNoConsumers, autoCreateAddress);
    }
 
    @Override
@@ -1452,8 +1454,9 @@ public class ActiveMQServerImpl implements ActiveMQServer {
                             boolean temporary,
                             boolean autoCreated,
                             Integer maxConsumers,
-                            Boolean deleteOnNoConsumers) throws Exception {
-      return createQueue(address, queueName, filter, user, durable, temporary, false, false, autoCreated, maxConsumers, deleteOnNoConsumers);
+                            Boolean deleteOnNoConsumers,
+                            boolean autoCreateAddress) throws Exception {
+      return createQueue(address, queueName, filter, user, durable, temporary, false, false, autoCreated, maxConsumers, deleteOnNoConsumers, autoCreateAddress);
    }
 
    @Override
@@ -1515,7 +1518,7 @@ public class ActiveMQServerImpl implements ActiveMQServer {
                             final boolean durable,
                             final boolean temporary,
                             final boolean autoCreated) throws Exception {
-      return deployQueue(address, queueName, filterString, durable, temporary, autoCreated, null, null);
+      return deployQueue(address, queueName, filterString, durable, temporary, autoCreated, null, null, true);
    }
 
    @Override
@@ -1526,12 +1529,13 @@ public class ActiveMQServerImpl implements ActiveMQServer {
                             final boolean temporary,
                             final boolean autoCreated,
                             final Integer maxConsumers,
-                            final Boolean deleteOnNoConsumers) throws Exception {
+                            final Boolean deleteOnNoConsumers,
+                            final boolean autoCreateAddress) throws Exception {
 
       // TODO: fix logging here as this could be for a topic or queue
       ActiveMQServerLogger.LOGGER.deployQueue(queueName);
 
-      return createQueue(address, queueName, filterString, null, durable, temporary, true, false, autoCreated, maxConsumers, deleteOnNoConsumers);
+      return createQueue(address, queueName, filterString, null, durable, temporary, true, false, autoCreated, maxConsumers, deleteOnNoConsumers, autoCreateAddress);
    }
 
    @Override
@@ -2131,7 +2135,7 @@ public class ActiveMQServerImpl implements ActiveMQServer {
 
    private void deployQueuesFromListCoreQueueConfiguration(List<CoreQueueConfiguration> queues) throws Exception {
       for (CoreQueueConfiguration config : queues) {
-         deployQueue(SimpleString.toSimpleString(config.getAddress()), SimpleString.toSimpleString(config.getName()), SimpleString.toSimpleString(config.getFilterString()), config.isDurable(), false, false, config.getMaxConsumers(), config.getDeleteOnNoConsumers());
+         deployQueue(SimpleString.toSimpleString(config.getAddress()), SimpleString.toSimpleString(config.getName()), SimpleString.toSimpleString(config.getFilterString()), config.isDurable(), false, false, config.getMaxConsumers(), config.getDeleteOnNoConsumers(), true);
       }
    }
 
@@ -2298,7 +2302,8 @@ public class ActiveMQServerImpl implements ActiveMQServer {
                          transientQueue,
                          autoCreated,
                          null,
-                         null);
+                         null,
+                         true);
    }
 
    @Override
@@ -2312,7 +2317,9 @@ public class ActiveMQServerImpl implements ActiveMQServer {
                             final boolean transientQueue,
                             final boolean autoCreated,
                             final Integer maxConsumers,
-                            final Boolean deleteOnNoConsumers) throws Exception {
+                            final Boolean deleteOnNoConsumers,
+                            final boolean autoCreateAddress) throws Exception {
+
       final QueueBinding binding = (QueueBinding) postOffice.getBinding(queueName);
       if (binding != null) {
          if (ignoreIfExists) {
@@ -2335,11 +2342,15 @@ public class ActiveMQServerImpl implements ActiveMQServer {
       }
 
       AddressInfo defaultAddressInfo = new AddressInfo(addressName);
-      // FIXME This boils down to a putIfAbsent (avoids race).  This should be reflected in the API.
       AddressInfo info = postOffice.getAddressInfo(addressName);
 
       if (info == null) {
-         info = defaultAddressInfo;
+         if (autoCreateAddress) {
+            info = defaultAddressInfo;
+         }
+         else {
+            throw ActiveMQMessageBundle.BUNDLE.addressDoesNotExist(addressName);
+         }
       }
 
       final boolean isDeleteOnNoConsumers = deleteOnNoConsumers == null ? info.isDefaultDeleteOnNoConsumers() : deleteOnNoConsumers;

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/bd4b7cec/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueImpl.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueImpl.java
index 7c614ae..b9cb79f 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueImpl.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueImpl.java
@@ -1420,8 +1420,14 @@ public class QueueImpl implements Queue {
 
    @Override
    public void deleteQueue(boolean removeConsumers) throws Exception {
+      deleteQueue(removeConsumers, false);
+   }
+
+   @Override
+   public void deleteQueue(boolean removeConsumers, boolean autoDeleteAddress) throws Exception {
       synchronized (this) {
-         if (this.queueDestroyed) return;
+         if (this.queueDestroyed)
+            return;
          this.queueDestroyed = true;
       }
 
@@ -1454,7 +1460,6 @@ public class QueueImpl implements Queue {
          tx.rollback();
          throw e;
       }
-
    }
 
    @Override
@@ -1799,7 +1804,7 @@ public class QueueImpl implements Queue {
    }
 
    @Override
-   public synchronized void pause(boolean persist)  {
+   public synchronized void pause(boolean persist) {
       try {
          this.flushDeliveriesInTransit();
          if (persist && isDurable()) {
@@ -2960,8 +2965,6 @@ public class QueueImpl implements Queue {
          return false;
       }
 
-
-
       @Override
       public MessageReference next() {
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/bd4b7cec/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ServerSessionImpl.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ServerSessionImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ServerSessionImpl.java
index 80fa7b2..aafcced 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ServerSessionImpl.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ServerSessionImpl.java
@@ -509,7 +509,7 @@ public class ServerSessionImpl implements ServerSession, FailureListener {
 
       server.checkQueueCreationLimit(getUsername());
 
-      Queue queue = server.createQueue(address, name, filterString, SimpleString.toSimpleString(getUsername()), durable, temporary, autoCreated, maxConsumers, deleteOnNoConsumers);
+      Queue queue = server.createQueue(address, name, filterString, SimpleString.toSimpleString(getUsername()), durable, temporary, maxConsumers, deleteOnNoConsumers, true);
 
       if (temporary) {
          // Temporary queue in core simply means the queue will be deleted if

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/bd4b7cec/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/management/impl/ManagementServiceImpl.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/management/impl/ManagementServiceImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/management/impl/ManagementServiceImpl.java
index 349d36a..61365c7 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/management/impl/ManagementServiceImpl.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/management/impl/ManagementServiceImpl.java
@@ -739,7 +739,6 @@ public class ManagementServiceImpl implements ManagementService {
       }
 
       Object result = method.invoke(resource, params);
-
       return result;
    }
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/bd4b7cec/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/addressing/AddressingTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/addressing/AddressingTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/addressing/AddressingTest.java
index b6e4de7..827e1b3 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/addressing/AddressingTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/addressing/AddressingTest.java
@@ -229,7 +229,7 @@ public class AddressingTest extends ActiveMQTestBase {
       SimpleString queueName = SimpleString.toSimpleString(UUID.randomUUID().toString());
       // For each address, create 2 Queues with the same address, assert both queues receive message
       boolean deleteOnNoConsumers = true;
-      Queue q1 = server.createQueue(address, queueName, null, true, false, null, deleteOnNoConsumers);
+      Queue q1 = server.createQueue(address, queueName, null, true, false, null, deleteOnNoConsumers, false);
 
       ClientSession session = sessionFactory.createSession();
       session.start();
@@ -246,7 +246,7 @@ public class AddressingTest extends ActiveMQTestBase {
       SimpleString queueName = SimpleString.toSimpleString(UUID.randomUUID().toString());
       // For each address, create 2 Queues with the same address, assert both queues receive message
       boolean deleteOnNoConsumers = false;
-      Queue q1 = server.createQueue(address, queueName, null, true, false, null, deleteOnNoConsumers);
+      Queue q1 = server.createQueue(address, queueName, null, true, false, null, deleteOnNoConsumers, false);
 
       ClientSession session = sessionFactory.createSession();
       session.start();
@@ -263,7 +263,7 @@ public class AddressingTest extends ActiveMQTestBase {
       SimpleString queueName = SimpleString.toSimpleString(UUID.randomUUID().toString());
       // For each address, create 2 Queues with the same address, assert both queues receive message
       boolean deleteOnNoConsumers = false;
-      Queue q1 = server.createQueue(address, queueName, null, true, false, 0, deleteOnNoConsumers);
+      Queue q1 = server.createQueue(address, queueName, null, true, false, 0, deleteOnNoConsumers, false);
 
       Exception expectedException = null;
       String expectedMessage = "Maximum Consumer Limit Reached on Queue";
@@ -290,7 +290,7 @@ public class AddressingTest extends ActiveMQTestBase {
       SimpleString queueName = SimpleString.toSimpleString(UUID.randomUUID().toString());
       // For each address, create 2 Queues with the same address, assert both queues receive message
       boolean deleteOnNoConsumers = false;
-      Queue q1 = server.createQueue(address, queueName, null, true, false, -1, deleteOnNoConsumers);
+      Queue q1 = server.createQueue(address, queueName, null, true, false, -1, deleteOnNoConsumers, false);
 
       ClientSession session = sessionFactory.createSession();
       session.start();
@@ -310,7 +310,7 @@ public class AddressingTest extends ActiveMQTestBase {
       boolean deleteOnNoConsumers = false;
       AddressInfo addressInfo = new AddressInfo(address);
       addressInfo.setDefaultMaxQueueConsumers(0);
-      Queue q1 = server.createQueue(address, queueName, null, true, false, null, deleteOnNoConsumers);
+      Queue q1 = server.createQueue(address, queueName, null, true, false, null, deleteOnNoConsumers, false);
 
       ClientSession session = sessionFactory.createSession();
       session.start();


[22/48] activemq-artemis git commit: Comment on failure in TemporaryQueueClusterTest

Posted by jb...@apache.org.
Comment on failure in TemporaryQueueClusterTest


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

Branch: refs/heads/ARTEMIS-780
Commit: 2f545755595c1080ce0972c5b989793009892233
Parents: e91b04d
Author: jbertram <jb...@apache.com>
Authored: Tue Nov 15 17:10:52 2016 -0600
Committer: jbertram <jb...@apache.com>
Committed: Wed Nov 23 09:04:34 2016 -0600

----------------------------------------------------------------------
 .../tests/integration/jms/cluster/TemporaryQueueClusterTest.java    | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/2f545755/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/cluster/TemporaryQueueClusterTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/cluster/TemporaryQueueClusterTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/cluster/TemporaryQueueClusterTest.java
index b68d803..c26cb85 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/cluster/TemporaryQueueClusterTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/cluster/TemporaryQueueClusterTest.java
@@ -28,6 +28,7 @@ import org.junit.Test;
 
 public class TemporaryQueueClusterTest extends JMSClusteredTestBase {
 
+   // TODO had to prefix this with "jms." to deal with cluster connection address match
    public static final String QUEUE_NAME = "jms.target";
 
    // Constants -----------------------------------------------------


[37/48] activemq-artemis git commit: Fix StompV12Test

Posted by jb...@apache.org.
Fix StompV12Test


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

Branch: refs/heads/ARTEMIS-780
Commit: 47e5a665a2539b4778eec809d8eb42b94a92ad8c
Parents: 9012c9c
Author: jbertram <jb...@apache.com>
Authored: Tue Nov 22 08:19:34 2016 -0600
Committer: jbertram <jb...@apache.com>
Committed: Wed Nov 23 09:04:36 2016 -0600

----------------------------------------------------------------------
 .../artemis/core/protocol/stomp/StompConnection.java     | 11 ++++++++---
 .../tests/integration/stomp/v12/StompV12Test.java        |  3 ++-
 2 files changed, 10 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/47e5a665/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompConnection.java
----------------------------------------------------------------------
diff --git a/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompConnection.java b/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompConnection.java
index 356aae1..52d3f3b 100644
--- a/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompConnection.java
+++ b/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompConnection.java
@@ -250,6 +250,7 @@ public final class StompConnection implements RemotingConnection {
       return res;
    }
 
+   // TODO this should take a type - send or receive so it knows whether to check the address or the queue
    public void checkDestination(String destination) throws ActiveMQStompException {
       if (!manager.destinationExists(destination)) {
          throw BUNDLE.destinationNotExist(destination).setHandler(frameHandler);
@@ -262,11 +263,15 @@ public final class StompConnection implements RemotingConnection {
       try {
          if (manager.getServer().getAddressInfo(SimpleString.toSimpleString(queue)) == null) {
             // TODO check here to see if auto-creation is enabled
-            if (routingType != null && routingType.equals(AddressInfo.RoutingType.MULTICAST)) {
+            if (routingType != null && routingType.equals(AddressInfo.RoutingType.MULTICAST) && manager.getServer().getAddressSettingsRepository().getMatch(queue).isAutoCreateAddresses()) {
                manager.getServer().createOrUpdateAddressInfo(new AddressInfo(SimpleString.toSimpleString(queue)).setAutoCreated(true));
             } else {
-               manager.getServer().createOrUpdateAddressInfo(new AddressInfo(SimpleString.toSimpleString(queue)).setRoutingType(AddressInfo.RoutingType.ANYCAST).setAutoCreated(true));
-               manager.getServer().createQueue(SimpleString.toSimpleString(queue), SimpleString.toSimpleString(queue), null, null, true, false, true);
+               if (manager.getServer().getAddressSettingsRepository().getMatch(queue).isAutoCreateAddresses()) {
+                  manager.getServer().createOrUpdateAddressInfo(new AddressInfo(SimpleString.toSimpleString(queue)).setRoutingType(AddressInfo.RoutingType.ANYCAST).setAutoCreated(true));
+               }
+               if (manager.getServer().getAddressSettingsRepository().getMatch(queue).isAutoCreateQueues()) {
+                  manager.getServer().createQueue(SimpleString.toSimpleString(queue), SimpleString.toSimpleString(queue), null, null, true, false, true);
+               }
             }
             result = true;
          }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/47e5a665/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/v12/StompV12Test.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/v12/StompV12Test.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/v12/StompV12Test.java
index d30ba53..e1281e6 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/v12/StompV12Test.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/v12/StompV12Test.java
@@ -354,7 +354,8 @@ public class StompV12Test extends StompTestBase {
    @Test
    public void testHeaderRepetitive() throws Exception {
       AddressSettings addressSettings = new AddressSettings();
-      addressSettings.setAutoCreateJmsQueues(false);
+      addressSettings.setAutoCreateQueues(false);
+      addressSettings.setAutoCreateAddresses(false);
       server.getActiveMQServer().getAddressSettingsRepository().addMatch("#", addressSettings);
 
       conn.connect(defUser, defPass);


[27/48] activemq-artemis git commit: Fix ArtemisTest failures

Posted by jb...@apache.org.
Fix ArtemisTest failures


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

Branch: refs/heads/ARTEMIS-780
Commit: edc947d4f31c0d099c7cdd46a50e97ad3c544fbd
Parents: cf47a04
Author: jbertram <jb...@apache.com>
Authored: Sat Nov 19 09:57:35 2016 -0600
Committer: jbertram <jb...@apache.com>
Committed: Wed Nov 23 09:04:35 2016 -0600

----------------------------------------------------------------------
 .../activemq/artemis/cli/commands/Create.java   | 37 +++++++++++++++-----
 .../artemis/cli/commands/etc/broker.xml         |  2 +-
 .../apache/activemq/cli/test/ArtemisTest.java   | 18 +++++-----
 .../core/server/impl/ActiveMQServerImpl.java    |  3 +-
 4 files changed, 40 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/edc947d4/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Create.java
----------------------------------------------------------------------
diff --git a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Create.java b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Create.java
index 77a2e68..ae2734c 100644
--- a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Create.java
+++ b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Create.java
@@ -187,11 +187,11 @@ public class Create extends InputAbstract {
    @Option(name = "--no-web", description = "This will remove the web server definition from bootstrap.xml")
    boolean noWeb;
 
-   @Option(name = "--queues", description = "comma separated list of jms queues.")
+   @Option(name = "--queues", description = "comma separated list of queues.")
    String queues;
 
-   @Option(name = "--topics", description = "comma separated list of jms topics ")
-   String topics;
+   @Option(name = "--addresses", description = "comma separated list of addresses ")
+   String addresses;
 
    @Option(name = "--aio", description = "Force aio journal on the configuration regardless of the library being available or not.")
    boolean forceLibaio;
@@ -616,7 +616,7 @@ public class Create extends InputAbstract {
          filters.put("${cluster-password}", "");
       }
 
-      applyJMSObjects(filters);
+      applyAddressesAndQueues(filters);
 
       if (home != null) {
          filters.put("${home}", path(home, false));
@@ -768,12 +768,33 @@ public class Create extends InputAbstract {
       for (String str : getQueueList()) {
          printWriter.println("      <queue name=\"" + str + "\"/>");
       }
-      for (String str : getTopicList()) {
+      for (String str : getAddressList()) {
          printWriter.println("      <topic name=\"" + str + "\"/>");
       }
       filters.put("${jms-list.settings}", writer.toString());
    }
 
+   /**
+    * It will create the address and queue configurations
+    */
+   private void applyAddressesAndQueues(HashMap<String, String> filters) {
+      StringWriter writer = new StringWriter();
+      PrintWriter printWriter = new PrintWriter(writer);
+      printWriter.println();
+
+      for (String str : getQueueList()) {
+         printWriter.println("         <address name=\"" + str + "\" type=\"anycast\">");
+         printWriter.println("            <queues>");
+         printWriter.println("               <queue name=\"" + str + "\" />");
+         printWriter.println("            </queues>");
+         printWriter.println("         </address>");
+      }
+      for (String str : getAddressList()) {
+         printWriter.println("         <address name=\"" + str + "\" type=\"multicast\"/>");
+      }
+      filters.put("${address-queue.settings}", writer.toString());
+   }
+
    private void performAutoTune(HashMap<String, String> filters, boolean aio, File dataFolder) {
       if (noAutoTune) {
          filters.put("${journal-buffer.settings}", "");
@@ -846,11 +867,11 @@ public class Create extends InputAbstract {
       }
    }
 
-   private String[] getTopicList() {
-      if (topics == null) {
+   private String[] getAddressList() {
+      if (addresses == null) {
          return new String[0];
       } else {
-         return topics.split(",");
+         return addresses.split(",");
       }
    }
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/edc947d4/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/broker.xml
----------------------------------------------------------------------
diff --git a/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/broker.xml b/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/broker.xml
index 62a82ec..3b67a09 100644
--- a/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/broker.xml
+++ b/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/broker.xml
@@ -106,7 +106,7 @@ ${cluster-security.settings}${cluster.settings}${replicated.settings}${shared-st
             <queues>
                <queue name="ExpiryQueue" />
             </queues>
-         </address>
+         </address>${address-queue.settings}
       </addresses>
 
    </core>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/edc947d4/artemis-cli/src/test/java/org/apache/activemq/cli/test/ArtemisTest.java
----------------------------------------------------------------------
diff --git a/artemis-cli/src/test/java/org/apache/activemq/cli/test/ArtemisTest.java b/artemis-cli/src/test/java/org/apache/activemq/cli/test/ArtemisTest.java
index dd306e9..90f74ab 100644
--- a/artemis-cli/src/test/java/org/apache/activemq/cli/test/ArtemisTest.java
+++ b/artemis-cli/src/test/java/org/apache/activemq/cli/test/ArtemisTest.java
@@ -531,20 +531,20 @@ public class ArtemisTest {
       File instanceFolder = temporaryFolder.newFolder(folderName);
 
       setupAuth(instanceFolder);
-      String queues = "q1,t2";
-      String topics = "t1,t2";
+      String queues = "q1,q2";
+      String addresses = "a1,a2";
 
 
       // This is usually set when run from the command line via artemis.profile
-      Run.setEmbedded(false);
-      Artemis.main("create", instanceFolder.getAbsolutePath(), "--force", "--silent", "--no-web", "--queues", queues, "--topics", topics, "--no-autotune", "--require-login");
+      Run.setEmbedded(true);
+      Artemis.main("create", instanceFolder.getAbsolutePath(), "--force", "--silent", "--no-web", "--queues", queues, "--addresses", addresses, "--no-autotune", "--require-login");
       System.setProperty("artemis.instance", instanceFolder.getAbsolutePath());
 
       // Some exceptions may happen on the initialization, but they should be ok on start the basic core protocol
       Artemis.internalExecute("run");
 
-      Artemis.main("queue", "create", "--name", "q1", "--address", "q1", "--user", "admin", "--password", "admin");
-      Artemis.main("queue", "create", "--name", "t2", "--address", "t2", "--user", "admin", "--password", "admin");
+//      Artemis.main("queue", "create", "--name", "q1", "--address", "q1", "--user", "admin", "--password", "admin", "--autoCreateAddress");
+//      Artemis.main("queue", "create", "--name", "t2", "--address", "t2", "--user", "admin", "--password", "admin", "--autoCreateAddress");
 
       try {
          try (ServerLocator locator = ServerLocatorImpl.newLocator("tcp://localhost:61616");
@@ -554,9 +554,9 @@ public class ArtemisTest {
                ClientSession.QueueQuery queryResult = coreSession.queueQuery(SimpleString.toSimpleString(str));
                assertTrue("Couldn't find queue " + str, queryResult.isExists());
             }
-            for (String str : topics.split(",")) {
-               ClientSession.QueueQuery queryResult = coreSession.queueQuery(SimpleString.toSimpleString(str));
-               assertTrue("Couldn't find topic " + str, queryResult.isExists());
+            for (String str : addresses.split(",")) {
+               ClientSession.AddressQuery queryResult = coreSession.addressQuery(SimpleString.toSimpleString(str));
+               assertTrue("Couldn't find address " + str, queryResult.isExists());
             }
          }
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/edc947d4/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
index 1c508df..b865361 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
@@ -614,7 +614,6 @@ public class ActiveMQServerImpl implements ActiveMQServer {
       return postOffice.isAddressBound(SimpleString.toSimpleString(address));
    }
 
-   // TODO: this should probably look at the addresses too, not just queue bindings
    @Override
    public BindingQueryResult bindingQuery(SimpleString address) throws Exception {
       if (address == null) {
@@ -642,7 +641,7 @@ public class ActiveMQServerImpl implements ActiveMQServer {
          }
       }
 
-      return new BindingQueryResult(!names.isEmpty(), names, autoCreateJmsQueues, autoCreateJmsTopics);
+      return new BindingQueryResult(getAddressInfo(address) != null, names, autoCreateJmsQueues, autoCreateJmsTopics);
    }
 
    @Override


[42/48] activemq-artemis git commit: Fix checkstyle

Posted by jb...@apache.org.
Fix checkstyle


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

Branch: refs/heads/ARTEMIS-780
Commit: bcb011dde1cebd404b98050baa38f952b440f067
Parents: 31ee218
Author: jbertram <jb...@apache.com>
Authored: Tue Nov 22 09:18:16 2016 -0600
Committer: jbertram <jb...@apache.com>
Committed: Wed Nov 23 09:04:37 2016 -0600

----------------------------------------------------------------------
 .../activemq/artemis/core/protocol/openwire/OpenWireConnection.java | 1 -
 1 file changed, 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/bcb011dd/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireConnection.java
----------------------------------------------------------------------
diff --git a/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireConnection.java b/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireConnection.java
index b4e594f..7959801 100644
--- a/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireConnection.java
+++ b/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireConnection.java
@@ -54,7 +54,6 @@ import org.apache.activemq.artemis.core.protocol.openwire.amq.AMQSession;
 import org.apache.activemq.artemis.core.protocol.openwire.amq.AMQSingleConsumerBrokerExchange;
 import org.apache.activemq.artemis.core.protocol.openwire.util.OpenWireUtil;
 import org.apache.activemq.artemis.core.remoting.FailureListener;
-import org.apache.activemq.artemis.core.security.CheckType;
 import org.apache.activemq.artemis.core.security.SecurityAuth;
 import org.apache.activemq.artemis.core.server.ActiveMQMessageBundle;
 import org.apache.activemq.artemis.core.server.ActiveMQServer;


[44/48] activemq-artemis git commit: Fix SimpleOpenWireTest and a few other things

Posted by jb...@apache.org.
Fix SimpleOpenWireTest and a few other things


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

Branch: refs/heads/ARTEMIS-780
Commit: 31ee2184c5739a9db71e6b6bcb70317a19913725
Parents: 47e5a66
Author: jbertram <jb...@apache.com>
Authored: Tue Nov 22 08:38:23 2016 -0600
Committer: jbertram <jb...@apache.com>
Committed: Wed Nov 23 09:04:37 2016 -0600

----------------------------------------------------------------------
 .../core/protocol/openwire/OpenWireConnection.java     | 13 ++-----------
 .../artemis/core/protocol/openwire/amq/AMQSession.java |  2 +-
 .../management/impl/ActiveMQServerControlImpl.java     |  8 ++++----
 .../artemis/core/server/impl/ActiveMQServerImpl.java   |  5 ++---
 .../tests/integration/openwire/SimpleOpenWireTest.java |  2 +-
 5 files changed, 10 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/31ee2184/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireConnection.java
----------------------------------------------------------------------
diff --git a/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireConnection.java b/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireConnection.java
index cdc62fd..b4e594f 100644
--- a/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireConnection.java
+++ b/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireConnection.java
@@ -712,17 +712,8 @@ public class OpenWireConnection extends AbstractRemotingConnection implements Se
       if (dest.isQueue()) {
          SimpleString qName = new SimpleString(dest.getPhysicalName());
          QueueBinding binding = (QueueBinding) server.getPostOffice().getBinding(qName);
-         if (binding == null) {
-            if (dest.isTemporary()) {
-               internalSession.createQueue(qName, qName, null, dest.isTemporary(), false);
-            } else {
-               ConnectionInfo connInfo = getState().getInfo();
-               CheckType checkType = dest.isTemporary() ? CheckType.CREATE_NON_DURABLE_QUEUE : CheckType.CREATE_DURABLE_QUEUE;
-               server.getSecurityStore().check(qName, checkType, this);
-               server.checkQueueCreationLimit(getUsername());
-               server.createQueue(qName, qName, null, connInfo == null ? null : SimpleString.toSimpleString(connInfo.getUserName()), true, false);
-
-            }
+         if (binding == null && server.getAddressSettingsRepository().getMatch(qName.toString()).isAutoCreateQueues()) {
+            internalSession.createQueue(qName, qName, null, dest.isTemporary(), true, null, null, true);
          }
       }
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/31ee2184/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/amq/AMQSession.java
----------------------------------------------------------------------
diff --git a/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/amq/AMQSession.java b/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/amq/AMQSession.java
index 35fd733..b2a2068 100644
--- a/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/amq/AMQSession.java
+++ b/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/amq/AMQSession.java
@@ -168,7 +168,7 @@ public class AMQSession implements SessionCallback {
          BindingQueryResult bindingQuery = server.bindingQuery(queueName);
          QueueQueryResult queueBinding = server.queueQuery(queueName);
 
-         boolean isAutoCreate = bindingQuery.isExists() ? bindingQuery.isAutoCreateJmsQueues() : true;
+         boolean isAutoCreate = bindingQuery.isExists() ?  true : bindingQuery.isAutoCreateJmsQueues();
 
          if (!queueBinding.isExists()) {
             if (isAutoCreate) {

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/31ee2184/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/ActiveMQServerControlImpl.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/ActiveMQServerControlImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/ActiveMQServerControlImpl.java
index f8880fc..f524062 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/ActiveMQServerControlImpl.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/ActiveMQServerControlImpl.java
@@ -1831,10 +1831,10 @@ public class ActiveMQServerControlImpl extends AbstractControl implements Active
       addressSettings.setAutoDeleteJmsQueues(autoDeleteJmsQueues);
       addressSettings.setAutoCreateJmsTopics(autoCreateJmsTopics);
       addressSettings.setAutoDeleteJmsTopics(autoDeleteJmsTopics);
-      addressSettings.setAutoCreateQueues(autoCreateJmsQueues);
-      addressSettings.setAutoDeleteQueues(autoDeleteJmsQueues);
-      addressSettings.setAutoCreateAddresses(autoCreateJmsTopics);
-      addressSettings.setAutoDeleteAddresses(autoDeleteJmsTopics);
+      addressSettings.setAutoCreateQueues(autoCreateQueues);
+      addressSettings.setAutoDeleteQueues(autoDeleteQueues);
+      addressSettings.setAutoCreateAddresses(autoCreateAddresses);
+      addressSettings.setAutoDeleteAddresses(autoDeleteAddresses);
       server.getAddressSettingsRepository().addMatch(address, addressSettings);
 
       storageManager.storeAddressSetting(new PersistedAddressSetting(new SimpleString(address), addressSettings));

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/31ee2184/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
index 990e2e0..a21e5be 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
@@ -620,8 +620,8 @@ public class ActiveMQServerImpl implements ActiveMQServer {
          throw ActiveMQMessageBundle.BUNDLE.addressIsNull();
       }
 
-      boolean autoCreateJmsQueues = getAddressSettingsRepository().getMatch(address.toString()).isAutoCreateJmsQueues();
-      boolean autoCreateJmsTopics = getAddressSettingsRepository().getMatch(address.toString()).isAutoCreateJmsTopics();
+      boolean autoCreateJmsQueues = getAddressSettingsRepository().getMatch(address.toString()).isAutoCreateQueues();
+      boolean autoCreateJmsTopics = getAddressSettingsRepository().getMatch(address.toString()).isAutoCreateAddresses();
 
       List<SimpleString> names = new ArrayList<>();
 
@@ -2347,7 +2347,6 @@ public class ActiveMQServerImpl implements ActiveMQServer {
 
       final long txID = storageManager.generateID();
       final long queueID = storageManager.generateID();
-      final long addressID = storageManager.generateID();
 
       final QueueConfig.Builder queueConfigBuilder;
       if (addressName == null) {

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/31ee2184/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/SimpleOpenWireTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/SimpleOpenWireTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/SimpleOpenWireTest.java
index c79f055..3842b67 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/SimpleOpenWireTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/SimpleOpenWireTest.java
@@ -502,7 +502,7 @@ public class SimpleOpenWireTest extends BasicOpenWireTest {
    @Test
    public void testAutoDestinationNoCreationOnConsumer() throws JMSException {
       AddressSettings addressSetting = new AddressSettings();
-      addressSetting.setAutoCreateJmsQueues(false);
+      addressSetting.setAutoCreateQueues(false);
 
       String address = "foo";
       server.getAddressSettingsRepository().addMatch(address, addressSetting);


[41/48] activemq-artemis git commit: Fix InterceptorTest

Posted by jb...@apache.org.
Fix InterceptorTest


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

Branch: refs/heads/ARTEMIS-780
Commit: 9012c9c089b35038f980bde692116515f674a73f
Parents: ef88482
Author: jbertram <jb...@apache.com>
Authored: Mon Nov 21 22:02:44 2016 -0600
Committer: jbertram <jb...@apache.com>
Committed: Wed Nov 23 09:04:36 2016 -0600

----------------------------------------------------------------------
 .../tests/integration/interceptors/InterceptorTest.java      | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/9012c9c0/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/interceptors/InterceptorTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/interceptors/InterceptorTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/interceptors/InterceptorTest.java
index 362c8a1..f6ad723 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/interceptors/InterceptorTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/interceptors/InterceptorTest.java
@@ -64,8 +64,6 @@ public class InterceptorTest extends ActiveMQTestBase {
 
    private final SimpleString QUEUE = new SimpleString("InterceptorTestQueue");
 
-   private final SimpleString JMS_QUEUE = SimpleString.toSimpleString(QUEUE.toString());
-
    private ServerLocator locator;
 
    @Override
@@ -103,12 +101,12 @@ public class InterceptorTest extends ActiveMQTestBase {
 
       @Override
       public boolean intercept(final Packet packet, final RemotingConnection connection) throws ActiveMQException {
-         if (packet.getType() == PacketImpl.CREATE_QUEUE) {
+         if (packet.getType() == PacketImpl.CREATE_QUEUE || packet.getType() == PacketImpl.CREATE_QUEUE_V2) {
             String userName = getUsername(packet, connection);
             CreateQueueMessage createQueue = (CreateQueueMessage) packet;
             createQueue.setFilterString(new SimpleString("userName='" + userName + "'"));
 
-            System.out.println("userName = " + userName);
+            System.out.println("userName on createQueue = " + userName);
          } else if (packet.getType() == PacketImpl.SESS_SEND) {
             String userName = getUsername(packet, connection);
             MessagePacket msgPacket = (MessagePacket) packet;
@@ -1054,7 +1052,7 @@ public class InterceptorTest extends ActiveMQTestBase {
    public void testInterceptorOnURI() throws Exception {
       locator.close();
 
-      server.createQueue(JMS_QUEUE, JMS_QUEUE, null, true, false);
+      server.createQueue(QUEUE, QUEUE, null, true, false);
 
       String uri = "tcp://localhost:61616?incomingInterceptorList=" + Incoming.class.getCanonicalName() + "&outgoingInterceptorList=" + Outgoing.class.getName();
 


[03/48] activemq-artemis git commit: Fix MessageProducerTest

Posted by jb...@apache.org.
Fix MessageProducerTest


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

Branch: refs/heads/ARTEMIS-780
Commit: c5a95f9d54a1479df70af88ec22eb0d5abbc92b6
Parents: 20a4616
Author: jbertram <jb...@apache.com>
Authored: Mon Nov 14 14:07:13 2016 -0600
Committer: jbertram <jb...@apache.com>
Committed: Tue Nov 15 10:36:42 2016 -0600

----------------------------------------------------------------------
 .../org/apache/activemq/artemis/jms/tests/MessageProducerTest.java  | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/c5a95f9d/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/MessageProducerTest.java
----------------------------------------------------------------------
diff --git a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/MessageProducerTest.java b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/MessageProducerTest.java
index da171cb..fc97cd4 100644
--- a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/MessageProducerTest.java
+++ b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/MessageProducerTest.java
@@ -340,6 +340,7 @@ public class MessageProducerTest extends JMSTestCase {
    @Test
    public void testCreateProducerOnInexistentDestination() throws Exception {
       getJmsServer().getAddressSettingsRepository().addMatch("#", new AddressSettings().setAutoCreateJmsQueues(false));
+      getJmsServer().getAddressSettingsRepository().addMatch("#", new AddressSettings().setAutoCreateJmsTopics(false));
       Connection pconn = createConnection();
       try {
          Session ps = pconn.createSession(false, Session.AUTO_ACKNOWLEDGE);


[10/48] activemq-artemis git commit: Fix XmlImportExportTest

Posted by jb...@apache.org.
Fix XmlImportExportTest


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

Branch: refs/heads/ARTEMIS-780
Commit: 30208378329e7ed1859b2f32835e909aa7075848
Parents: 98309cc
Author: jbertram <jb...@apache.com>
Authored: Mon Nov 14 20:25:27 2016 -0600
Committer: jbertram <jb...@apache.com>
Committed: Tue Nov 15 10:38:13 2016 -0600

----------------------------------------------------------------------
 .../persistence/XmlImportExportTest.java        | 161 -------------------
 1 file changed, 161 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/30208378/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/persistence/XmlImportExportTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/persistence/XmlImportExportTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/persistence/XmlImportExportTest.java
index 29f280b..7863021 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/persistence/XmlImportExportTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/persistence/XmlImportExportTest.java
@@ -19,7 +19,6 @@ package org.apache.activemq.artemis.tests.integration.persistence;
 import javax.jms.Connection;
 import javax.jms.ConnectionFactory;
 import javax.jms.DeliveryMode;
-import javax.jms.Destination;
 import javax.jms.MessageConsumer;
 import javax.jms.MessageProducer;
 import javax.jms.Session;
@@ -28,7 +27,6 @@ import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
 import java.util.Arrays;
 import java.util.Collection;
-import java.util.List;
 import java.util.UUID;
 
 import org.apache.activemq.artemis.api.core.Message;
@@ -42,7 +40,6 @@ import org.apache.activemq.artemis.api.core.client.ClientSession;
 import org.apache.activemq.artemis.api.core.client.ClientSessionFactory;
 import org.apache.activemq.artemis.api.core.client.ServerLocator;
 import org.apache.activemq.artemis.api.jms.ActiveMQJMSClient;
-import org.apache.activemq.artemis.api.jms.JMSFactoryType;
 import org.apache.activemq.artemis.cli.commands.tools.XmlDataExporter;
 import org.apache.activemq.artemis.cli.commands.tools.XmlDataImporter;
 import org.apache.activemq.artemis.core.persistence.impl.journal.BatchingIDGenerator;
@@ -51,7 +48,6 @@ import org.apache.activemq.artemis.core.persistence.impl.journal.LargeServerMess
 import org.apache.activemq.artemis.core.registry.JndiBindingRegistry;
 import org.apache.activemq.artemis.core.server.ActiveMQServer;
 import org.apache.activemq.artemis.core.settings.impl.AddressSettings;
-import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
 import org.apache.activemq.artemis.jms.server.JMSServerManager;
 import org.apache.activemq.artemis.jms.server.impl.JMSServerManagerImpl;
 import org.apache.activemq.artemis.tests.unit.util.InVMContext;
@@ -436,163 +432,6 @@ public class XmlImportExportTest extends ActiveMQTestBase {
    }
 
    @Test
-   public void testJmsConnectionFactoryBinding() throws Exception {
-      final String clientId = "myClientId";
-      final long clientFailureCheckPeriod = 1;
-      final long connectionTTl = 2;
-      final long callTimeout = 3;
-      final long callFailoverTimeout = 4;
-      final boolean cacheLargeMessagesClient = true;
-      final int minLargeMessageSize = 5;
-      final boolean compressLargeMessages = true;
-      final int consumerWindowSize = 6;
-      final int consumerMaxRate = 7;
-      final int confirmationWindowSize = 8;
-      final int producerWindowSize = 9;
-      final int producerMaxrate = 10;
-      final boolean blockOnAcknowledge = true;
-      final boolean blockOnDurableSend = false;
-      final boolean blockOnNonDurableSend = true;
-      final boolean autoGroup = true;
-      final boolean preacknowledge = true;
-      final String loadBalancingPolicyClassName = "myPolicy";
-      final int transactionBatchSize = 11;
-      final int dupsOKBatchSize = 12;
-      final boolean useGlobalPools = true;
-      final int scheduledThreadPoolMaxSize = 13;
-      final int threadPoolMaxSize = 14;
-      final long retryInterval = 15;
-      final double retryIntervalMultiplier = 10.0;
-      final long maxRetryInterval = 16;
-      final int reconnectAttempts = 17;
-      final boolean failoverOnInitialConnection = true;
-      final String groupId = "myGroupId";
-      final String name = "myFirstConnectionFactoryName";
-      final String jndi_binding1 = name + "Binding1";
-      final String jndi_binding2 = name + "Binding2";
-      final JMSFactoryType type = JMSFactoryType.CF;
-      final boolean ha = true;
-      final List<String> connectors = Arrays.asList("in-vm1", "in-vm2");
-
-      ClientSession session = basicSetUp();
-
-      jmsServer.createConnectionFactory(name, ha, type, connectors, clientId, clientFailureCheckPeriod, connectionTTl, callTimeout, callFailoverTimeout, cacheLargeMessagesClient, minLargeMessageSize, compressLargeMessages, consumerWindowSize, consumerMaxRate, confirmationWindowSize, producerWindowSize, producerMaxrate, blockOnAcknowledge, blockOnDurableSend, blockOnNonDurableSend, autoGroup, preacknowledge, loadBalancingPolicyClassName, transactionBatchSize, dupsOKBatchSize, useGlobalPools, scheduledThreadPoolMaxSize, threadPoolMaxSize, retryInterval, retryIntervalMultiplier, maxRetryInterval, reconnectAttempts, failoverOnInitialConnection, groupId, jndi_binding1, jndi_binding2);
-
-      jmsServer.createConnectionFactory("mySecondConnectionFactoryName", false, JMSFactoryType.CF, Arrays.asList("in-vm1", "in-vm2"), "mySecondConnectionFactoryName1", "mySecondConnectionFactoryName2");
-
-      session.close();
-      locator.close();
-      server.stop();
-
-      ByteArrayOutputStream xmlOutputStream = new ByteArrayOutputStream();
-      XmlDataExporter xmlDataExporter = new XmlDataExporter();
-      xmlDataExporter.process(xmlOutputStream, server.getConfiguration().getBindingsLocation().getAbsolutePath(), server.getConfiguration().getJournalLocation().getAbsolutePath(), server.getConfiguration().getPagingLocation().getAbsolutePath(), server.getConfiguration().getLargeMessagesLocation().getAbsolutePath());
-      System.out.print(new String(xmlOutputStream.toByteArray()));
-
-      clearDataRecreateServerDirs();
-      server.start();
-      checkForLongs();
-      locator = createInVMNonHALocator();
-      factory = createSessionFactory(locator);
-      session = factory.createSession(false, true, true);
-
-      ByteArrayInputStream xmlInputStream = new ByteArrayInputStream(xmlOutputStream.toByteArray());
-      XmlDataImporter xmlDataImporter = new XmlDataImporter();
-      xmlDataImporter.process(xmlInputStream, session);
-
-      ConnectionFactory cf1 = (ConnectionFactory) namingContext.lookup(jndi_binding1);
-      assertNotNull(cf1);
-      ActiveMQConnectionFactory hcf1 = (ActiveMQConnectionFactory) cf1;
-      assertEquals(ha, hcf1.isHA());
-      assertEquals(type.intValue(), hcf1.getFactoryType());
-      assertEquals(clientId, hcf1.getClientID());
-      assertEquals(clientFailureCheckPeriod, hcf1.getClientFailureCheckPeriod());
-      assertEquals(connectionTTl, hcf1.getConnectionTTL());
-      assertEquals(callTimeout, hcf1.getCallTimeout());
-      //      Assert.assertEquals(callFailoverTimeout, hcf1.getCallFailoverTimeout());  // this value isn't currently persisted by org.apache.activemq.artemis.jms.server.config.impl.ConnectionFactoryConfigurationImpl.encode()
-      //      Assert.assertEquals(cacheLargeMessagesClient, hcf1.isCacheLargeMessagesClient()); // this value isn't currently supported by org.apache.activemq.artemis.api.jms.management.JMSServerControl.createConnectionFactory(java.lang.String, boolean, boolean, int, java.lang.String, java.lang.String, java.lang.String, long, long, long, long, int, boolean, int, int, int, int, int, boolean, boolean, boolean, boolean, boolean, java.lang.String, int, int, boolean, int, int, long, double, long, int, boolean, java.lang.String)
-      assertEquals(minLargeMessageSize, hcf1.getMinLargeMessageSize());
-      //      Assert.assertEquals(compressLargeMessages, hcf1.isCompressLargeMessage());  // this value isn't currently handled properly by org.apache.activemq.artemis.jms.server.impl.JMSServerManagerImpl.createConnectionFactory(java.lang.String, boolean, org.apache.activemq.artemis.api.jms.JMSFactoryType, java.util.List<java.lang.String>, java.lang.String, long, long, long, long, boolean, int, boolean, int, int, int, int, int, boolean, boolean, boolean, boolean, boolean, java.lang.String, int, int, boolean, int, int, long, double, long, int, boolean, java.lang.String, java.lang.String...)()
-      assertEquals(consumerWindowSize, hcf1.getConsumerWindowSize());
-      assertEquals(consumerMaxRate, hcf1.getConsumerMaxRate());
-      assertEquals(confirmationWindowSize, hcf1.getConfirmationWindowSize());
-      assertEquals(producerWindowSize, hcf1.getProducerWindowSize());
-      assertEquals(producerMaxrate, hcf1.getProducerMaxRate());
-      assertEquals(blockOnAcknowledge, hcf1.isBlockOnAcknowledge());
-      assertEquals(blockOnDurableSend, hcf1.isBlockOnDurableSend());
-      assertEquals(blockOnNonDurableSend, hcf1.isBlockOnNonDurableSend());
-      assertEquals(autoGroup, hcf1.isAutoGroup());
-      assertEquals(preacknowledge, hcf1.isPreAcknowledge());
-      assertEquals(loadBalancingPolicyClassName, hcf1.getConnectionLoadBalancingPolicyClassName());
-      assertEquals(transactionBatchSize, hcf1.getTransactionBatchSize());
-      assertEquals(dupsOKBatchSize, hcf1.getDupsOKBatchSize());
-      assertEquals(useGlobalPools, hcf1.isUseGlobalPools());
-      assertEquals(scheduledThreadPoolMaxSize, hcf1.getScheduledThreadPoolMaxSize());
-      assertEquals(threadPoolMaxSize, hcf1.getThreadPoolMaxSize());
-      assertEquals(retryInterval, hcf1.getRetryInterval());
-      assertEquals(retryIntervalMultiplier, hcf1.getRetryIntervalMultiplier(), 0);
-      assertEquals(maxRetryInterval, hcf1.getMaxRetryInterval());
-      assertEquals(reconnectAttempts, hcf1.getReconnectAttempts());
-      assertEquals(failoverOnInitialConnection, hcf1.isFailoverOnInitialConnection());
-      assertEquals(groupId, hcf1.getGroupID());
-
-      assertNotNull(namingContext.lookup(jndi_binding2));
-      assertNotNull(namingContext.lookup("mySecondConnectionFactoryName1"));
-      assertNotNull(namingContext.lookup("mySecondConnectionFactoryName2"));
-   }
-
-   @Test
-   public void testJmsDestination() throws Exception {
-      ClientSession session = basicSetUp();
-
-      jmsServer.createQueue(true, "myQueue", null, true, "myQueueJndiBinding1", "myQueueJndiBinding2");
-      jmsServer.createTopic(true, "myTopic", "myTopicJndiBinding1", "myTopicJndiBinding2");
-
-      session.close();
-      locator.close();
-      server.stop();
-
-      ByteArrayOutputStream xmlOutputStream = new ByteArrayOutputStream();
-      XmlDataExporter xmlDataExporter = new XmlDataExporter();
-      xmlDataExporter.process(xmlOutputStream, server.getConfiguration().getBindingsDirectory(), server.getConfiguration().getJournalDirectory(), server.getConfiguration().getPagingDirectory(), server.getConfiguration().getLargeMessagesDirectory());
-      System.out.print(new String(xmlOutputStream.toByteArray()));
-
-      clearDataRecreateServerDirs();
-      server.start();
-      checkForLongs();
-      locator = createInVMNonHALocator();
-      factory = createSessionFactory(locator);
-      session = factory.createSession(false, true, true);
-
-      ByteArrayInputStream xmlInputStream = new ByteArrayInputStream(xmlOutputStream.toByteArray());
-      XmlDataImporter xmlDataImporter = new XmlDataImporter();
-      xmlDataImporter.process(xmlInputStream, session);
-
-      assertNotNull(namingContext.lookup("myQueueJndiBinding1"));
-      assertNotNull(namingContext.lookup("myQueueJndiBinding2"));
-      assertNotNull(namingContext.lookup("myTopicJndiBinding1"));
-      assertNotNull(namingContext.lookup("myTopicJndiBinding2"));
-
-      jmsServer.createConnectionFactory("test-cf", false, JMSFactoryType.CF, Arrays.asList("in-vm1"), "test-cf");
-
-      ConnectionFactory cf = (ConnectionFactory) namingContext.lookup("test-cf");
-      Connection connection = cf.createConnection();
-      Session jmsSession = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-      MessageProducer producer = jmsSession.createProducer((Destination) namingContext.lookup("myQueueJndiBinding1"));
-      producer.send(jmsSession.createTextMessage());
-      MessageConsumer consumer = jmsSession.createConsumer((Destination) namingContext.lookup("myQueueJndiBinding2"));
-      connection.start();
-      assertNotNull(consumer.receive(3000));
-
-      consumer = jmsSession.createConsumer((Destination) namingContext.lookup("myTopicJndiBinding1"));
-      producer = jmsSession.createProducer((Destination) namingContext.lookup("myTopicJndiBinding2"));
-      producer.send(jmsSession.createTextMessage());
-      assertNotNull(consumer.receive(3000));
-
-      connection.close();
-   }
-
-   @Test
    public void testLargeMessage() throws Exception {
       server = createServer(true);
       server.start();


[23/48] activemq-artemis git commit: Fix HangConsumerTest

Posted by jb...@apache.org.
Fix HangConsumerTest


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

Branch: refs/heads/ARTEMIS-780
Commit: e91b04d58afb748811957f61c15d2e5201fcd0ed
Parents: fccea4a
Author: jbertram <jb...@apache.com>
Authored: Tue Nov 15 17:10:17 2016 -0600
Committer: jbertram <jb...@apache.com>
Committed: Wed Nov 23 09:04:34 2016 -0600

----------------------------------------------------------------------
 .../org/apache/activemq/artemis/core/server/impl/QueueImpl.java    | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/e91b04d5/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueImpl.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueImpl.java
index f6da245..a2be58b 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueImpl.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueImpl.java
@@ -367,7 +367,7 @@ public class QueueImpl implements Queue {
 
       this.address = address;
 
-      this.addressInfo = postOffice.getAddressInfo(address);
+      this.addressInfo = postOffice == null ? null : postOffice.getAddressInfo(address);
 
       this.name = name;
 


[05/48] activemq-artemis git commit: Fix PlainTest

Posted by jb...@apache.org.
Fix PlainTest


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

Branch: refs/heads/ARTEMIS-780
Commit: 74a3738effa3ed2b778579a53e64294f9b6455ee
Parents: f51f435
Author: jbertram <jb...@apache.com>
Authored: Mon Nov 14 12:11:56 2016 -0600
Committer: jbertram <jb...@apache.com>
Committed: Tue Nov 15 10:36:42 2016 -0600

----------------------------------------------------------------------
 .../artemis/jms/client/ActiveMQSession.java     | 24 ++++----------------
 1 file changed, 5 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/74a3738e/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQSession.java
----------------------------------------------------------------------
diff --git a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQSession.java b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQSession.java
index acbb5e9..c115614 100644
--- a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQSession.java
+++ b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQSession.java
@@ -299,28 +299,14 @@ public class ActiveMQSession implements QueueSession, TopicSession {
          if (jbd != null) {
             ClientSession.AddressQuery response = session.addressQuery(jbd.getSimpleAddress());
 
-            if (!response.isExists() && response.isAutoCreateJmsQueues()) {
-               if (jbd.isQueue()) {
+            if (!response.isExists()) {
+               if (jbd.isQueue() && response.isAutoCreateJmsQueues()) {
                   session.createAddress(jbd.getSimpleAddress(), false, true);
                   session.createQueue(jbd.getSimpleAddress(), jbd.getSimpleAddress(), null, true);
-               } else {
+               } else if (!jbd.isQueue() && response.isAutoCreateJmsTopics()) {
                   session.createAddress(jbd.getSimpleAddress(), true, true);
-               }
-
-               if (response.getQueueNames().isEmpty()) {
-                  if (response.isAutoCreateJmsQueues()) {
-                     session.createQueue(jbd.getSimpleAddress(), jbd.getSimpleAddress(), null, true);
-                  } else {
-                     throw new InvalidDestinationException("Destination " + jbd.getName() + " does not exist");
-                  }
-               }
-            } else {
-               if (!response.isExists()) {
-                  if (response.isAutoCreateJmsTopics()) {
-                     session.createAddress(jbd.getSimpleAddress(), true, true);
-                  } else {
-                     throw new InvalidDestinationException("Destination " + jbd.getName() + " does not exist");
-                  }
+               } else {
+                  throw new InvalidDestinationException("Destination " + jbd.getName() + " does not exist");
                }
             }
          }


[47/48] activemq-artemis git commit: Fix BasicSecurityTest

Posted by jb...@apache.org.
Fix BasicSecurityTest


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

Branch: refs/heads/ARTEMIS-780
Commit: 2198869312de4a6a67c1ef381a2786f5b740d3b5
Parents: fb67939
Author: jbertram <jb...@apache.com>
Authored: Tue Nov 22 16:47:20 2016 -0600
Committer: jbertram <jb...@apache.com>
Committed: Wed Nov 23 09:04:37 2016 -0600

----------------------------------------------------------------------
 .../core/protocol/openwire/OpenWireConnection.java     | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/21988693/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireConnection.java
----------------------------------------------------------------------
diff --git a/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireConnection.java b/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireConnection.java
index 7959801..fbd6464 100644
--- a/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireConnection.java
+++ b/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireConnection.java
@@ -54,6 +54,7 @@ import org.apache.activemq.artemis.core.protocol.openwire.amq.AMQSession;
 import org.apache.activemq.artemis.core.protocol.openwire.amq.AMQSingleConsumerBrokerExchange;
 import org.apache.activemq.artemis.core.protocol.openwire.util.OpenWireUtil;
 import org.apache.activemq.artemis.core.remoting.FailureListener;
+import org.apache.activemq.artemis.core.security.CheckType;
 import org.apache.activemq.artemis.core.security.SecurityAuth;
 import org.apache.activemq.artemis.core.server.ActiveMQMessageBundle;
 import org.apache.activemq.artemis.core.server.ActiveMQServer;
@@ -711,8 +712,16 @@ public class OpenWireConnection extends AbstractRemotingConnection implements Se
       if (dest.isQueue()) {
          SimpleString qName = new SimpleString(dest.getPhysicalName());
          QueueBinding binding = (QueueBinding) server.getPostOffice().getBinding(qName);
-         if (binding == null && server.getAddressSettingsRepository().getMatch(qName.toString()).isAutoCreateQueues()) {
-            internalSession.createQueue(qName, qName, null, dest.isTemporary(), true, null, null, true);
+         if (binding == null) {
+            if (dest.isTemporary()) {
+               internalSession.createQueue(qName, qName, null, dest.isTemporary(), false);
+            } else {
+               ConnectionInfo connInfo = getState().getInfo();
+               CheckType checkType = dest.isTemporary() ? CheckType.CREATE_NON_DURABLE_QUEUE : CheckType.CREATE_DURABLE_QUEUE;
+               server.getSecurityStore().check(qName, checkType, this);
+               server.checkQueueCreationLimit(getUsername());
+               server.createQueue(qName, qName, null, connInfo == null ? null : SimpleString.toSimpleString(connInfo.getUserName()), true, false);
+            }
          }
       }
 


[29/48] activemq-artemis git commit: Don't throw so many exceptions

Posted by jb...@apache.org.
Don't throw so many 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/2b2b7c33
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/2b2b7c33
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/2b2b7c33

Branch: refs/heads/ARTEMIS-780
Commit: 2b2b7c33ff27f52c89803ce52f5b2193bb7824fb
Parents: dd1a9cc
Author: jbertram <jb...@apache.com>
Authored: Wed Nov 16 16:24:10 2016 -0600
Committer: jbertram <jb...@apache.com>
Committed: Wed Nov 23 09:04:35 2016 -0600

----------------------------------------------------------------------
 .../artemis/core/management/impl/ActiveMQServerControlImpl.java   | 3 ++-
 .../activemq/artemis/core/postoffice/impl/PostOfficeImpl.java     | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/2b2b7c33/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/ActiveMQServerControlImpl.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/ActiveMQServerControlImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/ActiveMQServerControlImpl.java
index b70abdc..25b9fdb 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/ActiveMQServerControlImpl.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/ActiveMQServerControlImpl.java
@@ -789,7 +789,8 @@ public class ActiveMQServerControlImpl extends AbstractControl implements Active
    public String getAddressInfo(String address) throws ActiveMQAddressDoesNotExistException {
       AddressInfo addressInfo = server.getAddressInfo(SimpleString.toSimpleString(address));
       if (addressInfo == null) {
-         throw ActiveMQMessageBundle.BUNDLE.addressDoesNotExist(SimpleString.toSimpleString(address));
+//         throw ActiveMQMessageBundle.BUNDLE.addressDoesNotExist(SimpleString.toSimpleString(address));
+         return null;
       } else {
          return addressInfo.toString();
       }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/2b2b7c33/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 fbb6385..1c0c343 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
@@ -450,7 +450,8 @@ public class PostOfficeImpl implements PostOffice, NotificationListener, Binding
       synchronized (addressLock) {
          Bindings bindingsForAddress = getBindingsForAddress(address);
          if (bindingsForAddress.getBindings().size() > 0) {
-            throw new IllegalStateException("Address has bindings");
+            return null;
+//            throw new IllegalStateException("Address has bindings");
          }
          managementService.unregisterAddress(address);
          return addressManager.removeAddressInfo(address);


[26/48] activemq-artemis git commit: Update ClientSession API for autoCreated queues

Posted by jb...@apache.org.
Update ClientSession API for autoCreated queues


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

Branch: refs/heads/ARTEMIS-780
Commit: ffeaf48f39def21a983756c47ed0a2490d91e8bd
Parents: 2b2b7c3
Author: jbertram <jb...@apache.com>
Authored: Thu Nov 17 07:25:04 2016 -0600
Committer: jbertram <jb...@apache.com>
Committed: Wed Nov 23 09:04:35 2016 -0600

----------------------------------------------------------------------
 .../artemis/api/core/client/ClientSession.java  | 28 ++++++
 .../core/client/impl/ClientSessionImpl.java     | 37 ++++++--
 .../core/impl/ActiveMQSessionContext.java       |  6 +-
 .../core/protocol/core/impl/PacketDecoder.java  |  6 ++
 .../core/protocol/core/impl/PacketImpl.java     |  2 +
 .../impl/wireformat/CreateQueueMessage.java     | 26 +++--
 .../impl/wireformat/CreateQueueMessage_V2.java  | 99 ++++++++++++++++++++
 .../spi/core/remoting/SessionContext.java       |  3 +-
 .../jms/client/ActiveMQMessageProducer.java     |  2 +-
 .../artemis/jms/client/ActiveMQSession.java     |  8 +-
 .../jms/server/impl/JMSServerManagerImpl.java   |  4 +-
 .../impl/ActiveMQServerControlImpl.java         |  2 +-
 .../core/ServerSessionPacketHandler.java        | 11 +++
 .../impl/AutoCreatedQueueManagerImpl.java       |  4 +-
 .../core/server/impl/ServerSessionImpl.java     |  2 +-
 .../core/settings/impl/AddressSettings.java     |  2 +-
 .../core/config/impl/FileConfigurationTest.java |  4 +-
 .../core/settings/AddressSettingsTest.java      |  2 +-
 .../jms/tests/message/MessageHeaderTest.java    | 30 +++---
 19 files changed, 231 insertions(+), 47 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ffeaf48f/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/client/ClientSession.java
----------------------------------------------------------------------
diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/client/ClientSession.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/client/ClientSession.java
index 35bc9f9..72b1a11 100644
--- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/client/ClientSession.java
+++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/client/ClientSession.java
@@ -294,6 +294,34 @@ public interface ClientSession extends XAResource, AutoCloseable {
    void createQueue(String address, String queueName, String filter, boolean durable) throws ActiveMQException;
 
    /**
+    * Creates a <em>non-temporary</em> queue.
+    *
+    * @param address     the queue will be bound to this address
+    * @param queueName   the name of the queue
+    * @param filter      only messages which match this filter will be put in the queue
+    * @param durable     whether the queue is durable or not
+    * @param autoCreated whether to mark this queue as autoCreated or not
+    * @throws ActiveMQException in an exception occurs while creating the queue
+    */
+   void createQueue(SimpleString address,
+                    SimpleString queueName,
+                    SimpleString filter,
+                    boolean durable,
+                    boolean autoCreated) throws ActiveMQException;
+
+   /**
+    * Creates a <em>non-temporary</em>queue.
+    *
+    * @param address     the queue will be bound to this address
+    * @param queueName   the name of the queue
+    * @param filter      only messages which match this filter will be put in the queue
+    * @param durable     whether the queue is durable or not
+    * @param autoCreated whether to mark this queue as autoCreated or not
+    * @throws ActiveMQException in an exception occurs while creating the queue
+    */
+   void createQueue(String address, String queueName, String filter, boolean durable, boolean autoCreated) throws ActiveMQException;
+
+   /**
     * Creates a <em>temporary</em> queue.
     *
     * @param address   the queue will be bound to this address

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ffeaf48f/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientSessionImpl.java
----------------------------------------------------------------------
diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientSessionImpl.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientSessionImpl.java
index 16311b0..145ca99 100644
--- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientSessionImpl.java
+++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientSessionImpl.java
@@ -237,14 +237,14 @@ public final class ClientSessionImpl implements ClientSessionInternal, FailureLi
 
    @Override
    public void createQueue(final SimpleString address, final SimpleString queueName) throws ActiveMQException {
-      internalCreateQueue(address, queueName, null, false, false);
+      internalCreateQueue(address, queueName, null, false, false, false);
    }
 
    @Override
    public void createQueue(final SimpleString address,
                            final SimpleString queueName,
                            final boolean durable) throws ActiveMQException {
-      internalCreateQueue(address, queueName, null, durable, false);
+      internalCreateQueue(address, queueName, null, durable, false, false);
    }
 
    @Override
@@ -295,7 +295,7 @@ public final class ClientSessionImpl implements ClientSessionInternal, FailureLi
                            final SimpleString queueName,
                            final SimpleString filterString,
                            final boolean durable) throws ActiveMQException {
-      internalCreateQueue(address, queueName, filterString, durable, false);
+      internalCreateQueue(address, queueName, filterString, durable, false, false);
    }
 
    @Override
@@ -307,27 +307,45 @@ public final class ClientSessionImpl implements ClientSessionInternal, FailureLi
    }
 
    @Override
+   public void createQueue(final SimpleString address,
+                           final SimpleString queueName,
+                           final SimpleString filterString,
+                           final boolean durable,
+                           final boolean autoCreated) throws ActiveMQException {
+      internalCreateQueue(address, queueName, filterString, durable, false, autoCreated);
+   }
+
+   @Override
+   public void createQueue(final String address,
+                           final String queueName,
+                           final String filterString,
+                           final boolean durable,
+                           final boolean autoCreated) throws ActiveMQException {
+      createQueue(SimpleString.toSimpleString(address), SimpleString.toSimpleString(queueName), SimpleString.toSimpleString(filterString), durable, autoCreated);
+   }
+
+   @Override
    public void createTemporaryQueue(final SimpleString address, final SimpleString queueName) throws ActiveMQException {
-      internalCreateQueue(address, queueName, null, false, true);
+      internalCreateQueue(address, queueName, null, false, true, false);
    }
 
    @Override
    public void createTemporaryQueue(final String address, final String queueName) throws ActiveMQException {
-      internalCreateQueue(SimpleString.toSimpleString(address), SimpleString.toSimpleString(queueName), null, false, true);
+      internalCreateQueue(SimpleString.toSimpleString(address), SimpleString.toSimpleString(queueName), null, false, true, false);
    }
 
    @Override
    public void createTemporaryQueue(final SimpleString address,
                                     final SimpleString queueName,
                                     final SimpleString filter) throws ActiveMQException {
-      internalCreateQueue(address, queueName, filter, false, true);
+      internalCreateQueue(address, queueName, filter, false, true, false);
    }
 
    @Override
    public void createTemporaryQueue(final String address,
                                     final String queueName,
                                     final String filter) throws ActiveMQException {
-      internalCreateQueue(SimpleString.toSimpleString(address), SimpleString.toSimpleString(queueName), SimpleString.toSimpleString(filter), false, true);
+      internalCreateQueue(SimpleString.toSimpleString(address), SimpleString.toSimpleString(queueName), SimpleString.toSimpleString(filter), false, true, false);
    }
 
    @Override
@@ -1551,7 +1569,8 @@ public final class ClientSessionImpl implements ClientSessionInternal, FailureLi
                                     final SimpleString queueName,
                                     final SimpleString filterString,
                                     final boolean durable,
-                                    final boolean temp) throws ActiveMQException {
+                                    final boolean temp,
+                                    final boolean autoCreated) throws ActiveMQException {
       checkClosed();
 
       if (durable && temp) {
@@ -1560,7 +1579,7 @@ public final class ClientSessionImpl implements ClientSessionInternal, FailureLi
 
       startCall();
       try {
-         sessionContext.createQueue(address, queueName, filterString, durable, temp);
+         sessionContext.createQueue(address, queueName, filterString, durable, temp, autoCreated);
       } finally {
          endCall();
       }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ffeaf48f/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/ActiveMQSessionContext.java
----------------------------------------------------------------------
diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/ActiveMQSessionContext.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/ActiveMQSessionContext.java
index 919da19..cbbe2b7 100644
--- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/ActiveMQSessionContext.java
+++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/ActiveMQSessionContext.java
@@ -52,6 +52,7 @@ import org.apache.activemq.artemis.core.protocol.core.Packet;
 import org.apache.activemq.artemis.core.protocol.core.impl.wireformat.ActiveMQExceptionMessage;
 import org.apache.activemq.artemis.core.protocol.core.impl.wireformat.CreateAddressMessage;
 import org.apache.activemq.artemis.core.protocol.core.impl.wireformat.CreateQueueMessage;
+import org.apache.activemq.artemis.core.protocol.core.impl.wireformat.CreateQueueMessage_V2;
 import org.apache.activemq.artemis.core.protocol.core.impl.wireformat.CreateSessionMessage;
 import org.apache.activemq.artemis.core.protocol.core.impl.wireformat.CreateSharedQueueMessage;
 import org.apache.activemq.artemis.core.protocol.core.impl.wireformat.DisconnectConsumerMessage;
@@ -594,8 +595,9 @@ public class ActiveMQSessionContext extends SessionContext {
                            SimpleString queueName,
                            SimpleString filterString,
                            boolean durable,
-                           boolean temp) throws ActiveMQException {
-      CreateQueueMessage request = new CreateQueueMessage(address, queueName, filterString, durable, temp, true);
+                           boolean temp,
+                           boolean autoCreated) throws ActiveMQException {
+      CreateQueueMessage request = new CreateQueueMessage_V2(address, queueName, filterString, durable, temp, autoCreated, true);
       sessionChannel.sendBlocking(request, PacketImpl.NULL_RESPONSE);
    }
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ffeaf48f/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/PacketDecoder.java
----------------------------------------------------------------------
diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/PacketDecoder.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/PacketDecoder.java
index 834822c..de1edbc 100644
--- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/PacketDecoder.java
+++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/PacketDecoder.java
@@ -29,6 +29,7 @@ import org.apache.activemq.artemis.core.protocol.core.impl.wireformat.ClusterTop
 import org.apache.activemq.artemis.core.protocol.core.impl.wireformat.ClusterTopologyChangeMessage_V3;
 import org.apache.activemq.artemis.core.protocol.core.impl.wireformat.CreateAddressMessage;
 import org.apache.activemq.artemis.core.protocol.core.impl.wireformat.CreateQueueMessage;
+import org.apache.activemq.artemis.core.protocol.core.impl.wireformat.CreateQueueMessage_V2;
 import org.apache.activemq.artemis.core.protocol.core.impl.wireformat.CreateSessionMessage;
 import org.apache.activemq.artemis.core.protocol.core.impl.wireformat.CreateSessionResponseMessage;
 import org.apache.activemq.artemis.core.protocol.core.impl.wireformat.CreateSharedQueueMessage;
@@ -91,6 +92,7 @@ import static org.apache.activemq.artemis.core.protocol.core.impl.PacketImpl.CRE
 import static org.apache.activemq.artemis.core.protocol.core.impl.PacketImpl.CREATESESSION_RESP;
 import static org.apache.activemq.artemis.core.protocol.core.impl.PacketImpl.CREATE_ADDRESS;
 import static org.apache.activemq.artemis.core.protocol.core.impl.PacketImpl.CREATE_QUEUE;
+import static org.apache.activemq.artemis.core.protocol.core.impl.PacketImpl.CREATE_QUEUE_V2;
 import static org.apache.activemq.artemis.core.protocol.core.impl.PacketImpl.CREATE_SHARED_QUEUE;
 import static org.apache.activemq.artemis.core.protocol.core.impl.PacketImpl.DELETE_QUEUE;
 import static org.apache.activemq.artemis.core.protocol.core.impl.PacketImpl.DISCONNECT;
@@ -245,6 +247,10 @@ public abstract class PacketDecoder implements Serializable {
             packet = new CreateQueueMessage();
             break;
          }
+         case CREATE_QUEUE_V2: {
+            packet = new CreateQueueMessage_V2();
+            break;
+         }
          case CREATE_SHARED_QUEUE: {
             packet = new CreateSharedQueueMessage();
             break;

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ffeaf48f/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/PacketImpl.java
----------------------------------------------------------------------
diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/PacketImpl.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/PacketImpl.java
index e07d9b5..abc1eef 100644
--- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/PacketImpl.java
+++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/PacketImpl.java
@@ -251,6 +251,8 @@ public class PacketImpl implements Packet {
 
    public static final byte CREATE_ADDRESS = -11;
 
+   public static final byte CREATE_QUEUE_V2 = -12;
+
    // Static --------------------------------------------------------
 
    public PacketImpl(final byte type) {

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ffeaf48f/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/CreateQueueMessage.java
----------------------------------------------------------------------
diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/CreateQueueMessage.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/CreateQueueMessage.java
index e837d55..2ebf147 100644
--- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/CreateQueueMessage.java
+++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/CreateQueueMessage.java
@@ -22,17 +22,17 @@ import org.apache.activemq.artemis.core.protocol.core.impl.PacketImpl;
 
 public class CreateQueueMessage extends PacketImpl {
 
-   private SimpleString address;
+   protected SimpleString address;
 
-   private SimpleString queueName;
+   protected SimpleString queueName;
 
-   private SimpleString filterString;
+   protected SimpleString filterString;
 
-   private boolean durable;
+   protected boolean durable;
 
-   private boolean temporary;
+   protected boolean temporary;
 
-   private boolean requiresResponse;
+   protected boolean requiresResponse;
 
    public CreateQueueMessage(final SimpleString address,
                              final SimpleString queueName,
@@ -55,16 +55,28 @@ public class CreateQueueMessage extends PacketImpl {
    }
 
    // Public --------------------------------------------------------
+   /**
+    * @param createQueueMessageV2
+    */
+   public CreateQueueMessage(byte createQueueMessageV2) {
+      super(createQueueMessageV2);
+   }
 
    @Override
    public String toString() {
       StringBuffer buff = new StringBuffer(getParentString());
+      buff.append("]");
+      return buff.toString();
+   }
+
+   @Override
+   public String getParentString() {
+      StringBuffer buff = new StringBuffer(super.getParentString());
       buff.append(", address=" + address);
       buff.append(", queueName=" + queueName);
       buff.append(", filterString=" + filterString);
       buff.append(", durable=" + durable);
       buff.append(", temporary=" + temporary);
-      buff.append("]");
       return buff.toString();
    }
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ffeaf48f/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/CreateQueueMessage_V2.java
----------------------------------------------------------------------
diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/CreateQueueMessage_V2.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/CreateQueueMessage_V2.java
new file mode 100644
index 0000000..13a4a58
--- /dev/null
+++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/CreateQueueMessage_V2.java
@@ -0,0 +1,99 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.activemq.artemis.core.protocol.core.impl.wireformat;
+
+import org.apache.activemq.artemis.api.core.ActiveMQBuffer;
+import org.apache.activemq.artemis.api.core.SimpleString;
+
+public class CreateQueueMessage_V2 extends CreateQueueMessage {
+
+   private boolean autoCreated;
+
+   public CreateQueueMessage_V2(final SimpleString address,
+                                final SimpleString queueName,
+                                final SimpleString filterString,
+                                final boolean durable,
+                                final boolean temporary,
+                                final boolean autoCreated,
+                                final boolean requiresResponse) {
+      this();
+
+      this.address = address;
+      this.queueName = queueName;
+      this.filterString = filterString;
+      this.durable = durable;
+      this.temporary = temporary;
+      this.autoCreated = autoCreated;
+      this.requiresResponse = requiresResponse;
+   }
+
+   public CreateQueueMessage_V2() {
+      super(CREATE_QUEUE_V2);
+   }
+
+   // Public --------------------------------------------------------
+
+   @Override
+   public String toString() {
+      StringBuffer buff = new StringBuffer(super.getParentString());
+      buff.append(", autoCreated=" + autoCreated);
+      buff.append("]");
+      return buff.toString();
+   }
+
+   public boolean isAutoCreated() {
+      return autoCreated;
+   }
+
+   public void setAutoCreated(boolean autoCreated) {
+      this.autoCreated = autoCreated;
+   }
+
+   @Override
+   public void encodeRest(final ActiveMQBuffer buffer) {
+      super.encodeRest(buffer);
+      buffer.writeBoolean(autoCreated);
+   }
+
+   @Override
+   public void decodeRest(final ActiveMQBuffer buffer) {
+      super.decodeRest(buffer);
+      autoCreated = buffer.readBoolean();
+   }
+
+   @Override
+   public int hashCode() {
+      final int prime = 31;
+      int result = super.hashCode();
+      result = prime * result + (autoCreated ? 1231 : 1237);
+      return result;
+   }
+
+   @Override
+   public boolean equals(Object obj) {
+      if (this == obj)
+         return true;
+      if (!super.equals(obj))
+         return false;
+      if (!(obj instanceof CreateQueueMessage_V2))
+         return false;
+      CreateQueueMessage_V2 other = (CreateQueueMessage_V2) obj;
+      if (autoCreated != other.autoCreated)
+         return false;
+      return true;
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ffeaf48f/artemis-core-client/src/main/java/org/apache/activemq/artemis/spi/core/remoting/SessionContext.java
----------------------------------------------------------------------
diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/spi/core/remoting/SessionContext.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/spi/core/remoting/SessionContext.java
index 16e8314..01f0b08 100644
--- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/spi/core/remoting/SessionContext.java
+++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/spi/core/remoting/SessionContext.java
@@ -172,7 +172,8 @@ public abstract class SessionContext {
                                     SimpleString queueName,
                                     SimpleString filterString,
                                     boolean durable,
-                                    boolean temp) throws ActiveMQException;
+                                    boolean temp,
+                                    boolean autoCreated) throws ActiveMQException;
 
    public abstract ClientSession.QueueQuery queueQuery(SimpleString queueName) throws ActiveMQException;
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ffeaf48f/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQMessageProducer.java
----------------------------------------------------------------------
diff --git a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQMessageProducer.java b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQMessageProducer.java
index 5cbd40f..3d3fa66 100644
--- a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQMessageProducer.java
+++ b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQMessageProducer.java
@@ -410,7 +410,7 @@ public class ActiveMQMessageProducer implements MessageProducer, QueueSender, To
                         // TODO is it right to use the address for the queue name here?
                         clientSession.createTemporaryQueue(address, address);
                      } else {
-                        clientSession.createQueue(address, address, null, true);
+                        clientSession.createQueue(address, address, null, true, true);
                      }
                   } else if (!destination.isQueue() && query.isAutoCreateJmsTopics()) {
                      clientSession.createAddress(address, true, true);

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ffeaf48f/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQSession.java
----------------------------------------------------------------------
diff --git a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQSession.java b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQSession.java
index f514dba..26a941b 100644
--- a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQSession.java
+++ b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQSession.java
@@ -304,7 +304,7 @@ public class ActiveMQSession implements QueueSession, TopicSession {
                   // TODO create queue here in such a way that it is deleted when consumerCount == 0
                   // perhaps just relying on the broker to do it is simplest (i.e. deleteOnNoConsumers)
                   session.createAddress(jbd.getSimpleAddress(), false, true);
-                  session.createQueue(jbd.getSimpleAddress(), jbd.getSimpleAddress(), null, true);
+                  session.createQueue(jbd.getSimpleAddress(), jbd.getSimpleAddress(), null, true, true);
                } else if (!jbd.isQueue() && response.isAutoCreateJmsTopics()) {
                   session.createAddress(jbd.getSimpleAddress(), true, true);
                } else {
@@ -647,9 +647,7 @@ public class ActiveMQSession implements QueueSession, TopicSession {
              */
             if (!response.isExists() || !response.getQueueNames().contains(dest.getSimpleAddress())) {
                if (response.isAutoCreateJmsQueues()) {
-                  // TODO create queue here in such a way that it is deleted when consumerCount == 0
-                  // perhaps just relying on the broker to do it is simplest (i.e. deleteOnNoConsumers)
-                  session.createQueue(dest.getSimpleAddress(), dest.getSimpleAddress(), true);
+                  session.createQueue(dest.getSimpleAddress(), dest.getSimpleAddress(), null, true, true);
                } else {
                   throw new InvalidDestinationException("Destination " + dest.getName() + " does not exist");
                }
@@ -797,7 +795,7 @@ public class ActiveMQSession implements QueueSession, TopicSession {
          AddressQuery response = session.addressQuery(new SimpleString(activeMQDestination.getAddress()));
          if (!response.isExists()) {
             if (response.isAutoCreateJmsQueues()) {
-               session.createQueue(activeMQDestination.getSimpleAddress(), activeMQDestination.getSimpleAddress(), true);
+               session.createQueue(activeMQDestination.getSimpleAddress(), activeMQDestination.getSimpleAddress(), null, true, true);
             } else {
                throw new InvalidDestinationException("Destination " + activeMQDestination.getName() + " does not exist");
             }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ffeaf48f/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/server/impl/JMSServerManagerImpl.java
----------------------------------------------------------------------
diff --git a/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/server/impl/JMSServerManagerImpl.java b/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/server/impl/JMSServerManagerImpl.java
index 97108d1..648854b 100644
--- a/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/server/impl/JMSServerManagerImpl.java
+++ b/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/server/impl/JMSServerManagerImpl.java
@@ -1634,9 +1634,9 @@ public class JMSServerManagerImpl implements JMSServerManager, ActivateCallback
 //         long consumerCount = queue.getConsumerCount();
 //         long messageCount = queue.getMessageCount();
 //
-//         if (address.toString().startsWith(ActiveMQDestination.JMS_QUEUE_ADDRESS_PREFIX) && settings.getAutoDeleteJmsQueues() && queue.getMessageCount() == 0) {
+//         if (address.toString().startsWith(ActiveMQDestination.JMS_QUEUE_ADDRESS_PREFIX) && settings.isAutoDeleteJmsQueues() && queue.getMessageCount() == 0) {
 //            if (ActiveMQJMSServerLogger.LOGGER.isDebugEnabled()) {
-//               ActiveMQJMSServerLogger.LOGGER.debug("deleting auto-created queue \"" + queueName + ".\" consumerCount = " + consumerCount + "; messageCount = " + messageCount + "; getAutoDeleteJmsQueues = " + settings.getAutoDeleteJmsQueues());
+//               ActiveMQJMSServerLogger.LOGGER.debug("deleting auto-created queue \"" + queueName + ".\" consumerCount = " + consumerCount + "; messageCount = " + messageCount + "; isAutoDeleteJmsQueues = " + settings.isAutoDeleteJmsQueues());
 //            }
 //
 //            return destroyQueue(queueName.toString().substring(ActiveMQDestination.JMS_QUEUE_ADDRESS_PREFIX.length()), false);

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ffeaf48f/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/ActiveMQServerControlImpl.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/ActiveMQServerControlImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/ActiveMQServerControlImpl.java
index 25b9fdb..e7900f2 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/ActiveMQServerControlImpl.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/ActiveMQServerControlImpl.java
@@ -1695,7 +1695,7 @@ public class ActiveMQServerControlImpl extends AbstractControl implements Active
       if (addressSettings.getExpiryAddress() != null) {
          settings.add("expiryAddress", addressSettings.getExpiryAddress().toString());
       }
-      return settings.add("expiryDelay", addressSettings.getExpiryDelay()).add("maxDeliveryAttempts", addressSettings.getMaxDeliveryAttempts()).add("pageCacheMaxSize", addressSettings.getPageCacheMaxSize()).add("maxSizeBytes", addressSettings.getMaxSizeBytes()).add("pageSizeBytes", addressSettings.getPageSizeBytes()).add("redeliveryDelay", addressSettings.getRedeliveryDelay()).add("redeliveryMultiplier", addressSettings.getRedeliveryMultiplier()).add("maxRedeliveryDelay", addressSettings.getMaxRedeliveryDelay()).add("redistributionDelay", addressSettings.getRedistributionDelay()).add("lastValueQueue", addressSettings.isLastValueQueue()).add("sendToDLAOnNoRoute", addressSettings.isSendToDLAOnNoRoute()).add("addressFullMessagePolicy", policy).add("slowConsumerThreshold", addressSettings.getSlowConsumerThreshold()).add("slowConsumerCheckPeriod", addressSettings.getSlowConsumerCheckPeriod()).add("slowConsumerPolicy", consumerPolicy).add("autoCreateJmsQueues", addressSettings.isAutoCreat
 eJmsQueues()).add("autoCreateJmsTopics", addressSettings.isAutoCreateJmsTopics()).add("autoDeleteJmsQueues", addressSettings.getAutoDeleteJmsQueues()).add("autoDeleteJmsTopics", addressSettings.getAutoDeleteJmsQueues()).build().toString();
+      return settings.add("expiryDelay", addressSettings.getExpiryDelay()).add("maxDeliveryAttempts", addressSettings.getMaxDeliveryAttempts()).add("pageCacheMaxSize", addressSettings.getPageCacheMaxSize()).add("maxSizeBytes", addressSettings.getMaxSizeBytes()).add("pageSizeBytes", addressSettings.getPageSizeBytes()).add("redeliveryDelay", addressSettings.getRedeliveryDelay()).add("redeliveryMultiplier", addressSettings.getRedeliveryMultiplier()).add("maxRedeliveryDelay", addressSettings.getMaxRedeliveryDelay()).add("redistributionDelay", addressSettings.getRedistributionDelay()).add("lastValueQueue", addressSettings.isLastValueQueue()).add("sendToDLAOnNoRoute", addressSettings.isSendToDLAOnNoRoute()).add("addressFullMessagePolicy", policy).add("slowConsumerThreshold", addressSettings.getSlowConsumerThreshold()).add("slowConsumerCheckPeriod", addressSettings.getSlowConsumerCheckPeriod()).add("slowConsumerPolicy", consumerPolicy).add("autoCreateJmsQueues", addressSettings.isAutoCreat
 eJmsQueues()).add("autoCreateJmsTopics", addressSettings.isAutoCreateJmsTopics()).add("autoDeleteJmsQueues", addressSettings.isAutoDeleteJmsQueues()).add("autoDeleteJmsTopics", addressSettings.isAutoDeleteJmsQueues()).build().toString();
    }
 
    @Override

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ffeaf48f/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/ServerSessionPacketHandler.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/ServerSessionPacketHandler.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/ServerSessionPacketHandler.java
index be71a92..ac8d68a 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/ServerSessionPacketHandler.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/ServerSessionPacketHandler.java
@@ -32,6 +32,7 @@ import org.apache.activemq.artemis.core.protocol.core.impl.PacketImpl;
 import org.apache.activemq.artemis.core.protocol.core.impl.wireformat.ActiveMQExceptionMessage;
 import org.apache.activemq.artemis.core.protocol.core.impl.wireformat.CreateAddressMessage;
 import org.apache.activemq.artemis.core.protocol.core.impl.wireformat.CreateQueueMessage;
+import org.apache.activemq.artemis.core.protocol.core.impl.wireformat.CreateQueueMessage_V2;
 import org.apache.activemq.artemis.core.protocol.core.impl.wireformat.CreateSharedQueueMessage;
 import org.apache.activemq.artemis.core.protocol.core.impl.wireformat.NullResponseMessage;
 import org.apache.activemq.artemis.core.protocol.core.impl.wireformat.RollbackMessage;
@@ -85,6 +86,7 @@ import org.jboss.logging.Logger;
 
 import static org.apache.activemq.artemis.core.protocol.core.impl.PacketImpl.CREATE_ADDRESS;
 import static org.apache.activemq.artemis.core.protocol.core.impl.PacketImpl.CREATE_QUEUE;
+import static org.apache.activemq.artemis.core.protocol.core.impl.PacketImpl.CREATE_QUEUE_V2;
 import static org.apache.activemq.artemis.core.protocol.core.impl.PacketImpl.CREATE_SHARED_QUEUE;
 import static org.apache.activemq.artemis.core.protocol.core.impl.PacketImpl.DELETE_QUEUE;
 import static org.apache.activemq.artemis.core.protocol.core.impl.PacketImpl.SESS_ACKNOWLEDGE;
@@ -240,6 +242,15 @@ public class ServerSessionPacketHandler implements ChannelHandler {
                   }
                   break;
                }
+               case CREATE_QUEUE_V2: {
+                  CreateQueueMessage_V2 request = (CreateQueueMessage_V2) packet;
+                  requiresResponse = request.isRequiresResponse();
+                  session.createQueue(request.getAddress(), request.getQueueName(), request.getFilterString(), request.isTemporary(), request.isDurable(), null, null, request.isAutoCreated());
+                  if (requiresResponse) {
+                     response = new NullResponseMessage();
+                  }
+                  break;
+               }
                case CREATE_SHARED_QUEUE: {
                   CreateSharedQueueMessage request = (CreateSharedQueueMessage) packet;
                   requiresResponse = request.isRequiresResponse();

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ffeaf48f/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/AutoCreatedQueueManagerImpl.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/AutoCreatedQueueManagerImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/AutoCreatedQueueManagerImpl.java
index a211a96..8bea315 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/AutoCreatedQueueManagerImpl.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/AutoCreatedQueueManagerImpl.java
@@ -40,9 +40,9 @@ public class AutoCreatedQueueManagerImpl implements AutoCreatedQueueManager {
          long messageCount = queue.getMessageCount();
 
          // TODO make sure this is the right check
-         if ((queue.isAutoCreated() || queue.isDeleteOnNoConsumers()) && queue.getMessageCount() == 0) {
+         if (((queue.isAutoCreated() && settings.isAutoDeleteJmsQueues()) || queue.isDeleteOnNoConsumers()) && queue.getMessageCount() == 0) {
             if (ActiveMQServerLogger.LOGGER.isDebugEnabled()) {
-               ActiveMQServerLogger.LOGGER.debug("deleting auto-created queue \"" + queueName + ".\" consumerCount = " + consumerCount + "; messageCount = " + messageCount + "; getAutoDeleteJmsQueues = " + settings.getAutoDeleteJmsQueues());
+               ActiveMQServerLogger.LOGGER.debug("deleting auto-created queue \"" + queueName + ".\" consumerCount = " + consumerCount + "; messageCount = " + messageCount + "; isAutoDeleteJmsQueues = " + settings.isAutoDeleteJmsQueues());
             }
 
             // TODO handle this exception better

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ffeaf48f/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ServerSessionImpl.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ServerSessionImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ServerSessionImpl.java
index aafcced..8d73eda 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ServerSessionImpl.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ServerSessionImpl.java
@@ -509,7 +509,7 @@ public class ServerSessionImpl implements ServerSession, FailureListener {
 
       server.checkQueueCreationLimit(getUsername());
 
-      Queue queue = server.createQueue(address, name, filterString, SimpleString.toSimpleString(getUsername()), durable, temporary, maxConsumers, deleteOnNoConsumers, true);
+      Queue queue = server.createQueue(address, name, filterString, SimpleString.toSimpleString(getUsername()), durable, temporary, autoCreated, maxConsumers, deleteOnNoConsumers, true);
 
       if (temporary) {
          // Temporary queue in core simply means the queue will be deleted if

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ffeaf48f/artemis-server/src/main/java/org/apache/activemq/artemis/core/settings/impl/AddressSettings.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/settings/impl/AddressSettings.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/settings/impl/AddressSettings.java
index 68d9656..e613ee6 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/settings/impl/AddressSettings.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/settings/impl/AddressSettings.java
@@ -174,7 +174,7 @@ public class AddressSettings implements Mergeable<AddressSettings>, Serializable
       return this;
    }
 
-   public boolean getAutoDeleteJmsQueues() {
+   public boolean isAutoDeleteJmsQueues() {
       return autoDeleteJmsQueues != null ? autoDeleteJmsQueues : AddressSettings.DEFAULT_AUTO_DELETE_JMS_QUEUES;
    }
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ffeaf48f/artemis-server/src/test/java/org/apache/activemq/artemis/core/config/impl/FileConfigurationTest.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/test/java/org/apache/activemq/artemis/core/config/impl/FileConfigurationTest.java b/artemis-server/src/test/java/org/apache/activemq/artemis/core/config/impl/FileConfigurationTest.java
index d95ea52..cbd2e65 100644
--- a/artemis-server/src/test/java/org/apache/activemq/artemis/core/config/impl/FileConfigurationTest.java
+++ b/artemis-server/src/test/java/org/apache/activemq/artemis/core/config/impl/FileConfigurationTest.java
@@ -294,7 +294,7 @@ public class FileConfigurationTest extends ConfigurationImplTest {
       assertEquals(5, conf.getAddressesSettings().get("a1").getSlowConsumerCheckPeriod());
       assertEquals(SlowConsumerPolicy.NOTIFY, conf.getAddressesSettings().get("a1").getSlowConsumerPolicy());
       assertEquals(true, conf.getAddressesSettings().get("a1").isAutoCreateJmsQueues());
-      assertEquals(true, conf.getAddressesSettings().get("a1").getAutoDeleteJmsQueues());
+      assertEquals(true, conf.getAddressesSettings().get("a1").isAutoDeleteJmsQueues());
       assertEquals(true, conf.getAddressesSettings().get("a1").isAutoCreateJmsTopics());
       assertEquals(true, conf.getAddressesSettings().get("a1").isAutoDeleteJmsTopics());
 
@@ -309,7 +309,7 @@ public class FileConfigurationTest extends ConfigurationImplTest {
       assertEquals(15, conf.getAddressesSettings().get("a2").getSlowConsumerCheckPeriod());
       assertEquals(SlowConsumerPolicy.KILL, conf.getAddressesSettings().get("a2").getSlowConsumerPolicy());
       assertEquals(false, conf.getAddressesSettings().get("a2").isAutoCreateJmsQueues());
-      assertEquals(false, conf.getAddressesSettings().get("a2").getAutoDeleteJmsQueues());
+      assertEquals(false, conf.getAddressesSettings().get("a2").isAutoDeleteJmsQueues());
       assertEquals(false, conf.getAddressesSettings().get("a2").isAutoCreateJmsTopics());
       assertEquals(false, conf.getAddressesSettings().get("a2").isAutoDeleteJmsTopics());
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ffeaf48f/artemis-server/src/test/java/org/apache/activemq/artemis/core/settings/AddressSettingsTest.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/test/java/org/apache/activemq/artemis/core/settings/AddressSettingsTest.java b/artemis-server/src/test/java/org/apache/activemq/artemis/core/settings/AddressSettingsTest.java
index 3861782..4041a16 100644
--- a/artemis-server/src/test/java/org/apache/activemq/artemis/core/settings/AddressSettingsTest.java
+++ b/artemis-server/src/test/java/org/apache/activemq/artemis/core/settings/AddressSettingsTest.java
@@ -40,7 +40,7 @@ public class AddressSettingsTest extends ActiveMQTestBase {
       Assert.assertEquals(AddressSettings.DEFAULT_SLOW_CONSUMER_CHECK_PERIOD, addressSettings.getSlowConsumerCheckPeriod());
       Assert.assertEquals(AddressSettings.DEFAULT_SLOW_CONSUMER_POLICY, addressSettings.getSlowConsumerPolicy());
       Assert.assertEquals(AddressSettings.DEFAULT_AUTO_CREATE_JMS_QUEUES, addressSettings.isAutoCreateJmsQueues());
-      Assert.assertEquals(AddressSettings.DEFAULT_AUTO_DELETE_JMS_QUEUES, addressSettings.getAutoDeleteJmsQueues());
+      Assert.assertEquals(AddressSettings.DEFAULT_AUTO_DELETE_JMS_QUEUES, addressSettings.isAutoDeleteJmsQueues());
 //      Assert.assertEquals(AddressSettings.DEFAULT_AUTO_CREATE_TOPICS, addressSettings.isAutoCreateJmsTopics());
 //      Assert.assertEquals(AddressSettings.DEFAULT_AUTO_DELETE_TOPICS, addressSettings.isAutoDeleteJmsTopics());
    }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ffeaf48f/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/message/MessageHeaderTest.java
----------------------------------------------------------------------
diff --git a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/message/MessageHeaderTest.java b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/message/MessageHeaderTest.java
index f8b7153..6d70569 100644
--- a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/message/MessageHeaderTest.java
+++ b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/message/MessageHeaderTest.java
@@ -821,18 +821,6 @@ public class MessageHeaderTest extends MessageHeaderTestBase {
                               final boolean durable) throws ActiveMQException {
       }
 
-      public void createQueue(final SimpleString address,
-                              final SimpleString queueName,
-                              final boolean durable,
-                              final boolean temporary) throws ActiveMQException {
-      }
-
-      public void createQueue(final String address,
-                              final String queueName,
-                              final boolean durable,
-                              final boolean temporary) throws ActiveMQException {
-      }
-
       @Override
       public void createQueue(final String address,
                               final String queueName,
@@ -841,6 +829,24 @@ public class MessageHeaderTest extends MessageHeaderTestBase {
       }
 
       @Override
+      public void createQueue(SimpleString address,
+                              SimpleString queueName,
+                              SimpleString filter,
+                              boolean durable,
+                              boolean autoCreated) throws ActiveMQException {
+
+      }
+
+      @Override
+      public void createQueue(String address,
+                              String queueName,
+                              String filter,
+                              boolean durable,
+                              boolean autoCreated) throws ActiveMQException {
+
+      }
+
+      @Override
       public void createTemporaryQueue(final SimpleString address,
                                        final SimpleString queueName) throws ActiveMQException {
       }


[25/48] activemq-artemis git commit: Fix ManagementWithStompTest

Posted by jb...@apache.org.
Fix ManagementWithStompTest


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

Branch: refs/heads/ARTEMIS-780
Commit: 3a8552df192aa683bdd4d29424ac9cc0a0adb1c0
Parents: 1e7b0ed
Author: jbertram <jb...@apache.com>
Authored: Tue Nov 15 20:55:12 2016 -0600
Committer: jbertram <jb...@apache.com>
Committed: Wed Nov 23 09:04:34 2016 -0600

----------------------------------------------------------------------
 .../core/protocol/stomp/StompConnection.java    |   2 +-
 .../management/ManagementWithStompTest.java     | 232 -------------------
 .../tests/integration/stomp/StompTest.java      |  58 +++++
 .../tests/integration/stomp/StompTestBase.java  |   6 +-
 4 files changed, 62 insertions(+), 236 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3a8552df/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompConnection.java
----------------------------------------------------------------------
diff --git a/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompConnection.java b/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompConnection.java
index eaeb21d..356aae1 100644
--- a/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompConnection.java
+++ b/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompConnection.java
@@ -262,7 +262,7 @@ public final class StompConnection implements RemotingConnection {
       try {
          if (manager.getServer().getAddressInfo(SimpleString.toSimpleString(queue)) == null) {
             // TODO check here to see if auto-creation is enabled
-            if (routingType.equals(AddressInfo.RoutingType.MULTICAST)) {
+            if (routingType != null && routingType.equals(AddressInfo.RoutingType.MULTICAST)) {
                manager.getServer().createOrUpdateAddressInfo(new AddressInfo(SimpleString.toSimpleString(queue)).setAutoCreated(true));
             } else {
                manager.getServer().createOrUpdateAddressInfo(new AddressInfo(SimpleString.toSimpleString(queue)).setRoutingType(AddressInfo.RoutingType.ANYCAST).setAutoCreated(true));

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3a8552df/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ManagementWithStompTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ManagementWithStompTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ManagementWithStompTest.java
deleted file mode 100644
index 5c94f1d..0000000
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ManagementWithStompTest.java
+++ /dev/null
@@ -1,232 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.activemq.artemis.tests.integration.management;
-
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.net.Socket;
-import java.nio.charset.StandardCharsets;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.apache.activemq.artemis.api.config.ActiveMQDefaultConfiguration;
-import org.apache.activemq.artemis.api.core.SimpleString;
-import org.apache.activemq.artemis.api.core.TransportConfiguration;
-import org.apache.activemq.artemis.api.core.client.ClientSession;
-import org.apache.activemq.artemis.api.core.client.ClientSessionFactory;
-import org.apache.activemq.artemis.api.core.client.ServerLocator;
-import org.apache.activemq.artemis.api.core.management.ResourceNames;
-import org.apache.activemq.artemis.core.config.Configuration;
-import org.apache.activemq.artemis.core.protocol.stomp.Stomp;
-import org.apache.activemq.artemis.core.protocol.stomp.StompProtocolManagerFactory;
-import org.apache.activemq.artemis.core.remoting.impl.netty.NettyAcceptorFactory;
-import org.apache.activemq.artemis.core.remoting.impl.netty.TransportConstants;
-import org.apache.activemq.artemis.core.server.ActiveMQServer;
-import org.apache.activemq.artemis.core.server.ActiveMQServers;
-import org.apache.activemq.artemis.jms.server.JMSServerManager;
-import org.apache.activemq.artemis.jms.server.impl.JMSServerManagerImpl;
-import org.apache.activemq.artemis.utils.RandomUtil;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
-
-public class ManagementWithStompTest extends ManagementTestBase {
-
-   // Constants -----------------------------------------------------
-
-   // Attributes ----------------------------------------------------
-
-   protected ActiveMQServer server;
-
-   protected JMSServerManager jmsServer;
-
-   protected ClientSession session;
-
-   private Socket stompSocket;
-
-   private ByteArrayOutputStream inputBuffer;
-
-   // Static --------------------------------------------------------
-
-   // Constructors --------------------------------------------------
-
-   // Public --------------------------------------------------------
-
-   @Test
-   public void testGetManagementAttributeFromStomp() throws Exception {
-      SimpleString address = RandomUtil.randomSimpleString();
-      SimpleString queue = RandomUtil.randomSimpleString();
-
-      session.createQueue(address, queue, null, false);
-
-      String frame = "CONNECT\n" + "login: brianm\n" + "passcode: wombats\n\n" + Stomp.NULL;
-      sendFrame(frame);
-
-      frame = receiveFrame(10000);
-      Assert.assertTrue(frame.startsWith("CONNECTED"));
-
-      frame = "SUBSCRIBE\n" + "destination:" + queue + "\n\n" + Stomp.NULL;
-      sendFrame(frame);
-
-      // retrieve the address of the queue
-      frame = "\nSEND\n" + "destination:" + ActiveMQDefaultConfiguration.getDefaultManagementAddress() + "\n" +
-         "reply-to:" + address + "\n" +
-         "_AMQ_ResourceName:" + ResourceNames.QUEUE + queue + "\n" +
-         "_AMQ_Attribute: Address\n\n" +
-         Stomp.NULL;
-      sendFrame(frame);
-
-      frame = receiveFrame(10000);
-      System.out.println(frame);
-      Assert.assertTrue(frame.contains("_AMQ_OperationSucceeded:true"));
-      // the address will be returned in the message body in a JSON array
-      Assert.assertTrue(frame.contains("[\"" + address + "\"]"));
-
-      frame = "UNSUBSCRIBE\n" + "destination:" + queue + "\n" +
-         "receipt: 123\n\n" +
-         Stomp.NULL;
-      sendFrame(frame);
-      waitForReceipt();
-
-      String disconnectFrame = "DISCONNECT\n\n" + Stomp.NULL;
-      sendFrame(disconnectFrame);
-
-      session.deleteQueue(queue);
-   }
-
-   @Test
-   public void testInvokeOperationFromStomp() throws Exception {
-      SimpleString address = RandomUtil.randomSimpleString();
-      SimpleString queue = RandomUtil.randomSimpleString();
-
-      session.createQueue(address, queue, null, false);
-
-      String frame = "CONNECT\n" + "login: brianm\n" + "passcode: wombats\n\n" + Stomp.NULL;
-      sendFrame(frame);
-
-      frame = receiveFrame(10000);
-      Assert.assertTrue(frame.startsWith("CONNECTED"));
-
-      frame = "SUBSCRIBE\n" + "destination:" + queue + "\n\n" + Stomp.NULL;
-      sendFrame(frame);
-
-      // count number of message with filter "color = 'blue'"
-      frame = "\nSEND\n" + "destination:" + ActiveMQDefaultConfiguration.getDefaultManagementAddress() + "\n" +
-         "reply-to:" + address + "\n" +
-         "_AMQ_ResourceName:" + ResourceNames.QUEUE + queue + "\n" +
-         "_AMQ_OperationName: countMessages\n\n" +
-         "[\"color = 'blue'\"]" +
-         Stomp.NULL;
-      sendFrame(frame);
-
-      frame = receiveFrame(10000);
-      System.out.println(frame);
-      Assert.assertTrue(frame.contains("_AMQ_OperationSucceeded:true"));
-      // there is no such messages => 0 returned in a JSON array
-      Assert.assertTrue(frame.contains("[0]"));
-
-      frame = "UNSUBSCRIBE\n" + "destination:" + queue + "\n" +
-         "receipt: 123\n\n" +
-         Stomp.NULL;
-      sendFrame(frame);
-      waitForReceipt();
-
-      String disconnectFrame = "DISCONNECT\n\n" + Stomp.NULL;
-      sendFrame(disconnectFrame);
-
-      session.deleteQueue(queue);
-   }
-
-   // Package protected ---------------------------------------------
-
-   // Protected -----------------------------------------------------
-
-   private ServerLocator locator;
-
-   @Override
-   @Before
-   public void setUp() throws Exception {
-      super.setUp();
-
-      Map<String, Object> params = new HashMap<>();
-      params.put(TransportConstants.PROTOCOLS_PROP_NAME, StompProtocolManagerFactory.STOMP_PROTOCOL_NAME);
-      params.put(TransportConstants.PORT_PROP_NAME, TransportConstants.DEFAULT_STOMP_PORT);
-      TransportConfiguration stompTransport = new TransportConfiguration(NettyAcceptorFactory.class.getName(), params);
-
-      Configuration config = createDefaultInVMConfig().addAcceptorConfiguration(stompTransport);
-
-      server = addServer(ActiveMQServers.newActiveMQServer(config, mbeanServer, false, "brianm", "wombats"));
-
-      jmsServer = new JMSServerManagerImpl(server);
-
-      jmsServer.start();
-
-      locator = createInVMNonHALocator().setBlockOnNonDurableSend(true);
-      ClientSessionFactory sf = createSessionFactory(locator);
-      session = sf.createSession(false, true, false);
-      session.start();
-
-      stompSocket = new Socket("127.0.0.1", TransportConstants.DEFAULT_STOMP_PORT);
-      inputBuffer = new ByteArrayOutputStream();
-   }
-
-   // Private -------------------------------------------------------
-
-   public void sendFrame(String data) throws Exception {
-      byte[] bytes = data.getBytes(StandardCharsets.UTF_8);
-      OutputStream outputStream = stompSocket.getOutputStream();
-      for (int i = 0; i < bytes.length; i++) {
-         outputStream.write(bytes[i]);
-      }
-      outputStream.flush();
-   }
-
-   public String receiveFrame(long timeOut) throws Exception {
-      stompSocket.setSoTimeout((int) timeOut);
-      InputStream is = stompSocket.getInputStream();
-      int c = 0;
-      for (;;) {
-         c = is.read();
-         if (c < 0) {
-            throw new IOException("socket closed.");
-         } else if (c == 0) {
-            c = is.read();
-            if (c != '\n') {
-               byte[] ba = inputBuffer.toByteArray();
-               System.out.println(new String(ba, StandardCharsets.UTF_8));
-            }
-            Assert.assertEquals("Expecting stomp frame to terminate with \0\n", c, '\n');
-            byte[] ba = inputBuffer.toByteArray();
-            inputBuffer.reset();
-            return new String(ba, StandardCharsets.UTF_8);
-         } else {
-            inputBuffer.write(c);
-         }
-      }
-   }
-
-   protected void waitForReceipt() throws Exception {
-      String frame = receiveFrame(50000);
-      Assert.assertNotNull(frame);
-      Assert.assertTrue(frame.indexOf("RECEIPT") > -1);
-   }
-
-   // Inner classes -------------------------------------------------
-
-}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3a8552df/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/StompTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/StompTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/StompTest.java
index e7dcc91..f1def68 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/StompTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/StompTest.java
@@ -31,6 +31,7 @@ import java.util.concurrent.TimeUnit;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
+import org.apache.activemq.artemis.api.config.ActiveMQDefaultConfiguration;
 import org.apache.activemq.artemis.api.core.SimpleString;
 import org.apache.activemq.artemis.api.core.client.ActiveMQClient;
 import org.apache.activemq.artemis.api.core.client.ClientMessage;
@@ -38,6 +39,8 @@ import org.apache.activemq.artemis.api.core.client.ClientProducer;
 import org.apache.activemq.artemis.api.core.client.ClientSession;
 import org.apache.activemq.artemis.api.core.client.ClientSessionFactory;
 import org.apache.activemq.artemis.api.core.client.ServerLocator;
+import org.apache.activemq.artemis.api.core.management.ManagementHelper;
+import org.apache.activemq.artemis.api.core.management.ResourceNames;
 import org.apache.activemq.artemis.api.jms.ActiveMQJMSClient;
 import org.apache.activemq.artemis.core.postoffice.impl.LocalQueueBinding;
 import org.apache.activemq.artemis.core.protocol.stomp.Stomp;
@@ -1406,4 +1409,59 @@ public class StompTest extends StompTestBase {
       frame = conn.sendFrame(frame);
       assertEquals(Stomp.Responses.ERROR, frame.getCommand());
    }
+
+   @Test
+   public void testGetManagementAttributeFromStomp() throws Exception {
+      conn.connect(defUser, defPass);
+
+      subscribe(conn, null);
+
+      ClientStompFrame frame = conn.createFrame(Stomp.Commands.SEND)
+                                   .addHeader(Stomp.Headers.Send.DESTINATION, ActiveMQDefaultConfiguration.getDefaultManagementAddress().toString())
+                                   .addHeader(Stomp.Headers.Send.REPLY_TO, getQueuePrefix() + getQueueName())
+                                   .addHeader(ManagementHelper.HDR_RESOURCE_NAME.toString(), ResourceNames.QUEUE + getQueuePrefix() + getQueueName())
+                                   .addHeader(ManagementHelper.HDR_ATTRIBUTE.toString(), "Address");
+
+      conn.sendFrame(frame);
+
+      frame = conn.receiveFrame(10000);
+
+      IntegrationTestLogger.LOGGER.info("Received: " + frame);
+
+      Assert.assertEquals(Boolean.TRUE.toString(), frame.getHeader(ManagementHelper.HDR_OPERATION_SUCCEEDED.toString()));
+      // the address will be returned in the message body in a JSON array
+      Assert.assertEquals("[\"" + getQueuePrefix() + getQueueName() + "\"]", frame.getBody());
+
+      unsubscribe(conn, null);
+
+      conn.disconnect();
+   }
+
+   @Test
+   public void testInvokeOperationFromStomp() throws Exception {
+      conn.connect(defUser, defPass);
+
+      subscribe(conn, null);
+
+      ClientStompFrame frame = conn.createFrame(Stomp.Commands.SEND)
+                                   .addHeader(Stomp.Headers.Send.DESTINATION, ActiveMQDefaultConfiguration.getDefaultManagementAddress().toString())
+                                   .addHeader(Stomp.Headers.Send.REPLY_TO, getQueuePrefix() + getQueueName())
+                                   .addHeader(ManagementHelper.HDR_RESOURCE_NAME.toString(), ResourceNames.QUEUE + getQueuePrefix() + getQueueName())
+                                   .addHeader(ManagementHelper.HDR_OPERATION_NAME.toString(), "countMessages")
+                                   .setBody("[\"color = 'blue'\"]");
+
+      conn.sendFrame(frame);
+
+      frame = conn.receiveFrame(10000);
+
+      IntegrationTestLogger.LOGGER.info("Received: " + frame);
+
+      Assert.assertEquals(Boolean.TRUE.toString(), frame.getHeader(ManagementHelper.HDR_OPERATION_SUCCEEDED.toString()));
+      // there is no such messages => 0 returned in a JSON array
+      Assert.assertEquals("[0]", frame.getBody());
+
+      unsubscribe(conn, null);
+
+      conn.disconnect();
+   }
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3a8552df/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/StompTestBase.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/StompTestBase.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/StompTestBase.java
index bcac436..dbe2762 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/StompTestBase.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/StompTestBase.java
@@ -314,20 +314,20 @@ public abstract class StompTestBase extends ActiveMQTestBase {
 
    public ClientStompFrame subscribe(StompClientConnection conn,
                                      String subscriptionId) throws IOException, InterruptedException {
-      return subscribe(conn, subscriptionId, Stomp.Headers.Subscribe.AckModeValues.AUTO, null, null);
+      return subscribe(conn, subscriptionId, Stomp.Headers.Subscribe.AckModeValues.AUTO);
    }
 
    public ClientStompFrame subscribe(StompClientConnection conn,
                                      String subscriptionId,
                                      String ack) throws IOException, InterruptedException {
-      return subscribe(conn, subscriptionId, ack, null, null);
+      return subscribe(conn, subscriptionId, ack, null);
    }
 
    public ClientStompFrame subscribe(StompClientConnection conn,
                                      String subscriptionId,
                                      String ack,
                                      String durableId) throws IOException, InterruptedException {
-      return subscribe(conn, subscriptionId, ack, durableId, null);
+      return subscribe(conn, subscriptionId, ack, durableId, false);
    }
 
    public ClientStompFrame subscribe(StompClientConnection conn,


[04/48] activemq-artemis git commit: Fix PersistenceTest

Posted by jb...@apache.org.
Fix PersistenceTest


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

Branch: refs/heads/ARTEMIS-780
Commit: 20a4616e8c3223ce780134b123a12a32b57be21a
Parents: 74a3738
Author: jbertram <jb...@apache.com>
Authored: Mon Nov 14 13:00:10 2016 -0600
Committer: jbertram <jb...@apache.com>
Committed: Tue Nov 15 10:36:42 2016 -0600

----------------------------------------------------------------------
 .../artemis/core/postoffice/impl/SimpleAddressManager.java       | 1 -
 .../artemis/core/server/impl/AutoCreatedQueueManagerImpl.java    | 4 ++--
 2 files changed, 2 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/20a4616e/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/SimpleAddressManager.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/SimpleAddressManager.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/SimpleAddressManager.java
index bfdfb8a..6ed2564 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/SimpleAddressManager.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/SimpleAddressManager.java
@@ -29,7 +29,6 @@ import org.apache.activemq.artemis.core.postoffice.Binding;
 import org.apache.activemq.artemis.core.postoffice.Bindings;
 import org.apache.activemq.artemis.core.postoffice.BindingsFactory;
 import org.apache.activemq.artemis.core.server.ActiveMQMessageBundle;
-import org.apache.activemq.artemis.core.server.ActiveMQServerLogger;
 import org.apache.activemq.artemis.core.server.impl.AddressInfo;
 import org.apache.activemq.artemis.core.transaction.Transaction;
 import org.jboss.logging.Logger;

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/20a4616e/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/AutoCreatedQueueManagerImpl.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/AutoCreatedQueueManagerImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/AutoCreatedQueueManagerImpl.java
index 55fb765..a211a96 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/AutoCreatedQueueManagerImpl.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/AutoCreatedQueueManagerImpl.java
@@ -33,14 +33,14 @@ public class AutoCreatedQueueManagerImpl implements AutoCreatedQueueManager {
    private final Runnable runnable = new Runnable() {
       @Override
       public void run() {
-         // TODO check auto created and deleteOnNoConsumers
          Queue queue = server.locateQueue(queueName);
          SimpleString address = queue.getAddress();
          AddressSettings settings = server.getAddressSettingsRepository().getMatch(address.toString());
          long consumerCount = queue.getConsumerCount();
          long messageCount = queue.getMessageCount();
 
-         if (queue.getMessageCount() == 0) {
+         // TODO make sure this is the right check
+         if ((queue.isAutoCreated() || queue.isDeleteOnNoConsumers()) && queue.getMessageCount() == 0) {
             if (ActiveMQServerLogger.LOGGER.isDebugEnabled()) {
                ActiveMQServerLogger.LOGGER.debug("deleting auto-created queue \"" + queueName + ".\" consumerCount = " + consumerCount + "; messageCount = " + messageCount + "; getAutoDeleteJmsQueues = " + settings.getAutoDeleteJmsQueues());
             }


[24/48] activemq-artemis git commit: Fix OpenWire queue auto-creation failure

Posted by jb...@apache.org.
Fix OpenWire queue auto-creation failure


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

Branch: refs/heads/ARTEMIS-780
Commit: fccea4aa45e5f32f9baca1126fa492ed73c4967d
Parents: 493e999
Author: Howard Gao <ho...@gmail.com>
Authored: Fri Nov 11 19:40:36 2016 +0800
Committer: jbertram <jb...@apache.com>
Committed: Wed Nov 23 09:04:34 2016 -0600

----------------------------------------------------------------------
 .../protocol/openwire/OpenWireConnection.java   | 19 ++++++++--
 .../core/protocol/openwire/amq/AMQConsumer.java |  2 +-
 .../core/protocol/openwire/amq/AMQSession.java  | 40 ++++++++++++++++----
 .../protocol/openwire/util/OpenWireUtil.java    | 17 ---------
 4 files changed, 48 insertions(+), 30 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/fccea4aa/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireConnection.java
----------------------------------------------------------------------
diff --git a/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireConnection.java b/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireConnection.java
index 8dc0b34..cdc62fd 100644
--- a/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireConnection.java
+++ b/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireConnection.java
@@ -73,6 +73,7 @@ import org.apache.activemq.artemis.spi.core.protocol.AbstractRemotingConnection;
 import org.apache.activemq.artemis.spi.core.protocol.ConnectionEntry;
 import org.apache.activemq.artemis.spi.core.protocol.RemotingConnection;
 import org.apache.activemq.artemis.spi.core.remoting.Connection;
+import org.apache.activemq.artemis.utils.ConcurrentHashSet;
 import org.apache.activemq.artemis.utils.UUIDGenerator;
 import org.apache.activemq.command.ActiveMQDestination;
 import org.apache.activemq.command.ActiveMQMessage;
@@ -177,6 +178,8 @@ public class OpenWireConnection extends AbstractRemotingConnection implements Se
    private boolean useKeepAlive;
    private long maxInactivityDuration;
 
+   private final Set<SimpleString> knownDestinations = new ConcurrentHashSet<>();
+
    // TODO-NOW: check on why there are two connections created for every createConnection on the client.
    public OpenWireConnection(Connection connection,
                              ActiveMQServer server,
@@ -707,7 +710,7 @@ public class OpenWireConnection extends AbstractRemotingConnection implements Se
    public void addDestination(DestinationInfo info) throws Exception {
       ActiveMQDestination dest = info.getDestination();
       if (dest.isQueue()) {
-         SimpleString qName = OpenWireUtil.toCoreAddress(dest);
+         SimpleString qName = new SimpleString(dest.getPhysicalName());
          QueueBinding binding = (QueueBinding) server.getPostOffice().getBinding(qName);
          if (binding == null) {
             if (dest.isTemporary()) {
@@ -789,6 +792,14 @@ public class OpenWireConnection extends AbstractRemotingConnection implements Se
       checkInactivity();
    }
 
+   public void addKnownDestination(final SimpleString address) {
+      knownDestinations.add(address);
+   }
+
+   public boolean containsKnownDestination(final SimpleString address) {
+      return knownDestinations.contains(address);
+   }
+
    class SlowConsumerDetection implements SlowConsumerDetectionListener {
 
       @Override
@@ -845,7 +856,7 @@ public class OpenWireConnection extends AbstractRemotingConnection implements Se
    public void removeDestination(ActiveMQDestination dest) throws Exception {
       if (dest.isQueue()) {
          try {
-            server.destroyQueue(OpenWireUtil.toCoreAddress(dest));
+            server.destroyQueue(new SimpleString(dest.getPhysicalName()));
          } catch (ActiveMQNonExistentQueueException neq) {
             //this is ok, ActiveMQ 5 allows this and will actually do it quite often
             ActiveMQServerLogger.LOGGER.debug("queue never existed");
@@ -853,7 +864,7 @@ public class OpenWireConnection extends AbstractRemotingConnection implements Se
 
 
       } else {
-         Bindings bindings = server.getPostOffice().getBindingsForAddress(OpenWireUtil.toCoreAddress(dest));
+         Bindings bindings = server.getPostOffice().getBindingsForAddress(new SimpleString(dest.getPhysicalName()));
 
          for (Binding binding : bindings.getBindings()) {
             Queue b = (Queue) binding.getBindable();
@@ -883,7 +894,7 @@ public class OpenWireConnection extends AbstractRemotingConnection implements Se
     */
    private void validateDestination(ActiveMQDestination destination) throws Exception {
       if (destination.isQueue()) {
-         SimpleString physicalName = OpenWireUtil.toCoreAddress(destination);
+         SimpleString physicalName = new SimpleString(destination.getPhysicalName());
          BindingQueryResult result = server.bindingQuery(physicalName);
          if (!result.isExists() && !result.isAutoCreateJmsQueues()) {
             throw ActiveMQMessageBundle.BUNDLE.noSuchQueue(physicalName);

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/fccea4aa/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/amq/AMQConsumer.java
----------------------------------------------------------------------
diff --git a/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/amq/AMQConsumer.java b/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/amq/AMQConsumer.java
index 5603cb8..2f05f45 100644
--- a/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/amq/AMQConsumer.java
+++ b/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/amq/AMQConsumer.java
@@ -95,7 +95,7 @@ public class AMQConsumer {
          serverConsumer = session.getCoreSession().createConsumer(nativeId, queueName, null, info.isBrowser(), false, -1);
          serverConsumer.setlowConsumerDetection(slowConsumerDetectionListener);
       } else {
-         SimpleString queueName = OpenWireUtil.toCoreAddress(openwireDestination);
+         SimpleString queueName = new SimpleString(openwireDestination.getPhysicalName());
          try {
             session.getCoreServer().createQueue(queueName, queueName, null, true, false);
          } catch (ActiveMQQueueExistsException e) {

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/fccea4aa/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/amq/AMQSession.java
----------------------------------------------------------------------
diff --git a/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/amq/AMQSession.java b/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/amq/AMQSession.java
index 5cab686..35fd733 100644
--- a/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/amq/AMQSession.java
+++ b/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/amq/AMQSession.java
@@ -23,16 +23,16 @@ import java.util.concurrent.ScheduledExecutorService;
 import java.util.concurrent.atomic.AtomicBoolean;
 import java.util.concurrent.atomic.AtomicInteger;
 
-import org.apache.activemq.artemis.api.core.ActiveMQQueueExistsException;
 import org.apache.activemq.artemis.api.core.SimpleString;
 import org.apache.activemq.artemis.core.paging.PagingStore;
 import org.apache.activemq.artemis.core.postoffice.RoutingStatus;
 import org.apache.activemq.artemis.core.protocol.openwire.OpenWireConnection;
 import org.apache.activemq.artemis.core.protocol.openwire.OpenWireMessageConverter;
-import org.apache.activemq.artemis.core.protocol.openwire.util.OpenWireUtil;
 import org.apache.activemq.artemis.core.server.ActiveMQServer;
 import org.apache.activemq.artemis.core.server.ActiveMQServerLogger;
+import org.apache.activemq.artemis.core.server.BindingQueryResult;
 import org.apache.activemq.artemis.core.server.MessageReference;
+import org.apache.activemq.artemis.core.server.QueueQueryResult;
 import org.apache.activemq.artemis.core.server.ServerConsumer;
 import org.apache.activemq.artemis.core.server.ServerMessage;
 import org.apache.activemq.artemis.core.server.ServerSession;
@@ -145,11 +145,10 @@ public class AMQSession implements SessionCallback {
 
       for (ActiveMQDestination openWireDest : dests) {
          if (openWireDest.isQueue()) {
-            SimpleString queueName = OpenWireUtil.toCoreAddress(openWireDest);
-            try {
-               getCoreServer().createQueue(queueName, queueName, null, true, false);
-            } catch (ActiveMQQueueExistsException e) {
-               // ignore
+            SimpleString queueName = new SimpleString(openWireDest.getPhysicalName());
+
+            if (!checkAutoCreateQueue(queueName, openWireDest.isTemporary())) {
+               throw new InvalidDestinationException("Destination doesn't exist: " + queueName);
             }
          }
          AMQConsumer consumer = new AMQConsumer(this, openWireDest, info, scheduledPool);
@@ -162,6 +161,27 @@ public class AMQSession implements SessionCallback {
       return consumersList;
    }
 
+   private boolean checkAutoCreateQueue(SimpleString queueName, boolean isTemporary) throws Exception {
+      boolean hasQueue = true;
+      if (!connection.containsKnownDestination(queueName)) {
+
+         BindingQueryResult bindingQuery = server.bindingQuery(queueName);
+         QueueQueryResult queueBinding = server.queueQuery(queueName);
+
+         boolean isAutoCreate = bindingQuery.isExists() ? bindingQuery.isAutoCreateJmsQueues() : true;
+
+         if (!queueBinding.isExists()) {
+            if (isAutoCreate) {
+               server.createQueue(queueName, queueName, null, true, isTemporary);
+               connection.addKnownDestination(queueName);
+            } else {
+               hasQueue = false;
+            }
+         }
+      }
+      return hasQueue;
+   }
+
    public void start() {
 
       coreSession.start();
@@ -338,7 +358,7 @@ public class AMQSession implements SessionCallback {
       // We fillup addresses, pagingStores and we will throw failure if that's the case
       for (int i = 0; i < actualDestinations.length; i++) {
          ActiveMQDestination dest = actualDestinations[i];
-         addresses[i] = OpenWireUtil.toCoreAddress(dest);
+         addresses[i] = new SimpleString(dest.getPhysicalName());
          pagingStores[i] = server.getPagingManager().getPageStore(addresses[i]);
          if (pagingStores[i].getAddressFullMessagePolicy() == AddressFullMessagePolicy.FAIL && pagingStores[i].isFull()) {
             throw new ResourceAllocationException("Queue is full");
@@ -357,6 +377,10 @@ public class AMQSession implements SessionCallback {
             connection.getTransportConnection().setAutoRead(false);
          }
 
+         if (actualDestinations[i].isQueue()) {
+            checkAutoCreateQueue(new SimpleString(actualDestinations[i].getPhysicalName()), actualDestinations[i].isTemporary());
+         }
+
          RoutingStatus result = getCoreSession().send(coreMsg, false, actualDestinations[i].isTemporary());
 
          if (result == RoutingStatus.NO_BINDINGS && actualDestinations[i].isQueue()) {

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/fccea4aa/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/util/OpenWireUtil.java
----------------------------------------------------------------------
diff --git a/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/util/OpenWireUtil.java b/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/util/OpenWireUtil.java
index a6e7292..04bd6a3 100644
--- a/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/util/OpenWireUtil.java
+++ b/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/util/OpenWireUtil.java
@@ -18,7 +18,6 @@ package org.apache.activemq.artemis.core.protocol.openwire.util;
 
 import org.apache.activemq.artemis.api.core.ActiveMQBuffer;
 import org.apache.activemq.artemis.api.core.ActiveMQBuffers;
-import org.apache.activemq.artemis.api.core.SimpleString;
 import org.apache.activemq.artemis.core.server.ServerMessage;
 import org.apache.activemq.artemis.core.transaction.impl.XidImpl;
 import org.apache.activemq.command.ActiveMQDestination;
@@ -37,22 +36,6 @@ public class OpenWireUtil {
       return buffer;
    }
 
-   public static SimpleString toCoreAddress(ActiveMQDestination dest) {
-      if (dest.isQueue()) {
-         if (dest.isTemporary()) {
-            return new SimpleString(dest.getPhysicalName());
-         } else {
-            return new SimpleString(dest.getPhysicalName());
-         }
-      } else {
-         if (dest.isTemporary()) {
-            return new SimpleString(dest.getPhysicalName());
-         } else {
-            return new SimpleString(dest.getPhysicalName());
-         }
-      }
-   }
-
    /**
     * We convert the core address to an ActiveMQ Destination. We use the actual address on the message rather than the
     * destination set on the consumer because it maybe different and the JMS spec says that it should be what ever was


[17/48] activemq-artemis git commit: CLI

Posted by jb...@apache.org.
CLI


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

Branch: refs/heads/ARTEMIS-780
Commit: 6b441b745e609b3bed41124e98888ebf7384075f
Parents: bd4b7ce
Author: Martyn Taylor <mt...@redhat.com>
Authored: Wed Nov 16 15:22:41 2016 +0000
Committer: Martyn Taylor <mt...@redhat.com>
Committed: Wed Nov 16 15:24:45 2016 +0000

----------------------------------------------------------------------
 .../artemis/cli/commands/AbstractAction.java    |  62 ++++++++
 .../cli/commands/address/AddressAction.java     |  77 ---------
 .../cli/commands/address/CreateAddress.java     |  71 ++++++---
 .../cli/commands/address/DeleteAddress.java     |  28 ++--
 .../cli/commands/address/ShowAddress.java       |  84 ++++++++++
 .../artemis/cli/commands/queue/CreateQueue.java |  18 ++-
 .../artemis/cli/commands/queue/DeleteQueue.java |  20 ++-
 .../artemis/cli/commands/queue/QueueAction.java |  77 ---------
 .../ActiveMQAddressDoesNotExistException.java   |  31 ++++
 .../core/ActiveMQDeleteAddressException.java    |  31 ++++
 .../artemis/api/core/ActiveMQExceptionType.java |  12 ++
 .../core/management/ActiveMQServerControl.java  |  23 +++
 .../impl/ActiveMQServerControlImpl.java         |  47 +++++-
 .../artemis/core/postoffice/PostOffice.java     |   3 +
 .../core/postoffice/impl/PostOfficeImpl.java    |  57 +++++--
 .../core/server/ActiveMQMessageBundle.java      |  11 +-
 .../artemis/core/server/ActiveMQServer.java     |   9 ++
 .../activemq/artemis/core/server/Queue.java     |   2 -
 .../core/server/impl/ActiveMQServerImpl.java    |  87 ++++++-----
 .../artemis/core/server/impl/AddressInfo.java   |   4 +-
 .../artemis/core/server/impl/QueueImpl.java     |   6 +-
 .../integration/cli/AddressCommandTest.java     | 155 +++++++++++++++++++
 .../tests/integration/cli/QueueCommandTest.java |   7 +-
 .../ActiveMQServerControlUsingCoreTest.java     |  25 +++
 .../core/server/impl/fakes/FakePostOffice.java  |   6 +
 25 files changed, 691 insertions(+), 262 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b441b74/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/AbstractAction.java
----------------------------------------------------------------------
diff --git a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/AbstractAction.java b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/AbstractAction.java
new file mode 100644
index 0000000..b4dbba8
--- /dev/null
+++ b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/AbstractAction.java
@@ -0,0 +1,62 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.activemq.artemis.cli.commands;
+
+import io.airlift.airline.Option;
+import org.apache.activemq.artemis.api.core.client.ActiveMQClient;
+import org.apache.activemq.artemis.api.core.client.ClientMessage;
+import org.apache.activemq.artemis.api.core.client.ClientRequestor;
+import org.apache.activemq.artemis.api.core.client.ClientSession;
+import org.apache.activemq.artemis.api.core.client.ClientSessionFactory;
+import org.apache.activemq.artemis.api.core.client.ServerLocator;
+import org.apache.activemq.artemis.api.core.management.ManagementHelper;
+import org.apache.activemq.artemis.cli.commands.messages.ConnectionAbstract;
+import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
+
+public abstract class AbstractAction extends ConnectionAbstract {
+
+   public void performCoreManagement(ManagementCallback<ClientMessage> cb) throws Exception {
+
+      try (ActiveMQConnectionFactory factory = createConnectionFactory();
+         ServerLocator locator = factory.getServerLocator();
+           ClientSessionFactory sessionFactory = locator.createSessionFactory();
+           ClientSession session = sessionFactory.createSession(user, password, false, true, true, false, ActiveMQClient.DEFAULT_ACK_BATCH_SIZE)) {
+         session.start();
+         ClientRequestor requestor = new ClientRequestor(session, "activemq.management");
+         ClientMessage message = session.createMessage(false);
+
+         cb.setUpInvocation(message);
+
+         ClientMessage reply = requestor.request(message);
+
+         if (ManagementHelper.hasOperationSucceeded(reply)) {
+            cb.requestSuccessful(reply);
+         } else {
+            cb.requestFailed(reply);
+         }
+      }
+   }
+
+   public interface ManagementCallback<T> {
+
+      void setUpInvocation(T message) throws Exception;
+
+      void requestSuccessful(T reply) throws Exception;
+
+      void requestFailed(T reply) throws Exception;
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b441b74/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/address/AddressAction.java
----------------------------------------------------------------------
diff --git a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/address/AddressAction.java b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/address/AddressAction.java
deleted file mode 100644
index c2f1716..0000000
--- a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/address/AddressAction.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.activemq.artemis.cli.commands.address;
-
-import io.airlift.airline.Option;
-import org.apache.activemq.artemis.api.core.client.ActiveMQClient;
-import org.apache.activemq.artemis.api.core.client.ClientMessage;
-import org.apache.activemq.artemis.api.core.client.ClientRequestor;
-import org.apache.activemq.artemis.api.core.client.ClientSession;
-import org.apache.activemq.artemis.api.core.client.ClientSessionFactory;
-import org.apache.activemq.artemis.api.core.client.ServerLocator;
-import org.apache.activemq.artemis.api.core.management.ManagementHelper;
-import org.apache.activemq.artemis.cli.commands.messages.ConnectionAbstract;
-import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
-
-public abstract class AddressAction extends ConnectionAbstract {
-
-   @Option(name = "--name", description = "address name")
-   String name;
-
-   public void performCoreManagement(ManagementCallback<ClientMessage> cb) throws Exception {
-
-      try (ActiveMQConnectionFactory factory = createConnectionFactory();
-         ServerLocator locator = factory.getServerLocator();
-           ClientSessionFactory sessionFactory = locator.createSessionFactory();
-           ClientSession session = sessionFactory.createSession(user, password, false, true, true, false, ActiveMQClient.DEFAULT_ACK_BATCH_SIZE)) {
-         session.start();
-         ClientRequestor requestor = new ClientRequestor(session, "activemq.management");
-         ClientMessage message = session.createMessage(false);
-
-         cb.setUpInvocation(message);
-
-         ClientMessage reply = requestor.request(message);
-
-         if (ManagementHelper.hasOperationSucceeded(reply)) {
-            cb.requestSuccessful(reply);
-         } else {
-            cb.requestFailed(reply);
-         }
-      }
-   }
-
-   public void setName(String name) {
-      this.name = name;
-   }
-
-   public String getName() {
-      if (name == null) {
-         name = input("--name", "Please provide the destination name:", "");
-      }
-
-      return name;
-   }
-
-   public interface ManagementCallback<T> {
-
-      void setUpInvocation(T message) throws Exception;
-
-      void requestSuccessful(T reply) throws Exception;
-
-      void requestFailed(T reply) throws Exception;
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b441b74/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/address/CreateAddress.java
----------------------------------------------------------------------
diff --git a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/address/CreateAddress.java b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/address/CreateAddress.java
index 0474050..6c92dc6 100644
--- a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/address/CreateAddress.java
+++ b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/address/CreateAddress.java
@@ -21,52 +21,81 @@ import io.airlift.airline.Command;
 import io.airlift.airline.Option;
 import org.apache.activemq.artemis.api.core.client.ClientMessage;
 import org.apache.activemq.artemis.api.core.management.ManagementHelper;
+import org.apache.activemq.artemis.cli.commands.AbstractAction;
 import org.apache.activemq.artemis.cli.commands.ActionContext;
+import org.apache.activemq.artemis.core.server.impl.AddressInfo;
 
-@Command(name = "create", description = "create a queue or topic")
-public class CreateAddress extends AddressAction {
+@Command(name = "create", description = "create an address")
+public class CreateAddress extends AbstractAction {
 
-   @Option(name = "--address", description = "address of the core queue (default queue's name)")
-   String address;
+   @Option(name = "--name", description = "The name of this address")
+   String name;
 
-   @Option(name = "--durable", description = "whether the queue is durable or not (default false)")
-   boolean durable = false;
+   @Option(name = "--routingType", description = "The routing type of the address, options are 'anycast' or 'multicast', defaults to 1 = 'multicast'")
+   String routingType = "multicast";
 
-   @Option(name = "--autoCreateAddress", description = "auto create an address for this queue if one doesn't exist")
-   boolean autoCreateAddress = true;
+   @Option(name = "--defaultMaxConsumers", description = "Sets the default max consumers for any queues created under this address, default = -1 (no limit)")
+   int defaultMaxConsumers = -1;
+
+   @Option(name = "--defaultDeleteOnNoConsumers", description = "Sets the default delete on no consumers for any queues created under this address, default = false")
+   boolean defaultDeleteOnNoConsumers = false;
 
    @Override
    public Object execute(ActionContext context) throws Exception {
       super.execute(context);
-      createQueue(context);
+      createAddress(context);
       return null;
    }
 
-   public String getAddress() {
-      if (address == null || "".equals(address.trim())) {
-         address = getName();
-      }
-      return address.trim();
-   }
-
-   private void createQueue(final ActionContext context) throws Exception {
+   private void createAddress(final ActionContext context) throws Exception {
       performCoreManagement(new ManagementCallback<ClientMessage>() {
          @Override
          public void setUpInvocation(ClientMessage message) throws Exception {
-            String address = getAddress();
-            ManagementHelper.putOperationInvocation(message, "broker", "createQueue", address, getName(), durable);
+            ManagementHelper.putOperationInvocation(message, "broker", "createAddress", getName(), routingType, defaultDeleteOnNoConsumers, defaultMaxConsumers);
          }
 
          @Override
          public void requestSuccessful(ClientMessage reply) throws Exception {
-            context.out.println("Core queue " + getName() + " created successfully.");
+            context.out.println("Address " + getName() + " created successfully.");
          }
 
          @Override
          public void requestFailed(ClientMessage reply) throws Exception {
             String errMsg = (String) ManagementHelper.getResult(reply, String.class);
-            context.err.println("Failed to create queue " + getName() + ". Reason: " + errMsg);
+            context.err.println("Failed to create address " + getName() + ". Reason: " + errMsg);
          }
       });
    }
+
+   public void setName(String name) {
+      this.name = name;
+   }
+
+   public String getName() {
+      return name;
+   }
+
+   public String getRoutingType() {
+      return routingType;
+   }
+
+   public void setRoutingType(String routingType) {
+      this.routingType = routingType;
+   }
+
+   public int getDefaultMaxConsumers() {
+      return defaultMaxConsumers;
+   }
+
+   public void setDefaultMaxConsumers(int defaultMaxConsumers) {
+      this.defaultMaxConsumers = defaultMaxConsumers;
+   }
+
+   public boolean getDefaultDeleteOnNoConsumers() {
+      return defaultDeleteOnNoConsumers;
+   }
+
+   public void setDefaultDeleteOnNoConsumers(boolean defaultDeleteOnNoConsumers) {
+      this.defaultDeleteOnNoConsumers = defaultDeleteOnNoConsumers;
+   }
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b441b74/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/address/DeleteAddress.java
----------------------------------------------------------------------
diff --git a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/address/DeleteAddress.java b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/address/DeleteAddress.java
index d6ce7f6..36c9224 100644
--- a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/address/DeleteAddress.java
+++ b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/address/DeleteAddress.java
@@ -21,41 +21,47 @@ import io.airlift.airline.Command;
 import io.airlift.airline.Option;
 import org.apache.activemq.artemis.api.core.client.ClientMessage;
 import org.apache.activemq.artemis.api.core.management.ManagementHelper;
+import org.apache.activemq.artemis.cli.commands.AbstractAction;
 import org.apache.activemq.artemis.cli.commands.ActionContext;
 
 @Command(name = "delete", description = "delete a queue")
-public class DeleteAddress extends AddressAction {
+public class DeleteAddress extends AbstractAction {
 
-   @Option(name = "--removeConsumers", description = "whether deleting destination with consumers or not (default false)")
-   boolean removeConsumers = false;
-
-   @Option(name = "--autoDeleteAddress", description = "delete the address if this it's last last queue")
-   boolean autoDeleteAddress = false;
+   @Option(name = "--name", description = "The name of this address")
+   String name;
 
    @Override
    public Object execute(ActionContext context) throws Exception {
       super.execute(context);
-      deleteQueue(context);
+      deleteAddress(context);
       return null;
    }
 
-   private void deleteQueue(final ActionContext context) throws Exception {
+   private void deleteAddress(final ActionContext context) throws Exception {
       performCoreManagement(new ManagementCallback<ClientMessage>() {
          @Override
          public void setUpInvocation(ClientMessage message) throws Exception {
-            ManagementHelper.putOperationInvocation(message, "broker", "destroyQueue", getName(), removeConsumers);
+            ManagementHelper.putOperationInvocation(message, "broker", "deleteAddress", getName());
          }
 
          @Override
          public void requestSuccessful(ClientMessage reply) throws Exception {
-            context.out.println("Queue " + getName() + " deleted successfully.");
+            context.out.println("Address " + getName() + " deleted successfully.");
          }
 
          @Override
          public void requestFailed(ClientMessage reply) throws Exception {
             String errMsg = (String) ManagementHelper.getResult(reply, String.class);
-            context.err.println("Failed to delete queue " + getName() + ". Reason: " + errMsg);
+            context.err.println("Failed to delete address " + getName() + ". Reason: " + errMsg);
          }
       });
    }
+
+   public String getName() {
+      return name;
+   }
+
+   public void setName(String name) {
+      this.name = name;
+   }
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b441b74/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/address/ShowAddress.java
----------------------------------------------------------------------
diff --git a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/address/ShowAddress.java b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/address/ShowAddress.java
new file mode 100644
index 0000000..34331bb
--- /dev/null
+++ b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/address/ShowAddress.java
@@ -0,0 +1,84 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.activemq.artemis.cli.commands.address;
+
+import io.airlift.airline.Command;
+import io.airlift.airline.Option;
+import org.apache.activemq.artemis.api.core.client.ClientMessage;
+import org.apache.activemq.artemis.api.core.management.ManagementHelper;
+import org.apache.activemq.artemis.cli.commands.AbstractAction;
+import org.apache.activemq.artemis.cli.commands.ActionContext;
+
+@Command(name = "show", description = "delete a queue")
+public class ShowAddress extends AbstractAction {
+
+   @Option(name = "--name", description = "The name of this address")
+   String name;
+
+   @Option(name = "--bindings", description = "Shows the bindings for this address")
+   boolean bindings;
+
+   @Override
+   public Object execute(ActionContext context) throws Exception {
+      super.execute(context);
+      showAddress(context);
+      return null;
+   }
+
+   private void showAddress(final ActionContext context) throws Exception {
+      performCoreManagement(new ManagementCallback<ClientMessage>() {
+         @Override
+         public void setUpInvocation(ClientMessage message) throws Exception {
+            if (bindings) {
+               ManagementHelper.putOperationInvocation(message, "broker", "listBindingsForAddress", getName());
+            }
+            else {
+               ManagementHelper.putOperationInvocation(message, "broker", "getAddressInfo", getName());
+            }
+         }
+
+         @Override
+         public void requestSuccessful(ClientMessage reply) throws Exception {
+            String result = (String) ManagementHelper.getResult(reply, String.class);
+            context.out.println(result);
+         }
+
+         @Override
+         public void requestFailed(ClientMessage reply) throws Exception {
+            String errMsg = (String) ManagementHelper.getResult(reply, String.class);
+            context.err.println("Failed to show address " + getName() + ". Reason: " + errMsg);
+         }
+      });
+   }
+
+   public String getName() {
+      return name;
+   }
+
+   public void setName(String name) {
+      this.name = name;
+   }
+
+   public boolean isBindings() {
+      return bindings;
+   }
+
+   public void setBindings(boolean bindings) {
+      this.bindings = bindings;
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b441b74/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/queue/CreateQueue.java
----------------------------------------------------------------------
diff --git a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/queue/CreateQueue.java b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/queue/CreateQueue.java
index fba9369..76cea6e 100644
--- a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/queue/CreateQueue.java
+++ b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/queue/CreateQueue.java
@@ -22,9 +22,13 @@ import io.airlift.airline.Option;
 import org.apache.activemq.artemis.api.core.client.ClientMessage;
 import org.apache.activemq.artemis.api.core.management.ManagementHelper;
 import org.apache.activemq.artemis.cli.commands.ActionContext;
+import org.apache.activemq.artemis.cli.commands.AbstractAction;
 
 @Command(name = "create", description = "create a queue or topic")
-public class CreateQueue extends QueueAction {
+public class CreateQueue extends AbstractAction {
+
+   @Option(name = "--name", description = "queue name")
+   String name;
 
    @Option(name = "--filter", description = "queue's filter string (default null)")
    String filter = null;
@@ -98,4 +102,16 @@ public class CreateQueue extends QueueAction {
    public void setAddress(String address) {
       this.address = address;
    }
+
+   public void setName(String name) {
+      this.name = name;
+   }
+
+   public String getName() {
+      if (name == null) {
+         name = input("--name", "Please provide the destination name:", "");
+      }
+
+      return name;
+   }
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b441b74/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/queue/DeleteQueue.java
----------------------------------------------------------------------
diff --git a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/queue/DeleteQueue.java b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/queue/DeleteQueue.java
index 5d92e81..19d2e99 100644
--- a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/queue/DeleteQueue.java
+++ b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/queue/DeleteQueue.java
@@ -22,9 +22,13 @@ import io.airlift.airline.Option;
 import org.apache.activemq.artemis.api.core.client.ClientMessage;
 import org.apache.activemq.artemis.api.core.management.ManagementHelper;
 import org.apache.activemq.artemis.cli.commands.ActionContext;
+import org.apache.activemq.artemis.cli.commands.AbstractAction;
 
 @Command(name = "delete", description = "delete a queue")
-public class DeleteQueue extends QueueAction {
+public class DeleteQueue extends AbstractAction {
+
+   @Option(name = "--name", description = "queue name")
+   String name;
 
    @Option(name = "--removeConsumers", description = "whether deleting destination with consumers or not (default false)")
    boolean removeConsumers = false;
@@ -43,7 +47,7 @@ public class DeleteQueue extends QueueAction {
       performCoreManagement(new ManagementCallback<ClientMessage>() {
          @Override
          public void setUpInvocation(ClientMessage message) throws Exception {
-            ManagementHelper.putOperationInvocation(message, "broker", "destroyQueue", getName(), removeConsumers);
+            ManagementHelper.putOperationInvocation(message, "broker", "destroyQueue", getName(), removeConsumers, autoDeleteAddress);
          }
 
          @Override
@@ -66,4 +70,16 @@ public class DeleteQueue extends QueueAction {
    public void setAutoDeleteAddress(boolean autoDeleteAddress) {
       this.autoDeleteAddress = autoDeleteAddress;
    }
+
+   public void setName(String name) {
+      this.name = name;
+   }
+
+   public String getName() {
+      if (name == null) {
+         name = input("--name", "Please provide the destination name:", "");
+      }
+
+      return name;
+   }
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b441b74/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/queue/QueueAction.java
----------------------------------------------------------------------
diff --git a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/queue/QueueAction.java b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/queue/QueueAction.java
deleted file mode 100644
index dc839ef..0000000
--- a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/queue/QueueAction.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.activemq.artemis.cli.commands.queue;
-
-import io.airlift.airline.Option;
-import org.apache.activemq.artemis.api.core.client.ActiveMQClient;
-import org.apache.activemq.artemis.api.core.client.ClientMessage;
-import org.apache.activemq.artemis.api.core.client.ClientRequestor;
-import org.apache.activemq.artemis.api.core.client.ClientSession;
-import org.apache.activemq.artemis.api.core.client.ClientSessionFactory;
-import org.apache.activemq.artemis.api.core.client.ServerLocator;
-import org.apache.activemq.artemis.api.core.management.ManagementHelper;
-import org.apache.activemq.artemis.cli.commands.messages.ConnectionAbstract;
-import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
-
-public abstract class QueueAction extends ConnectionAbstract {
-
-   @Option(name = "--name", description = "queue name")
-   String name;
-
-   public void performCoreManagement(ManagementCallback<ClientMessage> cb) throws Exception {
-
-      try (ActiveMQConnectionFactory factory = createConnectionFactory();
-         ServerLocator locator = factory.getServerLocator();
-           ClientSessionFactory sessionFactory = locator.createSessionFactory();
-           ClientSession session = sessionFactory.createSession(user, password, false, true, true, false, ActiveMQClient.DEFAULT_ACK_BATCH_SIZE)) {
-         session.start();
-         ClientRequestor requestor = new ClientRequestor(session, "activemq.management");
-         ClientMessage message = session.createMessage(false);
-
-         cb.setUpInvocation(message);
-
-         ClientMessage reply = requestor.request(message);
-
-         if (ManagementHelper.hasOperationSucceeded(reply)) {
-            cb.requestSuccessful(reply);
-         } else {
-            cb.requestFailed(reply);
-         }
-      }
-   }
-
-   public void setName(String name) {
-      this.name = name;
-   }
-
-   public String getName() {
-      if (name == null) {
-         name = input("--name", "Please provide the destination name:", "");
-      }
-
-      return name;
-   }
-
-   public interface ManagementCallback<T> {
-
-      void setUpInvocation(T message) throws Exception;
-
-      void requestSuccessful(T reply) throws Exception;
-
-      void requestFailed(T reply) throws Exception;
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b441b74/artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/ActiveMQAddressDoesNotExistException.java
----------------------------------------------------------------------
diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/ActiveMQAddressDoesNotExistException.java b/artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/ActiveMQAddressDoesNotExistException.java
new file mode 100644
index 0000000..46a82b5
--- /dev/null
+++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/ActiveMQAddressDoesNotExistException.java
@@ -0,0 +1,31 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.activemq.artemis.api.core;
+
+/**
+ * An operation failed because an address exists on the server.
+ */
+public final class ActiveMQAddressDoesNotExistException extends ActiveMQException {
+
+   public ActiveMQAddressDoesNotExistException() {
+      super(ActiveMQExceptionType.ADDRESS_EXISTS);
+   }
+
+   public ActiveMQAddressDoesNotExistException(String msg) {
+      super(ActiveMQExceptionType.ADDRESS_EXISTS, msg);
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b441b74/artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/ActiveMQDeleteAddressException.java
----------------------------------------------------------------------
diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/ActiveMQDeleteAddressException.java b/artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/ActiveMQDeleteAddressException.java
new file mode 100644
index 0000000..9c80306
--- /dev/null
+++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/ActiveMQDeleteAddressException.java
@@ -0,0 +1,31 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.activemq.artemis.api.core;
+
+/**
+ * An operation failed because an address exists on the server.
+ */
+public final class ActiveMQDeleteAddressException extends ActiveMQException {
+
+   public ActiveMQDeleteAddressException() {
+      super(ActiveMQExceptionType.DELETE_ADDRESS_ERROR);
+   }
+
+   public ActiveMQDeleteAddressException(String msg) {
+      super(ActiveMQExceptionType.DELETE_ADDRESS_ERROR, msg);
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b441b74/artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/ActiveMQExceptionType.java
----------------------------------------------------------------------
diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/ActiveMQExceptionType.java b/artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/ActiveMQExceptionType.java
index 785dac3..64518ec 100644
--- a/artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/ActiveMQExceptionType.java
+++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/ActiveMQExceptionType.java
@@ -106,6 +106,12 @@ public enum ActiveMQExceptionType {
          return new ActiveMQSecurityException(msg);
       }
    },
+   ADDRESS_DOES_NOT_EXIST(106) {
+      @Override
+      public ActiveMQException createException(String msg) {
+         return new ActiveMQAddressDoesNotExistException(msg);
+      }
+   },
    ADDRESS_EXISTS(107) {
       @Override
       public ActiveMQException createException(String msg) {
@@ -231,6 +237,12 @@ public enum ActiveMQExceptionType {
       public ActiveMQException createException(String msg) {
          return new ActiveMQInvalidQueueConfiguration(msg);
       }
+   },
+   DELETE_ADDRESS_ERROR(217) {
+      @Override
+      public ActiveMQException createException(String msg) {
+         return new ActiveMQDeleteAddressException(msg);
+      }
    };
 
    private static final Map<Integer, ActiveMQExceptionType> TYPE_MAP;

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b441b74/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/ActiveMQServerControl.java
----------------------------------------------------------------------
diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/ActiveMQServerControl.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/ActiveMQServerControl.java
index 4384d54..0654dbf 100644
--- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/ActiveMQServerControl.java
+++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/ActiveMQServerControl.java
@@ -19,6 +19,8 @@ package org.apache.activemq.artemis.api.core.management;
 import javax.management.MBeanOperationInfo;
 import java.util.Map;
 
+import org.apache.activemq.artemis.api.core.ActiveMQAddressDoesNotExistException;
+
 /**
  * An ActiveMQServerControl is used to manage ActiveMQ Artemis servers.
  */
@@ -438,6 +440,13 @@ public interface ActiveMQServerControl {
                       @Parameter(name = "defaultDeleteOnNoConsumers", desc = "Whether or not a queue with this address is deleted when it has no consumers") boolean defaultDeleteOnNoConsumers,
                       @Parameter(name = "defaultMaxConsumers", desc = "The maximim number of consumer a queue with this address can have") int defaultMaxConsumers) throws Exception;
 
+
+   @Operation(desc = "create an address", impact = MBeanOperationInfo.ACTION)
+   void createAddress(@Parameter(name = "name", desc = "The name of the address") String name,
+                      @Parameter(name = "routingType", desc = "The routing type for the address either 'MULTICAST' or 'ANYCAST'") String routingType,
+                      @Parameter(name = "defaultDeleteOnNoConsumers", desc = "Whether or not a queue with this address is deleted when it has no consumers") boolean defaultDeleteOnNoConsumers,
+                      @Parameter(name = "defaultMaxConsumers", desc = "The maximim number of consumer a queue with this address can have") int defaultMaxConsumers) throws Exception;
+
    @Operation(desc = "delete an address", impact = MBeanOperationInfo.ACTION)
    void deleteAddress(@Parameter(name = "name", desc = "The name of the address") String name) throws Exception;
 
@@ -455,6 +464,7 @@ public interface ActiveMQServerControl {
    void createQueue(@Parameter(name = "address", desc = "Address of the queue") String address,
                     @Parameter(name = "name", desc = "Name of the queue") String name) throws Exception;
 
+
    /**
     * Create a queue.
     * <br>
@@ -556,6 +566,14 @@ public interface ActiveMQServerControl {
                      @Parameter(name = "removeConsumers", desc = "Remove consumers of this queue") boolean removeConsumers) throws Exception;
 
    /**
+    * Destroys the queue corresponding to the specified name and delete it's address if there are no other queues
+    */
+   @Operation(desc = "Destroy a queue", impact = MBeanOperationInfo.ACTION)
+   void destroyQueue(@Parameter(name = "name", desc = "Name of the queue to destroy") String name,
+                     @Parameter(name = "removeConsumers", desc = "Remove consumers of this queue") boolean removeConsumers, boolean autoDeleteAddress) throws Exception;
+
+
+   /**
     * Enables message counters for this server.
     */
    @Operation(desc = "Enable message counters", impact = MBeanOperationInfo.ACTION)
@@ -920,5 +938,10 @@ public interface ActiveMQServerControl {
 
    @Operation(desc = "List the Network Topology", impact = MBeanOperationInfo.INFO)
    String listNetworkTopology() throws Exception;
+
+   String getAddressInfo(String address) throws ActiveMQAddressDoesNotExistException;
+
+   @Operation(desc = "Get a list of bindings associated with an address", impact = MBeanOperationInfo.INFO)
+   String[] listBindingsForAddress(String address) throws Exception;
 }
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b441b74/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/ActiveMQServerControlImpl.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/ActiveMQServerControlImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/ActiveMQServerControlImpl.java
index f2a193f..c38b2cf 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/ActiveMQServerControlImpl.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/ActiveMQServerControlImpl.java
@@ -42,6 +42,7 @@ import java.util.Map.Entry;
 import java.util.Set;
 import java.util.concurrent.atomic.AtomicLong;
 
+import org.apache.activemq.artemis.api.core.ActiveMQAddressDoesNotExistException;
 import org.apache.activemq.artemis.api.core.SimpleString;
 import org.apache.activemq.artemis.api.core.TransportConfiguration;
 import org.apache.activemq.artemis.api.core.management.ActiveMQServerControl;
@@ -63,8 +64,10 @@ import org.apache.activemq.artemis.core.persistence.StorageManager;
 import org.apache.activemq.artemis.core.persistence.config.PersistedAddressSetting;
 import org.apache.activemq.artemis.core.persistence.config.PersistedRoles;
 import org.apache.activemq.artemis.core.postoffice.Binding;
+import org.apache.activemq.artemis.core.postoffice.Bindings;
 import org.apache.activemq.artemis.core.postoffice.DuplicateIDCache;
 import org.apache.activemq.artemis.core.postoffice.PostOffice;
+import org.apache.activemq.artemis.core.postoffice.QueueBinding;
 import org.apache.activemq.artemis.core.postoffice.impl.LocalQueueBinding;
 import org.apache.activemq.artemis.core.remoting.server.RemotingService;
 import org.apache.activemq.artemis.core.security.CheckType;
@@ -72,6 +75,7 @@ import org.apache.activemq.artemis.core.security.Role;
 import org.apache.activemq.artemis.core.server.ActiveMQMessageBundle;
 import org.apache.activemq.artemis.core.server.ActiveMQServer;
 import org.apache.activemq.artemis.core.server.ActiveMQServerLogger;
+import org.apache.activemq.artemis.core.server.BindingQueryResult;
 import org.apache.activemq.artemis.core.server.ConnectorServiceFactory;
 import org.apache.activemq.artemis.core.server.Consumer;
 import org.apache.activemq.artemis.core.server.JournalType;
@@ -563,13 +567,22 @@ public class ActiveMQServerControlImpl extends AbstractControl implements Active
 
       clearIO();
       try {
-         server.createOrUpdateAddressInfo(new AddressInfo(new SimpleString(name), AddressInfo.RoutingType.getType((byte)routingType), defaultDeleteOnNoConsumers, defaultMaxConsumers));
+         server.createAddressInfo(new AddressInfo(new SimpleString(name), AddressInfo.RoutingType.getType((byte) routingType), defaultDeleteOnNoConsumers, defaultMaxConsumers));
       } finally {
          blockOnIO();
       }
    }
 
    @Override
+   public void createAddress(@Parameter(name = "name", desc = "The name of the address") String name,
+                             @Parameter(name = "routingType", desc = "The routing type for the address either 'MULTICAST' or 'ANYCAST'") String routingType,
+                             @Parameter(name = "defaultDeleteOnNoConsumers", desc = "Whether or not a queue with this address is deleted when it has no consumers") boolean defaultDeleteOnNoConsumers,
+                             @Parameter(name = "defaultMaxConsumers", desc = "The maximim number of consumer a queue with this address can have") int defaultMaxConsumers) throws Exception {
+      AddressInfo.RoutingType rt = AddressInfo.RoutingType.valueOf(routingType.toUpperCase());
+      createAddress(name, rt.ordinal(), defaultDeleteOnNoConsumers, defaultMaxConsumers);
+   }
+
+   @Override
    public void deleteAddress(String name) throws Exception {
       checkStarted();
 
@@ -752,24 +765,52 @@ public class ActiveMQServerControlImpl extends AbstractControl implements Active
    }
 
    @Override
-   public void destroyQueue(final String name, final boolean removeConsumers) throws Exception {
+   public void destroyQueue(final String name, final boolean removeConsumers, final boolean autoDeleteAddress) throws Exception {
       checkStarted();
 
       clearIO();
       try {
          SimpleString queueName = new SimpleString(name);
-         server.destroyQueue(queueName, null, !removeConsumers, removeConsumers);
+         server.destroyQueue(queueName, null, !removeConsumers, removeConsumers, autoDeleteAddress);
       } finally {
          blockOnIO();
       }
    }
 
    @Override
+   public void destroyQueue(final String name, final boolean removeConsumers) throws Exception {
+      destroyQueue(name, removeConsumers, false);
+   }
+
+   @Override
    public void destroyQueue(final String name) throws Exception {
       destroyQueue(name, false);
    }
 
    @Override
+   public String getAddressInfo(String address) throws ActiveMQAddressDoesNotExistException {
+      AddressInfo addressInfo = server.getAddressInfo(SimpleString.toSimpleString(address));
+      if (addressInfo == null) {
+         throw ActiveMQMessageBundle.BUNDLE.addressDoesNotExist(SimpleString.toSimpleString(address));
+      }
+      else {
+         return addressInfo.toString();
+      }
+   }
+
+   @Override
+   public String[] listBindingsForAddress(String address) throws Exception {
+      Bindings bindings = server.getPostOffice().getBindingsForAddress(new SimpleString(address));
+      List<String> result = new ArrayList<>(bindings.getBindings().size());
+
+      int i = 0;
+      for (Binding binding : bindings.getBindings()) {
+
+      }
+      return (String[]) result.toArray();
+   }
+
+   @Override
    public int getConnectionCount() {
       checkStarted();
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b441b74/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/PostOffice.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/PostOffice.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/PostOffice.java
index f1225c1..48ec7db 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/PostOffice.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/PostOffice.java
@@ -16,6 +16,7 @@
  */
 package org.apache.activemq.artemis.core.postoffice;
 
+import java.util.List;
 import java.util.Map;
 import java.util.Set;
 
@@ -50,6 +51,8 @@ public interface PostOffice extends ActiveMQComponent {
 
    AddressInfo getAddressInfo(SimpleString address);
 
+   List<Queue> listQueuesForAddress(SimpleString address) throws Exception;
+
    void addBinding(Binding binding) throws Exception;
 
    Binding removeBinding(SimpleString uniqueName, Transaction tx, boolean deleteData) throws Exception;

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b441b74/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 52abcdb..3064363 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
@@ -54,6 +54,7 @@ import org.apache.activemq.artemis.core.postoffice.Bindings;
 import org.apache.activemq.artemis.core.postoffice.BindingsFactory;
 import org.apache.activemq.artemis.core.postoffice.DuplicateIDCache;
 import org.apache.activemq.artemis.core.postoffice.PostOffice;
+import org.apache.activemq.artemis.core.postoffice.QueueBinding;
 import org.apache.activemq.artemis.core.postoffice.QueueInfo;
 import org.apache.activemq.artemis.core.postoffice.RoutingStatus;
 import org.apache.activemq.artemis.core.server.ActiveMQMessageBundle;
@@ -131,6 +132,8 @@ public class PostOfficeImpl implements PostOffice, NotificationListener, Binding
 
    private final ActiveMQServer server;
 
+   private Object addressLock = new Object();
+
    public PostOfficeImpl(final ActiveMQServer server,
                          final StorageManager storageManager,
                          final PagingManager pagingManager,
@@ -420,39 +423,61 @@ public class PostOfficeImpl implements PostOffice, NotificationListener, Binding
 
    @Override
    public AddressInfo addAddressInfo(AddressInfo addressInfo) {
-      try {
-         managementService.registerAddress(addressInfo);
-      } catch (Exception e) {
-         e.printStackTrace();
+      synchronized (addressLock) {
+         try {
+            managementService.registerAddress(addressInfo);
+         } catch (Exception e) {
+            e.printStackTrace();
+         }
+         return addressManager.addAddressInfo(addressInfo);
       }
-      return addressManager.addAddressInfo(addressInfo);
    }
 
    @Override
    public AddressInfo addOrUpdateAddressInfo(AddressInfo addressInfo) {
-      try {
-         managementService.registerAddress(addressInfo);
-      } catch (Exception e) {
-         e.printStackTrace();
+      synchronized (addressLock) {
+         try {
+            managementService.registerAddress(addressInfo);
+         } catch (Exception e) {
+            e.printStackTrace();
+         }
+         return addressManager.addOrUpdateAddressInfo(addressInfo);
       }
-      return addressManager.addOrUpdateAddressInfo(addressInfo);
    }
 
    @Override
    public AddressInfo removeAddressInfo(SimpleString address) throws Exception {
-      Bindings bindingsForAddress = getBindingsForAddress(address);
-      if (bindingsForAddress.getBindings().size() > 0) {
-         throw new IllegalStateException("Address has bindings");
+      synchronized (addressLock) {
+         Bindings bindingsForAddress = getBindingsForAddress(address);
+         if (bindingsForAddress.getBindings().size() > 0) {
+            throw new IllegalStateException("Address has bindings");
+         }
+         managementService.unregisterAddress(address);
+         return addressManager.removeAddressInfo(address);
       }
-      managementService.unregisterAddress(address);
-      return addressManager.removeAddressInfo(address);
    }
 
    @Override
    public AddressInfo getAddressInfo(SimpleString addressName) {
-      return addressManager.getAddressInfo(addressName);
+      synchronized (addressLock) {
+         return addressManager.getAddressInfo(addressName);
+      }
    }
 
+   @Override
+   public List<Queue> listQueuesForAddress(SimpleString address) throws Exception {
+      Bindings bindingsForAddress = getBindingsForAddress(address);
+      List<Queue> queues = new ArrayList<>();
+      for (Binding b : bindingsForAddress.getBindings()) {
+         if (b instanceof QueueBinding) {
+            Queue q = ((QueueBinding) b).getQueue();
+            queues.add(q);
+         }
+      }
+      return queues;
+   }
+
+
    // TODO - needs to be synchronized to prevent happening concurrently with activate()
    // (and possible removeBinding and other methods)
    // Otherwise can have situation where createQueue comes in before failover, then failover occurs

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b441b74/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQMessageBundle.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQMessageBundle.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQMessageBundle.java
index a64e4fc..5d39df0 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQMessageBundle.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQMessageBundle.java
@@ -18,9 +18,12 @@ package org.apache.activemq.artemis.core.server;
 
 import java.io.File;
 
+import org.apache.activemq.artemis.api.core.ActiveMQAddressDoesNotExistException;
+import org.apache.activemq.artemis.api.core.ActiveMQAddressExistsException;
 import org.apache.activemq.artemis.api.core.ActiveMQAddressFullException;
 import org.apache.activemq.artemis.api.core.ActiveMQClusterSecurityException;
 import org.apache.activemq.artemis.api.core.ActiveMQConnectionTimedOutException;
+import org.apache.activemq.artemis.api.core.ActiveMQDeleteAddressException;
 import org.apache.activemq.artemis.api.core.ActiveMQDisconnectedException;
 import org.apache.activemq.artemis.api.core.ActiveMQDuplicateMetaDataException;
 import org.apache.activemq.artemis.api.core.ActiveMQException;
@@ -392,5 +395,11 @@ public interface ActiveMQMessageBundle {
    ActiveMQInvalidQueueConfiguration invalidQueueConfiguration(SimpleString address, SimpleString queueName, String queuePropertyName, Object expectedValue, Object actualValue);
 
    @Message(id = 119203, value = "Address Does Not Exist: {0}", format = Message.Format.MESSAGE_FORMAT)
-   ActiveMQInvalidQueueConfiguration addressDoesNotExist(SimpleString address);
+   ActiveMQAddressDoesNotExistException addressDoesNotExist(SimpleString address);
+
+   @Message(id = 119204, value = "Address already exists: {0}", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQAddressExistsException addressAlreadyExists(SimpleString address);
+
+   @Message(id = 119205, value = "Address {0} has bindings", format = Message.Format.MESSAGE_FORMAT)
+   ActiveMQDeleteAddressException addressHasBindings(SimpleString address);
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b441b74/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQServer.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQServer.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQServer.java
index 723ddf4..c45be50 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQServer.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQServer.java
@@ -22,6 +22,7 @@ import java.util.Set;
 import java.util.concurrent.ScheduledExecutorService;
 import java.util.concurrent.TimeUnit;
 
+import com.google.common.collect.Queues;
 import org.apache.activemq.artemis.api.core.SimpleString;
 import org.apache.activemq.artemis.core.config.BridgeConfiguration;
 import org.apache.activemq.artemis.core.config.Configuration;
@@ -114,6 +115,12 @@ public interface ActiveMQServer extends ActiveMQComponent {
     */
    ActiveMQServerControlImpl getActiveMQServerControl();
 
+   void destroyQueue(SimpleString queueName,
+                     SecurityAuth session,
+                     boolean checkConsumerCount,
+                     boolean removeConsumers,
+                     boolean autoDeleteAddress) throws Exception;
+
    void registerActivateCallback(ActivateCallback callback);
 
    void unregisterActivateCallback(ActivateCallback callback);
@@ -448,6 +455,8 @@ public interface ActiveMQServer extends ActiveMQComponent {
 
    AddressInfo putAddressInfoIfAbsent(AddressInfo addressInfo) throws Exception;
 
+   void createAddressInfo(AddressInfo addressInfo) throws Exception;
+
    AddressInfo createOrUpdateAddressInfo(AddressInfo addressInfo) throws Exception;
 
    void removeAddressInfo(SimpleString address) throws Exception;

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b441b74/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/Queue.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/Queue.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/Queue.java
index 0120a53..2b845d5 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/Queue.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/Queue.java
@@ -106,8 +106,6 @@ public interface Queue extends Bindable {
 
    void deleteQueue(boolean removeConsumers) throws Exception;
 
-   void deleteQueue(boolean removeConsumers, boolean autoDeleteAddress) throws Exception;
-
    void destroyPaging() throws Exception;
 
    long getMessageCount();

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b441b74/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
index 1e1424d..5ab6ef7 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
@@ -48,6 +48,7 @@ import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicInteger;
 
 import org.apache.activemq.artemis.api.config.ActiveMQDefaultConfiguration;
+import org.apache.activemq.artemis.api.core.ActiveMQDeleteAddressException;
 import org.apache.activemq.artemis.api.core.Pair;
 import org.apache.activemq.artemis.api.core.SimpleString;
 import org.apache.activemq.artemis.core.client.impl.ClientSessionFactoryImpl;
@@ -1555,7 +1556,7 @@ public class ActiveMQServerImpl implements ActiveMQServer {
    public void destroyQueue(final SimpleString queueName,
                             final SecurityAuth session,
                             final boolean checkConsumerCount) throws Exception {
-      destroyQueue(queueName, session, checkConsumerCount, false);
+      destroyQueue(queueName, session, checkConsumerCount, false, true);
    }
 
    @Override
@@ -1563,6 +1564,15 @@ public class ActiveMQServerImpl implements ActiveMQServer {
                             final SecurityAuth session,
                             final boolean checkConsumerCount,
                             final boolean removeConsumers) throws Exception {
+      destroyQueue(queueName, session, checkConsumerCount, removeConsumers, true);
+   }
+
+   @Override
+   public void destroyQueue(final SimpleString queueName,
+                            final SecurityAuth session,
+                            final boolean checkConsumerCount,
+                            final boolean removeConsumers,
+                            final boolean autoDeleteAddress) throws Exception {
       if (postOffice == null) {
          return;
       }
@@ -1596,6 +1606,14 @@ public class ActiveMQServerImpl implements ActiveMQServer {
 
       queue.deleteQueue(removeConsumers);
 
+      if (autoDeleteAddress && postOffice != null) {
+         try {
+            postOffice.removeAddressInfo(address);
+         } catch (ActiveMQDeleteAddressException e) {
+            // Could be thrown if the address has bindings or is not deletable.
+         }
+      }
+
       callPostQueueDeletionCallbacks(address, queueName);
    }
 
@@ -1870,7 +1888,6 @@ public class ActiveMQServerImpl implements ActiveMQServer {
       }
       this.executorFactory = new OrderedExecutorFactory(threadPool);
 
-
       if (serviceRegistry.getIOExecutorService() != null) {
          this.ioExecutorFactory = new OrderedExecutorFactory(serviceRegistry.getIOExecutorService());
       } else {
@@ -2036,15 +2053,15 @@ public class ActiveMQServerImpl implements ActiveMQServer {
       // Deploy any predefined queues
       deployQueuesFromConfiguration();
 
-      registerPostQueueDeletionCallback(new PostQueueDeletionCallback() {
-         // TODO delete auto-created addresses when queueCount == 0
-         @Override
-         public void callback(SimpleString address, SimpleString queueName) throws Exception {
-            if (getAddressInfo(address).isAutoCreated() && postOffice.getBindingsForAddress(address).getBindings().size() == 0) {
-               removeAddressInfo(address);
-            }
-         }
-      });
+      //      registerPostQueueDeletionCallback(new PostQueueDeletionCallback() {
+      //         // TODO delete auto-created addresses when queueCount == 0
+      //         @Override
+      //         public void callback(SimpleString address, SimpleString queueName) throws Exception {
+      //            if (getAddressInfo(address).isAutoCreated()) {
+      //               removeAddressInfo(address);
+      //            }
+      //         }
+      //      });
 
       // We need to call this here, this gives any dependent server a chance to deploy its own addresses
       // this needs to be done before clustering is fully activated
@@ -2251,6 +2268,13 @@ public class ActiveMQServerImpl implements ActiveMQServer {
    }
 
    @Override
+   public void createAddressInfo(AddressInfo addressInfo) throws Exception {
+      if (putAddressInfoIfAbsent(addressInfo) != null) {
+         throw ActiveMQMessageBundle.BUNDLE.addressAlreadyExists(addressInfo.getName());
+      }
+   }
+
+   @Override
    public AddressInfo createOrUpdateAddressInfo(AddressInfo addressInfo) throws Exception {
       AddressInfo result = postOffice.addOrUpdateAddressInfo(addressInfo);
 
@@ -2264,12 +2288,14 @@ public class ActiveMQServerImpl implements ActiveMQServer {
 
    @Override
    public void removeAddressInfo(SimpleString address) throws Exception {
-      postOffice.removeAddressInfo(address);
+      if (postOffice.removeAddressInfo(address) == null) {
+         throw ActiveMQMessageBundle.BUNDLE.addressDoesNotExist(address);
+      };
 
       // TODO: is this the right way to do this?
-//      long txID = storageManager.generateID();
-//      storageManager.deleteAddressBinding(txID, getAddressInfo(address).getID());
-//      storageManager.commitBindings(txID);
+      //      long txID = storageManager.generateID();
+      //      storageManager.deleteAddressBinding(txID, getAddressInfo(address).getID());
+      //      storageManager.commitBindings(txID);
 
    }
 
@@ -2292,18 +2318,7 @@ public class ActiveMQServerImpl implements ActiveMQServer {
                              final boolean ignoreIfExists,
                              final boolean transientQueue,
                              final boolean autoCreated) throws Exception {
-      return createQueue(addressName,
-                         queueName,
-                         filterString,
-                         user,
-                         durable,
-                         temporary,
-                         ignoreIfExists,
-                         transientQueue,
-                         autoCreated,
-                         null,
-                         null,
-                         true);
+      return createQueue(addressName, queueName, filterString, user, durable, temporary, ignoreIfExists, transientQueue, autoCreated, null, null, true);
    }
 
    @Override
@@ -2347,8 +2362,7 @@ public class ActiveMQServerImpl implements ActiveMQServer {
       if (info == null) {
          if (autoCreateAddress) {
             info = defaultAddressInfo;
-         }
-         else {
+         } else {
             throw ActiveMQMessageBundle.BUNDLE.addressDoesNotExist(addressName);
          }
       }
@@ -2356,24 +2370,13 @@ public class ActiveMQServerImpl implements ActiveMQServer {
       final boolean isDeleteOnNoConsumers = deleteOnNoConsumers == null ? info.isDefaultDeleteOnNoConsumers() : deleteOnNoConsumers;
       final int noMaxConsumers = maxConsumers == null ? info.getDefaultMaxQueueConsumers() : maxConsumers;
 
-      final QueueConfig queueConfig = queueConfigBuilder
-         .filter(filter)
-         .pagingManager(pagingManager)
-         .user(user)
-         .durable(durable)
-         .temporary(temporary)
-         .autoCreated(autoCreated)
-         .deleteOnNoConsumers(isDeleteOnNoConsumers)
-         .maxConsumers(noMaxConsumers)
-         .build();
+      final QueueConfig queueConfig = queueConfigBuilder.filter(filter).pagingManager(pagingManager).user(user).durable(durable).temporary(temporary).autoCreated(autoCreated).deleteOnNoConsumers(isDeleteOnNoConsumers).maxConsumers(noMaxConsumers).build();
       final Queue queue = queueFactory.createQueueWith(queueConfig);
 
       boolean addressAlreadyExists = true;
 
       if (postOffice.getAddressInfo(queue.getAddress()) == null) {
-         postOffice.addAddressInfo(new AddressInfo(queue.getAddress())
-                           .setRoutingType(AddressInfo.RoutingType.MULTICAST)
-                           .setDefaultMaxQueueConsumers(maxConsumers == null ? ActiveMQDefaultConfiguration.getDefaultMaxQueueConsumers() : maxConsumers));
+         postOffice.addAddressInfo(new AddressInfo(queue.getAddress()).setRoutingType(AddressInfo.RoutingType.MULTICAST).setDefaultMaxQueueConsumers(maxConsumers == null ? ActiveMQDefaultConfiguration.getDefaultMaxQueueConsumers() : maxConsumers));
          addressAlreadyExists = false;
       }
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b441b74/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/AddressInfo.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/AddressInfo.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/AddressInfo.java
index 6ad40fa..a92e8d3 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/AddressInfo.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/AddressInfo.java
@@ -31,6 +31,8 @@ public class AddressInfo {
 
    private boolean autoCreated = false;
 
+   private boolean deletable = false;
+
    public AddressInfo(SimpleString name) {
       this.name = name;
    }
@@ -85,7 +87,7 @@ public class AddressInfo {
    @Override
    public String toString() {
       StringBuffer buff = new StringBuffer();
-      buff.append("AddressInfo [name=" + name);
+      buff.append("Address [name=" + name);
       buff.append(", routingType=" + routingType);
       buff.append(", defaultMaxQueueConsumers=" + defaultMaxQueueConsumers);
       buff.append(", defaultDeleteOnNoConsumers=" + defaultDeleteOnNoConsumers);

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b441b74/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueImpl.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueImpl.java
index b9cb79f..f6da245 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueImpl.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueImpl.java
@@ -1420,11 +1420,6 @@ public class QueueImpl implements Queue {
 
    @Override
    public void deleteQueue(boolean removeConsumers) throws Exception {
-      deleteQueue(removeConsumers, false);
-   }
-
-   @Override
-   public void deleteQueue(boolean removeConsumers, boolean autoDeleteAddress) throws Exception {
       synchronized (this) {
          if (this.queueDestroyed)
             return;
@@ -1892,6 +1887,7 @@ public class QueueImpl implements Queue {
       return "QueueImpl[name=" + name.toString() + ", postOffice=" + this.postOffice + ", temp=" + this.temporary + "]@" + Integer.toHexString(System.identityHashCode(this));
    }
 
+
    private synchronized void internalAddTail(final MessageReference ref) {
       refAdded(ref);
       messageReferences.addTail(ref, getPriority(ref));

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b441b74/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cli/AddressCommandTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cli/AddressCommandTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cli/AddressCommandTest.java
new file mode 100644
index 0000000..9589f47
--- /dev/null
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cli/AddressCommandTest.java
@@ -0,0 +1,155 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.activemq.artemis.tests.integration.cli;
+
+import java.io.ByteArrayOutputStream;
+import java.io.PrintStream;
+import java.util.UUID;
+
+import org.apache.activemq.artemis.api.core.SimpleString;
+import org.apache.activemq.artemis.cli.commands.AbstractAction;
+import org.apache.activemq.artemis.cli.commands.ActionContext;
+import org.apache.activemq.artemis.cli.commands.address.CreateAddress;
+import org.apache.activemq.artemis.cli.commands.address.DeleteAddress;
+import org.apache.activemq.artemis.cli.commands.address.ShowAddress;
+import org.apache.activemq.artemis.cli.commands.queue.CreateQueue;
+import org.apache.activemq.artemis.cli.commands.queue.DeleteQueue;
+import org.apache.activemq.artemis.core.config.DivertConfiguration;
+import org.apache.activemq.artemis.core.server.Queue;
+import org.apache.activemq.artemis.core.server.impl.AddressInfo;
+import org.apache.activemq.artemis.tests.util.JMSTestBase;
+import org.junit.Before;
+import org.junit.Test;
+
+public class AddressCommandTest extends JMSTestBase {
+
+   //the command
+   private ByteArrayOutputStream output;
+   private ByteArrayOutputStream error;
+
+   @Before
+   @Override
+   public void setUp() throws Exception {
+      super.setUp();
+      this.output = new ByteArrayOutputStream(1024);
+      this.error = new ByteArrayOutputStream(1024);
+   }
+
+   @Test
+   public void testCreateAddress() throws Exception {
+      String address = "address";
+      CreateAddress command = new CreateAddress();
+      command.setName(address);
+      command.execute(new ActionContext(System.in, new PrintStream(output), new PrintStream(error)));
+      checkExecutionPassed(command);
+      assertNotNull(server.getAddressInfo(new SimpleString(address)));
+   }
+
+   @Test
+   public void testCreateAddressAlreadyExistsShowsError() throws Exception {
+      String address = "address";
+      CreateAddress command = new CreateAddress();
+      command.setName(address);
+      command.execute(new ActionContext(System.in, new PrintStream(output), new PrintStream(error)));
+      checkExecutionPassed(command);
+      assertNotNull(server.getAddressInfo(new SimpleString(address)));
+
+      command.execute(new ActionContext(System.in, new PrintStream(output), new PrintStream(error)));
+      checkExecutionFailure(command, "Address already exists");
+   }
+
+   @Test
+   public void testDeleteAddress() throws Exception {
+      String address = "address";
+      CreateAddress command = new CreateAddress();
+      command.setName(address);
+      command.execute(new ActionContext());
+      assertNotNull(server.getAddressInfo(new SimpleString(address)));
+
+      DeleteAddress deleteAddress = new DeleteAddress();
+      deleteAddress.setName(address);
+      deleteAddress.execute(new ActionContext(System.in, new PrintStream(output), new PrintStream(error)));
+      checkExecutionPassed(deleteAddress);
+      assertNull(server.getAddressInfo(new SimpleString(address)));
+   }
+
+   @Test
+   public void testDeleteAddressDoesNotExistsShowsError() throws Exception {
+      String address = "address";
+      DeleteAddress deleteAddress = new DeleteAddress();
+      deleteAddress.setName(address);
+      deleteAddress.execute(new ActionContext(System.in, new PrintStream(output), new PrintStream(error)));
+      checkExecutionFailure(deleteAddress, "Address Does Not Exist");
+   }
+
+   @Test
+   public void testShowAddress() throws Exception {
+      String address = "address";
+      CreateAddress command = new CreateAddress();
+      command.setName(address);
+      command.execute(new ActionContext());
+      assertNotNull(server.getAddressInfo(new SimpleString(address)));
+
+      ShowAddress showAddress = new ShowAddress();
+      showAddress.setName(address);
+      showAddress.execute(new ActionContext(System.in, new PrintStream(output), new PrintStream(error)));
+      System.out.println(output.toString());
+   }
+
+   @Test
+   public void testShowAddressDoesNotExist() throws Exception {
+      String address = "address";
+      ShowAddress showAddress = new ShowAddress();
+      showAddress.setName(address);
+      showAddress.execute(new ActionContext(System.in, new PrintStream(output), new PrintStream(error)));
+      checkExecutionFailure(showAddress, "Address Does Not Exist");
+   }
+
+   @Test
+   public void testShowAddressBindings() throws Exception {
+
+      // Create bindings
+      SimpleString address = new SimpleString("address");
+      server.createAddressInfo(new AddressInfo(address));
+      server.createQueue(address, new SimpleString("queue1"), null, true, false);
+      server.createQueue(address, new SimpleString("queue2"), null, true, false);
+      server.createQueue(address, new SimpleString("queue3"), null, true, false);
+
+      DivertConfiguration divertConfiguration = new DivertConfiguration();
+      divertConfiguration.setName(address.toString());
+      divertConfiguration.setAddress(address.toString());
+      server.deployDivert(divertConfiguration);
+
+      ShowAddress showAddress = new ShowAddress();
+      showAddress.setName(address.toString());
+      showAddress.setBindings(true);
+      showAddress.execute(new ActionContext(System.in, new PrintStream(output), new PrintStream(error)));
+      System.out.println(output.toString());
+   }
+
+   private void checkExecutionPassed(AbstractAction command) throws Exception {
+      String fullMessage = output.toString();
+      System.out.println("output: " + fullMessage);
+      assertTrue(fullMessage, fullMessage.contains("successfully"));
+   }
+
+   private void checkExecutionFailure(AbstractAction command, String message) throws Exception {
+      String fullMessage = error.toString();
+      System.out.println("error: " + fullMessage);
+      assertTrue(fullMessage, fullMessage.contains(message));
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b441b74/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cli/QueueCommandTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cli/QueueCommandTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cli/QueueCommandTest.java
index 9d63439..5d7a695 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cli/QueueCommandTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cli/QueueCommandTest.java
@@ -24,7 +24,7 @@ import org.apache.activemq.artemis.api.core.SimpleString;
 import org.apache.activemq.artemis.cli.commands.ActionContext;
 import org.apache.activemq.artemis.cli.commands.queue.CreateQueue;
 import org.apache.activemq.artemis.cli.commands.queue.DeleteQueue;
-import org.apache.activemq.artemis.cli.commands.queue.QueueAction;
+import org.apache.activemq.artemis.cli.commands.AbstractAction;
 import org.apache.activemq.artemis.core.server.Queue;
 import org.apache.activemq.artemis.core.server.impl.AddressInfo;
 import org.apache.activemq.artemis.tests.util.JMSTestBase;
@@ -209,17 +209,18 @@ public class QueueCommandTest extends JMSTestBase {
       delete.setRemoveConsumers(true);
       delete.setAutoDeleteAddress(true);
       delete.execute(new ActionContext(System.in, new PrintStream(output), new PrintStream(error)));
+
       checkExecutionPassed(command);
       assertNull(server.getAddressInfo(queueName));
    }
 
-   private void checkExecutionPassed(QueueAction command) throws Exception {
+   private void checkExecutionPassed(AbstractAction command) throws Exception {
       String fullMessage = output.toString();
       System.out.println("output: " + fullMessage);
       assertTrue(fullMessage, fullMessage.contains("successfully"));
    }
 
-   private void checkExecutionFailure(QueueAction command, String message) throws Exception {
+   private void checkExecutionFailure(AbstractAction command, String message) throws Exception {
       String fullMessage = error.toString();
       System.out.println("error: " + fullMessage);
       assertTrue(fullMessage, fullMessage.contains(message));

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b441b74/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlUsingCoreTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlUsingCoreTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlUsingCoreTest.java
index bac0784..2547bb6 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlUsingCoreTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlUsingCoreTest.java
@@ -16,6 +16,7 @@
  */
 package org.apache.activemq.artemis.tests.integration.management;
 
+import org.apache.activemq.artemis.api.core.ActiveMQAddressDoesNotExistException;
 import org.apache.activemq.artemis.api.core.management.ActiveMQServerControl;
 import org.apache.activemq.artemis.api.core.management.Parameter;
 import org.apache.activemq.artemis.api.core.management.ResourceNames;
@@ -104,6 +105,14 @@ public class ActiveMQServerControlUsingCoreTest extends ActiveMQServerControlTes
          }
 
          @Override
+         public void createAddress(@Parameter(name = "name", desc = "The name of the address") String name,
+                                   @Parameter(name = "routingType", desc = "The routing type for the address either 'MULTICAST' or 'ANYCAST'") String routingType,
+                                   @Parameter(name = "defaultDeleteOnNoConsumers", desc = "Whether or not a queue with this address is deleted when it has no consumers") boolean defaultDeleteOnNoConsumers,
+                                   @Parameter(name = "defaultMaxConsumers", desc = "The maximim number of consumer a queue with this address can have") int defaultMaxConsumers) throws Exception {
+            proxy.invokeOperation("createAddress", name, routingType, defaultDeleteOnNoConsumers, defaultMaxConsumers);
+         }
+
+         @Override
          public void deleteAddress(@Parameter(name = "name", desc = "The name of the address") String name) throws Exception {
             proxy.invokeOperation("deleteAddress", name);
          }
@@ -156,6 +165,12 @@ public class ActiveMQServerControlUsingCoreTest extends ActiveMQServerControlTes
          }
 
          @Override
+         public void destroyQueue(@Parameter(name = "name", desc = "Name of the queue to destroy") String name,
+                                  @Parameter(name = "removeConsumers", desc = "Remove consumers of this queue") boolean removeConsumers,
+                                  boolean autoDeleteAddress) throws Exception {
+         }
+
+         @Override
          public void disableMessageCounters() throws Exception {
             proxy.invokeOperation("disableMessageCounters");
          }
@@ -643,6 +658,16 @@ public class ActiveMQServerControlUsingCoreTest extends ActiveMQServerControlTes
          }
 
          @Override
+         public String getAddressInfo(String address) throws ActiveMQAddressDoesNotExistException {
+            return null;
+         }
+
+         @Override
+         public String[] listBindingsForAddress(String address) throws Exception {
+            return new String[0];
+         }
+
+         @Override
          public void removeAddressSettings(String addressMatch) throws Exception {
             proxy.invokeOperation("removeAddressSettings", addressMatch);
          }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b441b74/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/server/impl/fakes/FakePostOffice.java
----------------------------------------------------------------------
diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/server/impl/fakes/FakePostOffice.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/server/impl/fakes/FakePostOffice.java
index 35fe5cc..f2c844e 100644
--- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/server/impl/fakes/FakePostOffice.java
+++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/server/impl/fakes/FakePostOffice.java
@@ -16,6 +16,7 @@
  */
 package org.apache.activemq.artemis.tests.unit.core.server.impl.fakes;
 
+import java.util.List;
 import java.util.Map;
 import java.util.Set;
 
@@ -81,6 +82,11 @@ public class FakePostOffice implements PostOffice {
    }
 
    @Override
+   public List<Queue> listQueuesForAddress(SimpleString address) throws Exception {
+      return null;
+   }
+
+   @Override
    public void addBinding(final Binding binding) throws Exception {
 
    }


[33/48] activemq-artemis git commit: Fix examples

Posted by jb...@apache.org.
Fix examples


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

Branch: refs/heads/ARTEMIS-780
Commit: 07ab20018d29b7a76899e3b9bfb51f7e6f1d76af
Parents: b7e7492
Author: jbertram <jb...@apache.com>
Authored: Fri Nov 18 14:09:33 2016 -0600
Committer: jbertram <jb...@apache.com>
Committed: Wed Nov 23 09:04:35 2016 -0600

----------------------------------------------------------------------
 .../api/config/ActiveMQDefaultConfiguration.java  |  4 ++--
 .../api/core/management/ObjectNameBuilder.java    |  2 +-
 .../clustered-durable-subscription/readme.html    |  1 -
 .../ClusteredDurableSubscriptionExample.java      |  2 ++
 .../main/resources/activemq/server0/broker.xml    |  3 +--
 .../main/resources/activemq/server1/broker.xml    |  3 +--
 .../clustered/clustered-grouping/readme.html      |  2 --
 .../main/resources/activemq/server0/broker.xml    |  5 ++---
 .../main/resources/activemq/server1/broker.xml    |  5 ++---
 .../main/resources/activemq/server2/broker.xml    |  5 ++---
 .../main/resources/activemq/server0/broker.xml    |  3 +--
 .../main/resources/activemq/server1/broker.xml    |  3 +--
 .../clustered/clustered-queue/readme.html         |  1 -
 .../main/resources/activemq/server0/broker.xml    |  3 +--
 .../main/resources/activemq/server1/broker.xml    |  3 +--
 .../clustered-static-discovery-uri/readme.html    |  1 -
 .../main/resources/activemq/server0/broker.xml    |  2 +-
 .../main/resources/activemq/server1/broker.xml    |  2 +-
 .../main/resources/activemq/server2/broker.xml    |  2 +-
 .../main/resources/activemq/server3/broker.xml    |  2 +-
 .../clustered-static-discovery/readme.html        |  1 -
 .../main/resources/activemq/server0/broker.xml    |  3 +--
 .../main/resources/activemq/server1/broker.xml    |  3 +--
 .../main/resources/activemq/server2/broker.xml    |  3 +--
 .../main/resources/activemq/server3/broker.xml    |  3 +--
 .../clustered/clustered-static-oneway/readme.html |  1 -
 .../main/resources/activemq/server0/broker.xml    |  3 +--
 .../main/resources/activemq/server1/broker.xml    |  3 +--
 .../main/resources/activemq/server2/broker.xml    |  3 +--
 .../main/resources/activemq/server0/broker.xml    |  2 +-
 .../main/resources/activemq/server1/broker.xml    |  2 +-
 .../clustered/clustered-topic/readme.html         |  1 -
 .../main/resources/activemq/server0/broker.xml    |  3 +--
 .../main/resources/activemq/server1/broker.xml    |  3 +--
 .../main/resources/activemq/server0/broker.xml    |  5 ++---
 .../main/resources/activemq/server1/broker.xml    |  5 ++---
 .../clustered/symmetric-cluster/readme.html       |  1 -
 .../main/resources/activemq/server0/broker.xml    |  3 +--
 .../main/resources/activemq/server1/broker.xml    |  3 +--
 .../main/resources/activemq/server2/broker.xml    |  3 +--
 .../main/resources/activemq/server3/broker.xml    |  3 +--
 .../main/resources/activemq/server4/broker.xml    |  3 +--
 .../main/resources/activemq/server5/broker.xml    |  3 +--
 .../main/resources/activemq/server0/broker.xml    |  9 ++++-----
 .../main/resources/activemq/server1/broker.xml    |  9 ++++-----
 .../main/resources/activemq/server0/broker.xml    |  3 +--
 .../main/resources/activemq/server1/broker.xml    |  3 +--
 .../main/resources/activemq/server0/broker.xml    |  1 -
 .../main/resources/activemq/server1/broker.xml    |  1 -
 .../main/resources/activemq/server0/broker.xml    |  3 +--
 .../main/resources/activemq/server1/broker.xml    |  3 +--
 .../main/resources/activemq/server0/broker.xml    |  3 +--
 .../main/resources/activemq/server1/broker.xml    |  3 +--
 .../main/resources/activemq/server0/broker.xml    |  3 +--
 .../main/resources/activemq/server1/broker.xml    |  3 +--
 .../main/resources/activemq/server2/broker.xml    |  3 +--
 .../main/resources/activemq/server0/broker.xml    |  3 +--
 .../main/resources/activemq/server1/broker.xml    |  3 +--
 .../main/resources/activemq/server0/broker.xml    |  7 +++----
 .../main/resources/activemq/server1/broker.xml    |  3 +--
 .../main/resources/activemq/server0/broker.xml    |  3 +--
 .../main/resources/activemq/server1/broker.xml    |  3 +--
 .../main/resources/activemq/server0/broker.xml    | 10 +++++-----
 .../main/resources/activemq/server1/broker.xml    |  2 +-
 examples/features/standard/cdi/pom.xml            | 12 ++++++++++++
 .../main/resources/activemq/server0/broker.xml    |  6 +++---
 .../main/resources/activemq/server0/broker.xml    |  4 ++--
 .../main/resources/activemq/server0/broker.xml    | 18 +++++++++---------
 .../main/resources/activemq/server1/broker.xml    |  2 +-
 .../main/resources/activemq/server0/broker.xml    |  2 +-
 .../main/resources/activemq/server0/broker.xml    |  6 +++---
 .../main/resources/activemq/server0/broker.xml    |  2 +-
 .../main/resources/activemq/server0/broker.xml    |  2 +-
 .../main/resources/activemq/server0/broker.xml    |  2 +-
 .../main/resources/activemq/server1/broker.xml    |  2 +-
 .../main/resources/activemq/server0/broker.xml    |  2 +-
 .../main/resources/activemq/server0/broker.xml    |  2 +-
 .../artemis/jms/example/LargeMessageExample.java  |  2 +-
 .../main/resources/activemq/server0/broker.xml    |  4 ++--
 .../main/resources/activemq/server0/broker.xml    |  6 +++---
 .../artemis/jms/example/ManagementExample.java    | 10 ++++++----
 .../main/resources/activemq/server0/broker.xml    |  8 ++++----
 .../main/resources/activemq/server0/broker.xml    |  8 ++++----
 .../main/resources/activemq/server0/broker.xml    |  8 ++++----
 .../jms/example/PreacknowledgeExample.java        |  3 ++-
 .../main/resources/activemq/server0/broker.xml    |  4 ++--
 .../main/resources/activemq/server0/broker.xml    |  4 ++--
 .../main/resources/activemq/server0/broker.xml    |  4 ++--
 .../main/resources/activemq/server0/broker.xml    |  6 +++---
 .../main/resources/activemq/server0/broker.xml    |  6 +++---
 .../main/resources/activemq/server0/broker.xml    |  2 +-
 .../main/resources/activemq/server0/broker.xml    |  2 +-
 .../main/resources/activemq/server0/broker.xml    |  6 +++---
 .../main/resources/activemq/server0/broker.xml    |  4 ++--
 .../main/resources/activemq/server0/broker.xml    |  2 +-
 .../main/resources/activemq/server0/broker.xml    |  2 +-
 .../main/resources/activemq/server0/broker.xml    |  8 ++++----
 .../artemis/jms/example/ProtonCPPExample.java     |  3 ++-
 .../main/resources/activemq/server0/broker.xml    |  2 +-
 99 files changed, 164 insertions(+), 200 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/07ab2001/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/config/ActiveMQDefaultConfiguration.java
----------------------------------------------------------------------
diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/config/ActiveMQDefaultConfiguration.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/config/ActiveMQDefaultConfiguration.java
index 5511ab6..e6f3795 100644
--- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/config/ActiveMQDefaultConfiguration.java
+++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/config/ActiveMQDefaultConfiguration.java
@@ -162,8 +162,8 @@ public final class ActiveMQDefaultConfiguration {
    // the name of the address that consumers bind to receive management notifications
    private static SimpleString DEFAULT_MANAGEMENT_NOTIFICATION_ADDRESS = new SimpleString("activemq.notifications");
 
-   // The default address used for clustering
-   private static String DEFAULT_CLUSTER_ADDRESS = "jms";
+   // The default address used for clustering, empty string means all addresses
+   private static String DEFAULT_CLUSTER_ADDRESS = "";
 
    // Cluster username. It applies to all cluster configurations.
    private static String DEFAULT_CLUSTER_USER = "ACTIVEMQ.CLUSTER.ADMIN.USER";

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/07ab2001/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/ObjectNameBuilder.java
----------------------------------------------------------------------
diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/ObjectNameBuilder.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/ObjectNameBuilder.java
index 019996a..3bbd456 100644
--- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/ObjectNameBuilder.java
+++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/ObjectNameBuilder.java
@@ -165,7 +165,7 @@ public final class ObjectNameBuilder {
     * Returns the ObjectName used by JMSQueueControl.
     */
    public ObjectName getJMSQueueObjectName(final String name) throws Exception {
-      return createObjectName("Queue", name);
+      return getQueueObjectName(SimpleString.toSimpleString(name), SimpleString.toSimpleString(name));
    }
 
    /**

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/07ab2001/examples/features/clustered/clustered-durable-subscription/readme.html
----------------------------------------------------------------------
diff --git a/examples/features/clustered/clustered-durable-subscription/readme.html b/examples/features/clustered/clustered-durable-subscription/readme.html
index d50b2b2..c0a7b2e 100644
--- a/examples/features/clustered/clustered-durable-subscription/readme.html
+++ b/examples/features/clustered/clustered-durable-subscription/readme.html
@@ -50,7 +50,6 @@ under the License.
      <p>The cli create method will define this section by default if you use --clustered as a parameter</p>
      <pre class="prettyprint">
      <code>&lt;cluster-connection name="my-cluster"&gt;
-        &lt;address&gt;jms&lt;/address&gt;
         &lt;retry-interval&gt;500&lt;/retry-interval&gt;
         &lt;use-duplicate-detection&gt;true&lt;/use-duplicate-detection&gt;
         &lt;message-load-balancing&gt;STRICT&lt;/message-load-balancing&gt;

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/07ab2001/examples/features/clustered/clustered-durable-subscription/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredDurableSubscriptionExample.java
----------------------------------------------------------------------
diff --git a/examples/features/clustered/clustered-durable-subscription/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredDurableSubscriptionExample.java b/examples/features/clustered/clustered-durable-subscription/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredDurableSubscriptionExample.java
index 7935ce5..d9e61e7 100644
--- a/examples/features/clustered/clustered-durable-subscription/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredDurableSubscriptionExample.java
+++ b/examples/features/clustered/clustered-durable-subscription/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredDurableSubscriptionExample.java
@@ -124,6 +124,8 @@ public class ClusteredDurableSubscriptionExample {
          if (connection1 != null) {
             connection1.close();
          }
+
+         Thread.sleep(1000);
       }
    }
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/07ab2001/examples/features/clustered/clustered-durable-subscription/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/clustered/clustered-durable-subscription/src/main/resources/activemq/server0/broker.xml b/examples/features/clustered/clustered-durable-subscription/src/main/resources/activemq/server0/broker.xml
index 2bfaeae..880c184 100644
--- a/examples/features/clustered/clustered-durable-subscription/src/main/resources/activemq/server0/broker.xml
+++ b/examples/features/clustered/clustered-durable-subscription/src/main/resources/activemq/server0/broker.xml
@@ -68,7 +68,6 @@ under the License.
 
       <cluster-connections>
          <cluster-connection name="my-cluster">
-            <address>jms</address>
             <connector-ref>netty-connector</connector-ref>
             <retry-interval>500</retry-interval>
             <use-duplicate-detection>true</use-duplicate-detection>
@@ -82,7 +81,7 @@ under the License.
 
       <security-settings>
          <!--security for example queue-->
-         <security-setting match="jms.topic.exampleTopic">
+         <security-setting match="exampleTopic">
             <permission type="createDurableQueue" roles="guest"/>
             <permission type="deleteDurableQueue" roles="guest"/>
             <permission type="createNonDurableQueue" roles="guest"/>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/07ab2001/examples/features/clustered/clustered-durable-subscription/src/main/resources/activemq/server1/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/clustered/clustered-durable-subscription/src/main/resources/activemq/server1/broker.xml b/examples/features/clustered/clustered-durable-subscription/src/main/resources/activemq/server1/broker.xml
index 8134f27..3efae9e 100644
--- a/examples/features/clustered/clustered-durable-subscription/src/main/resources/activemq/server1/broker.xml
+++ b/examples/features/clustered/clustered-durable-subscription/src/main/resources/activemq/server1/broker.xml
@@ -67,7 +67,6 @@ under the License.
 
       <cluster-connections>
          <cluster-connection name="my-cluster">
-            <address>jms</address>
             <connector-ref>netty-connector</connector-ref>
             <retry-interval>500</retry-interval>
             <use-duplicate-detection>true</use-duplicate-detection>
@@ -81,7 +80,7 @@ under the License.
 
       <security-settings>
          <!--security for example queue-->
-         <security-setting match="jms.topic.exampleTopic">
+         <security-setting match="exampleTopic">
             <permission type="createDurableQueue" roles="guest"/>
             <permission type="deleteDurableQueue" roles="guest"/>
             <permission type="createNonDurableQueue" roles="guest"/>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/07ab2001/examples/features/clustered/clustered-grouping/readme.html
----------------------------------------------------------------------
diff --git a/examples/features/clustered/clustered-grouping/readme.html b/examples/features/clustered/clustered-grouping/readme.html
index 7bce8f2..e066ca9 100644
--- a/examples/features/clustered/clustered-grouping/readme.html
+++ b/examples/features/clustered/clustered-grouping/readme.html
@@ -37,7 +37,6 @@ under the License.
      <code>
        &lt;cluster-connections&gt;
           &lt;cluster-connection name="my-cluster"&gt;
-             &lt;address&gt;jms&lt;/address&gt;
              &lt;connector-ref>netty-connector&lt;/connector-ref>
              &lt;retry-interval&gt;500&lt;/retry-interval&gt;
              &lt;use-duplicate-detection&gt;true&lt;/use-duplicate-detection&gt;
@@ -60,7 +59,6 @@ under the License.
      <code>
        &lt;cluster-connections&gt;
           &lt;cluster-connection name="my-cluster"&gt;
-             &lt;address&gt;jms&lt;/address&gt;
              &lt;retry-interval&gt;500&lt;/retry-interval&gt;
              &lt;use-duplicate-detection&gt;true&lt;/use-duplicate-detection&gt;
              &lt;message-load-balancing&gt;STRICT&lt;/message-load-balancing&gt;

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/07ab2001/examples/features/clustered/clustered-grouping/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/clustered/clustered-grouping/src/main/resources/activemq/server0/broker.xml b/examples/features/clustered/clustered-grouping/src/main/resources/activemq/server0/broker.xml
index 4520059..07e2c81 100644
--- a/examples/features/clustered/clustered-grouping/src/main/resources/activemq/server0/broker.xml
+++ b/examples/features/clustered/clustered-grouping/src/main/resources/activemq/server0/broker.xml
@@ -69,7 +69,6 @@ under the License.
 
       <cluster-connections>
          <cluster-connection name="my-cluster">
-            <address>jms</address>
             <connector-ref>netty-connector</connector-ref>
             <retry-interval>500</retry-interval>
             <use-duplicate-detection>true</use-duplicate-detection>
@@ -81,7 +80,7 @@ under the License.
 
       <grouping-handler name="my-grouping-handler">
          <type>LOCAL</type>
-         <address>jms</address>
+         <address>exampleQueue</address>
          <timeout>5000</timeout>
          <group-timeout>-1</group-timeout>
          <reaper-period>30000</reaper-period>
@@ -91,7 +90,7 @@ under the License.
 
       <security-settings>
          <!--security for example queue-->
-         <security-setting match="jms.queue.exampleQueue">
+         <security-setting match="exampleQueue">
             <permission type="createDurableQueue" roles="guest"/>
             <permission type="deleteDurableQueue" roles="guest"/>
             <permission type="createNonDurableQueue" roles="guest"/>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/07ab2001/examples/features/clustered/clustered-grouping/src/main/resources/activemq/server1/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/clustered/clustered-grouping/src/main/resources/activemq/server1/broker.xml b/examples/features/clustered/clustered-grouping/src/main/resources/activemq/server1/broker.xml
index 4765f7a..0d681c8 100644
--- a/examples/features/clustered/clustered-grouping/src/main/resources/activemq/server1/broker.xml
+++ b/examples/features/clustered/clustered-grouping/src/main/resources/activemq/server1/broker.xml
@@ -68,7 +68,6 @@ under the License.
 
       <cluster-connections>
          <cluster-connection name="my-cluster">
-            <address>jms</address>
             <connector-ref>netty-connector</connector-ref>
             <retry-interval>500</retry-interval>
             <use-duplicate-detection>true</use-duplicate-detection>
@@ -80,7 +79,7 @@ under the License.
 
       <grouping-handler name="my-grouping-handler">
          <type>REMOTE</type>
-         <address>jms</address>
+         <address>exampleQueue</address>
          <timeout>5000</timeout>
       </grouping-handler>
 
@@ -88,7 +87,7 @@ under the License.
 
       <security-settings>
          <!--security for example queue-->
-         <security-setting match="jms.queue.exampleQueue">
+         <security-setting match="exampleQueue">
             <permission type="createDurableQueue" roles="guest"/>
             <permission type="deleteDurableQueue" roles="guest"/>
             <permission type="createNonDurableQueue" roles="guest"/>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/07ab2001/examples/features/clustered/clustered-grouping/src/main/resources/activemq/server2/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/clustered/clustered-grouping/src/main/resources/activemq/server2/broker.xml b/examples/features/clustered/clustered-grouping/src/main/resources/activemq/server2/broker.xml
index 16bf2eb..c3a637f 100644
--- a/examples/features/clustered/clustered-grouping/src/main/resources/activemq/server2/broker.xml
+++ b/examples/features/clustered/clustered-grouping/src/main/resources/activemq/server2/broker.xml
@@ -68,7 +68,6 @@ under the License.
 
       <cluster-connections>
          <cluster-connection name="my-cluster">
-            <address>jms</address>
             <connector-ref>netty-connector</connector-ref>
             <retry-interval>500</retry-interval>
             <use-duplicate-detection>true</use-duplicate-detection>
@@ -80,7 +79,7 @@ under the License.
 
       <grouping-handler name="my-grouping-handler">
          <type>REMOTE</type>
-         <address>jms</address>
+         <address>exampleQueue</address>
          <timeout>5000</timeout>
       </grouping-handler>
 
@@ -88,7 +87,7 @@ under the License.
 
       <security-settings>
          <!--security for example queue-->
-         <security-setting match="jms.queue.exampleQueue">
+         <security-setting match="exampleQueue">
             <permission type="createDurableQueue" roles="guest"/>
             <permission type="deleteDurableQueue" roles="guest"/>
             <permission type="createNonDurableQueue" roles="guest"/>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/07ab2001/examples/features/clustered/clustered-jgroups/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/clustered/clustered-jgroups/src/main/resources/activemq/server0/broker.xml b/examples/features/clustered/clustered-jgroups/src/main/resources/activemq/server0/broker.xml
index 17809e5..763f6aa 100644
--- a/examples/features/clustered/clustered-jgroups/src/main/resources/activemq/server0/broker.xml
+++ b/examples/features/clustered/clustered-jgroups/src/main/resources/activemq/server0/broker.xml
@@ -69,7 +69,6 @@ under the License.
 
       <cluster-connections>
          <cluster-connection name="my-cluster">
-            <address>jms</address>
             <connector-ref>netty-connector</connector-ref>
             <retry-interval>500</retry-interval>
             <use-duplicate-detection>true</use-duplicate-detection>
@@ -83,7 +82,7 @@ under the License.
 
       <security-settings>
          <!--security for example queue-->
-         <security-setting match="jms.queue.exampleQueue">
+         <security-setting match="exampleQueue">
             <permission type="createDurableQueue" roles="guest"/>
             <permission type="deleteDurableQueue" roles="guest"/>
             <permission type="createNonDurableQueue" roles="guest"/>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/07ab2001/examples/features/clustered/clustered-jgroups/src/main/resources/activemq/server1/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/clustered/clustered-jgroups/src/main/resources/activemq/server1/broker.xml b/examples/features/clustered/clustered-jgroups/src/main/resources/activemq/server1/broker.xml
index 267eae7..da3ffa3 100644
--- a/examples/features/clustered/clustered-jgroups/src/main/resources/activemq/server1/broker.xml
+++ b/examples/features/clustered/clustered-jgroups/src/main/resources/activemq/server1/broker.xml
@@ -68,7 +68,6 @@ under the License.
 
       <cluster-connections>
          <cluster-connection name="my-cluster">
-            <address>jms</address>
             <connector-ref>netty-connector</connector-ref>
             <retry-interval>500</retry-interval>
             <use-duplicate-detection>true</use-duplicate-detection>
@@ -82,7 +81,7 @@ under the License.
 
       <security-settings>
          <!--security for example queue-->
-         <security-setting match="jms.queue.exampleQueue">
+         <security-setting match="exampleQueue">
             <permission type="createDurableQueue" roles="guest"/>
             <permission type="deleteDurableQueue" roles="guest"/>
             <permission type="createNonDurableQueue" roles="guest"/>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/07ab2001/examples/features/clustered/clustered-queue/readme.html
----------------------------------------------------------------------
diff --git a/examples/features/clustered/clustered-queue/readme.html b/examples/features/clustered/clustered-queue/readme.html
index b5fce81..a39fc4c 100644
--- a/examples/features/clustered/clustered-queue/readme.html
+++ b/examples/features/clustered/clustered-queue/readme.html
@@ -40,7 +40,6 @@ under the License.
      and to load balance the messages between the nodes.</p>
      <pre class="prettyprint">
      <code>&lt;cluster-connection name="my-cluster"&gt;
-        &lt;address&gt;jms&lt;/address&gt;
         &lt;connector-ref>netty-connector&lt;/connector-ref>
         &lt;retry-interval&gt;500&lt;/retry-interval&gt;
         &lt;use-duplicate-detection&gt;true&lt;/use-duplicate-detection&gt;

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/07ab2001/examples/features/clustered/clustered-queue/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/clustered/clustered-queue/src/main/resources/activemq/server0/broker.xml b/examples/features/clustered/clustered-queue/src/main/resources/activemq/server0/broker.xml
index eb30a90..e0ee6e6 100644
--- a/examples/features/clustered/clustered-queue/src/main/resources/activemq/server0/broker.xml
+++ b/examples/features/clustered/clustered-queue/src/main/resources/activemq/server0/broker.xml
@@ -67,7 +67,6 @@ under the License.
 
       <cluster-connections>
          <cluster-connection name="my-cluster">
-            <address>jms</address>
             <connector-ref>netty-connector</connector-ref>
             <retry-interval>500</retry-interval>
             <use-duplicate-detection>true</use-duplicate-detection>
@@ -81,7 +80,7 @@ under the License.
 
       <security-settings>
          <!--security for example queue-->
-         <security-setting match="jms.queue.exampleQueue">
+         <security-setting match="exampleQueue">
             <permission type="createDurableQueue" roles="guest"/>
             <permission type="deleteDurableQueue" roles="guest"/>
             <permission type="createNonDurableQueue" roles="guest"/>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/07ab2001/examples/features/clustered/clustered-queue/src/main/resources/activemq/server1/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/clustered/clustered-queue/src/main/resources/activemq/server1/broker.xml b/examples/features/clustered/clustered-queue/src/main/resources/activemq/server1/broker.xml
index 531fed1..84a8014 100644
--- a/examples/features/clustered/clustered-queue/src/main/resources/activemq/server1/broker.xml
+++ b/examples/features/clustered/clustered-queue/src/main/resources/activemq/server1/broker.xml
@@ -68,7 +68,6 @@ under the License.
 
       <cluster-connections>
          <cluster-connection name="my-cluster">
-            <address>jms</address>
             <connector-ref>netty-connector</connector-ref>
             <retry-interval>500</retry-interval>
             <use-duplicate-detection>true</use-duplicate-detection>
@@ -82,7 +81,7 @@ under the License.
 
       <security-settings>
          <!--security for example queue-->
-         <security-setting match="jms.queue.exampleQueue">
+         <security-setting match="exampleQueue">
             <permission type="createDurableQueue" roles="guest"/>
             <permission type="deleteDurableQueue" roles="guest"/>
             <permission type="createNonDurableQueue" roles="guest"/>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/07ab2001/examples/features/clustered/clustered-static-discovery-uri/readme.html
----------------------------------------------------------------------
diff --git a/examples/features/clustered/clustered-static-discovery-uri/readme.html b/examples/features/clustered/clustered-static-discovery-uri/readme.html
index 88931b9..0dc1205 100644
--- a/examples/features/clustered/clustered-static-discovery-uri/readme.html
+++ b/examples/features/clustered/clustered-static-discovery-uri/readme.html
@@ -40,7 +40,6 @@ under the License.
      and to load balance the messages between the nodes.</p>
      <pre class="prettyprint">
      <code>&lt;cluster-connection name="my-cluster"&gt;
-        &lt;address&gt;jms&lt;/address&gt;
         &lt;connector-ref>netty-connector&lt;/connector-ref>
         &lt;retry-interval&gt;500&lt;/retry-interval&gt;
         &lt;use-duplicate-detection&gt;true&lt;/use-duplicate-detection&gt;

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/07ab2001/examples/features/clustered/clustered-static-discovery-uri/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/clustered/clustered-static-discovery-uri/src/main/resources/activemq/server0/broker.xml b/examples/features/clustered/clustered-static-discovery-uri/src/main/resources/activemq/server0/broker.xml
index be093ab..90ae4a1 100644
--- a/examples/features/clustered/clustered-static-discovery-uri/src/main/resources/activemq/server0/broker.xml
+++ b/examples/features/clustered/clustered-static-discovery-uri/src/main/resources/activemq/server0/broker.xml
@@ -56,7 +56,7 @@ under the License.
 
       <security-settings>
          <!--security for example queue-->
-         <security-setting match="jms.queue.exampleQueue">
+         <security-setting match="exampleQueue">
             <permission type="createDurableQueue" roles="guest"/>
             <permission type="deleteDurableQueue" roles="guest"/>
             <permission type="createNonDurableQueue" roles="guest"/>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/07ab2001/examples/features/clustered/clustered-static-discovery-uri/src/main/resources/activemq/server1/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/clustered/clustered-static-discovery-uri/src/main/resources/activemq/server1/broker.xml b/examples/features/clustered/clustered-static-discovery-uri/src/main/resources/activemq/server1/broker.xml
index fc3bb2d..5245e12 100644
--- a/examples/features/clustered/clustered-static-discovery-uri/src/main/resources/activemq/server1/broker.xml
+++ b/examples/features/clustered/clustered-static-discovery-uri/src/main/resources/activemq/server1/broker.xml
@@ -56,7 +56,7 @@ under the License.
 
       <security-settings>
          <!--security for example queue-->
-         <security-setting match="jms.queue.exampleQueue">
+         <security-setting match="exampleQueue">
             <permission type="createDurableQueue" roles="guest"/>
             <permission type="deleteDurableQueue" roles="guest"/>
             <permission type="createNonDurableQueue" roles="guest"/>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/07ab2001/examples/features/clustered/clustered-static-discovery-uri/src/main/resources/activemq/server2/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/clustered/clustered-static-discovery-uri/src/main/resources/activemq/server2/broker.xml b/examples/features/clustered/clustered-static-discovery-uri/src/main/resources/activemq/server2/broker.xml
index 608796f..5f3f611 100644
--- a/examples/features/clustered/clustered-static-discovery-uri/src/main/resources/activemq/server2/broker.xml
+++ b/examples/features/clustered/clustered-static-discovery-uri/src/main/resources/activemq/server2/broker.xml
@@ -52,7 +52,7 @@
 
       <security-settings>
          <!--security for example queue-->
-         <security-setting match="jms.queue.exampleQueue">
+         <security-setting match="exampleQueue">
             <permission type="createDurableQueue" roles="guest"/>
             <permission type="deleteDurableQueue" roles="guest"/>
             <permission type="createNonDurableQueue" roles="guest"/>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/07ab2001/examples/features/clustered/clustered-static-discovery-uri/src/main/resources/activemq/server3/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/clustered/clustered-static-discovery-uri/src/main/resources/activemq/server3/broker.xml b/examples/features/clustered/clustered-static-discovery-uri/src/main/resources/activemq/server3/broker.xml
index 950f8cd..53ce43f 100644
--- a/examples/features/clustered/clustered-static-discovery-uri/src/main/resources/activemq/server3/broker.xml
+++ b/examples/features/clustered/clustered-static-discovery-uri/src/main/resources/activemq/server3/broker.xml
@@ -53,7 +53,7 @@
 
       <security-settings>
          <!--security for example queue-->
-         <security-setting match="jms.queue.exampleQueue">
+         <security-setting match="exampleQueue">
             <permission type="createDurableQueue" roles="guest"/>
             <permission type="deleteDurableQueue" roles="guest"/>
             <permission type="createNonDurableQueue" roles="guest"/>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/07ab2001/examples/features/clustered/clustered-static-discovery/readme.html
----------------------------------------------------------------------
diff --git a/examples/features/clustered/clustered-static-discovery/readme.html b/examples/features/clustered/clustered-static-discovery/readme.html
index 88931b9..0dc1205 100644
--- a/examples/features/clustered/clustered-static-discovery/readme.html
+++ b/examples/features/clustered/clustered-static-discovery/readme.html
@@ -40,7 +40,6 @@ under the License.
      and to load balance the messages between the nodes.</p>
      <pre class="prettyprint">
      <code>&lt;cluster-connection name="my-cluster"&gt;
-        &lt;address&gt;jms&lt;/address&gt;
         &lt;connector-ref>netty-connector&lt;/connector-ref>
         &lt;retry-interval&gt;500&lt;/retry-interval&gt;
         &lt;use-duplicate-detection&gt;true&lt;/use-duplicate-detection&gt;

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/07ab2001/examples/features/clustered/clustered-static-discovery/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/clustered/clustered-static-discovery/src/main/resources/activemq/server0/broker.xml b/examples/features/clustered/clustered-static-discovery/src/main/resources/activemq/server0/broker.xml
index b1bfd11..25361f5 100644
--- a/examples/features/clustered/clustered-static-discovery/src/main/resources/activemq/server0/broker.xml
+++ b/examples/features/clustered/clustered-static-discovery/src/main/resources/activemq/server0/broker.xml
@@ -52,7 +52,6 @@ under the License.
 
       <cluster-connections>
          <cluster-connection name="my-cluster">
-            <address>jms</address>
             <connector-ref>netty-connector</connector-ref>
             <retry-interval>500</retry-interval>
             <use-duplicate-detection>true</use-duplicate-detection>
@@ -68,7 +67,7 @@ under the License.
 
       <security-settings>
          <!--security for example queue-->
-         <security-setting match="jms.queue.exampleQueue">
+         <security-setting match="exampleQueue">
             <permission type="createDurableQueue" roles="guest"/>
             <permission type="deleteDurableQueue" roles="guest"/>
             <permission type="createNonDurableQueue" roles="guest"/>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/07ab2001/examples/features/clustered/clustered-static-discovery/src/main/resources/activemq/server1/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/clustered/clustered-static-discovery/src/main/resources/activemq/server1/broker.xml b/examples/features/clustered/clustered-static-discovery/src/main/resources/activemq/server1/broker.xml
index 0412576..14cc4ca 100644
--- a/examples/features/clustered/clustered-static-discovery/src/main/resources/activemq/server1/broker.xml
+++ b/examples/features/clustered/clustered-static-discovery/src/main/resources/activemq/server1/broker.xml
@@ -52,7 +52,6 @@ under the License.
       <!-- Clustering configuration -->
       <cluster-connections>
          <cluster-connection name="my-cluster">
-            <address>jms</address>
             <connector-ref>netty-connector</connector-ref>
             <retry-interval>500</retry-interval>
             <use-duplicate-detection>true</use-duplicate-detection>
@@ -68,7 +67,7 @@ under the License.
 
       <security-settings>
          <!--security for example queue-->
-         <security-setting match="jms.queue.exampleQueue">
+         <security-setting match="exampleQueue">
             <permission type="createDurableQueue" roles="guest"/>
             <permission type="deleteDurableQueue" roles="guest"/>
             <permission type="createNonDurableQueue" roles="guest"/>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/07ab2001/examples/features/clustered/clustered-static-discovery/src/main/resources/activemq/server2/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/clustered/clustered-static-discovery/src/main/resources/activemq/server2/broker.xml b/examples/features/clustered/clustered-static-discovery/src/main/resources/activemq/server2/broker.xml
index 98b8f04..051de1e 100644
--- a/examples/features/clustered/clustered-static-discovery/src/main/resources/activemq/server2/broker.xml
+++ b/examples/features/clustered/clustered-static-discovery/src/main/resources/activemq/server2/broker.xml
@@ -49,7 +49,6 @@
       <!-- Clustering configuration -->
       <cluster-connections>
          <cluster-connection name="my-cluster">
-            <address>jms</address>
             <connector-ref>netty-connector</connector-ref>
             <retry-interval>500</retry-interval>
             <use-duplicate-detection>true</use-duplicate-detection>
@@ -65,7 +64,7 @@
 
       <security-settings>
          <!--security for example queue-->
-         <security-setting match="jms.queue.exampleQueue">
+         <security-setting match="exampleQueue">
             <permission type="createDurableQueue" roles="guest"/>
             <permission type="deleteDurableQueue" roles="guest"/>
             <permission type="createNonDurableQueue" roles="guest"/>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/07ab2001/examples/features/clustered/clustered-static-discovery/src/main/resources/activemq/server3/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/clustered/clustered-static-discovery/src/main/resources/activemq/server3/broker.xml b/examples/features/clustered/clustered-static-discovery/src/main/resources/activemq/server3/broker.xml
index 40bef87..15f0245 100644
--- a/examples/features/clustered/clustered-static-discovery/src/main/resources/activemq/server3/broker.xml
+++ b/examples/features/clustered/clustered-static-discovery/src/main/resources/activemq/server3/broker.xml
@@ -49,7 +49,6 @@
       <!-- Clustering configuration -->
       <cluster-connections>
          <cluster-connection name="my-cluster">
-            <address>jms</address>
             <connector-ref>netty-connector</connector-ref>
             <retry-interval>500</retry-interval>
             <use-duplicate-detection>true</use-duplicate-detection>
@@ -65,7 +64,7 @@
 
       <security-settings>
          <!--security for example queue-->
-         <security-setting match="jms.queue.exampleQueue">
+         <security-setting match="exampleQueue">
             <permission type="createDurableQueue" roles="guest"/>
             <permission type="deleteDurableQueue" roles="guest"/>
             <permission type="createNonDurableQueue" roles="guest"/>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/07ab2001/examples/features/clustered/clustered-static-oneway/readme.html
----------------------------------------------------------------------
diff --git a/examples/features/clustered/clustered-static-oneway/readme.html b/examples/features/clustered/clustered-static-oneway/readme.html
index 04334a5..e7fb935 100644
--- a/examples/features/clustered/clustered-static-oneway/readme.html
+++ b/examples/features/clustered/clustered-static-oneway/readme.html
@@ -46,7 +46,6 @@ under the License.
      <pre class="prettyprint">
      <code>
      &lt;cluster-connection name="my-cluster"&gt;
-        &lt;address&gt;jms&lt;/address&gt;
         &lt;connector-ref>netty-connector&lt;/connector-ref>
         &lt;retry-interval&gt;500&lt;/retry-interval&gt;
         &lt;use-duplicate-detection&gt;true&lt;/use-duplicate-detection&gt;

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/07ab2001/examples/features/clustered/clustered-static-oneway/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/clustered/clustered-static-oneway/src/main/resources/activemq/server0/broker.xml b/examples/features/clustered/clustered-static-oneway/src/main/resources/activemq/server0/broker.xml
index 3e86ed3..d17742f 100644
--- a/examples/features/clustered/clustered-static-oneway/src/main/resources/activemq/server0/broker.xml
+++ b/examples/features/clustered/clustered-static-oneway/src/main/resources/activemq/server0/broker.xml
@@ -49,7 +49,6 @@
 
       <cluster-connections>
          <cluster-connection name="my-cluster">
-            <address>jms</address>
             <connector-ref>netty-connector</connector-ref>
             <retry-interval>500</retry-interval>
             <use-duplicate-detection>true</use-duplicate-detection>
@@ -65,7 +64,7 @@
 
       <security-settings>
          <!--security for example queue-->
-         <security-setting match="jms.queue.exampleQueue">
+         <security-setting match="exampleQueue">
             <permission type="createDurableQueue" roles="guest"/>
             <permission type="deleteDurableQueue" roles="guest"/>
             <permission type="createNonDurableQueue" roles="guest"/>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/07ab2001/examples/features/clustered/clustered-static-oneway/src/main/resources/activemq/server1/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/clustered/clustered-static-oneway/src/main/resources/activemq/server1/broker.xml b/examples/features/clustered/clustered-static-oneway/src/main/resources/activemq/server1/broker.xml
index 1464ea9..38b513c 100644
--- a/examples/features/clustered/clustered-static-oneway/src/main/resources/activemq/server1/broker.xml
+++ b/examples/features/clustered/clustered-static-oneway/src/main/resources/activemq/server1/broker.xml
@@ -49,7 +49,6 @@
       <!-- Clustering configuration -->
       <cluster-connections>
          <cluster-connection name="my-cluster">
-            <address>jms</address>
             <connector-ref>netty-connector</connector-ref>
             <retry-interval>500</retry-interval>
             <use-duplicate-detection>true</use-duplicate-detection>
@@ -65,7 +64,7 @@
 
       <security-settings>
          <!--security for example queue-->
-         <security-setting match="jms.queue.exampleQueue">
+         <security-setting match="exampleQueue">
             <permission type="createDurableQueue" roles="guest"/>
             <permission type="deleteDurableQueue" roles="guest"/>
             <permission type="createNonDurableQueue" roles="guest"/>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/07ab2001/examples/features/clustered/clustered-static-oneway/src/main/resources/activemq/server2/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/clustered/clustered-static-oneway/src/main/resources/activemq/server2/broker.xml b/examples/features/clustered/clustered-static-oneway/src/main/resources/activemq/server2/broker.xml
index b1043f5..4ee7800 100644
--- a/examples/features/clustered/clustered-static-oneway/src/main/resources/activemq/server2/broker.xml
+++ b/examples/features/clustered/clustered-static-oneway/src/main/resources/activemq/server2/broker.xml
@@ -47,7 +47,6 @@
       <!-- Clustering configuration -->
       <cluster-connections>
          <cluster-connection name="my-cluster">
-            <address>jms</address>
             <connector-ref>netty-connector</connector-ref>
             <retry-interval>500</retry-interval>
             <use-duplicate-detection>true</use-duplicate-detection>
@@ -60,7 +59,7 @@
 
       <security-settings>
          <!--security for example queue-->
-         <security-setting match="jms.queue.exampleQueue">
+         <security-setting match="exampleQueue">
             <permission type="createDurableQueue" roles="guest"/>
             <permission type="deleteDurableQueue" roles="guest"/>
             <permission type="createNonDurableQueue" roles="guest"/>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/07ab2001/examples/features/clustered/clustered-topic-uri/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/clustered/clustered-topic-uri/src/main/resources/activemq/server0/broker.xml b/examples/features/clustered/clustered-topic-uri/src/main/resources/activemq/server0/broker.xml
index 546e2e6..7d147a3 100644
--- a/examples/features/clustered/clustered-topic-uri/src/main/resources/activemq/server0/broker.xml
+++ b/examples/features/clustered/clustered-topic-uri/src/main/resources/activemq/server0/broker.xml
@@ -75,7 +75,7 @@ under the License.
 
       <security-settings>
          <!--security for example queue-->
-         <security-setting match="jms.topic.exampleTopic">
+         <security-setting match="exampleTopic">
             <permission type="createDurableQueue" roles="guest"/>
             <permission type="deleteDurableQueue" roles="guest"/>
             <permission type="createNonDurableQueue" roles="guest"/>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/07ab2001/examples/features/clustered/clustered-topic-uri/src/main/resources/activemq/server1/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/clustered/clustered-topic-uri/src/main/resources/activemq/server1/broker.xml b/examples/features/clustered/clustered-topic-uri/src/main/resources/activemq/server1/broker.xml
index c7009f7..3140a06 100644
--- a/examples/features/clustered/clustered-topic-uri/src/main/resources/activemq/server1/broker.xml
+++ b/examples/features/clustered/clustered-topic-uri/src/main/resources/activemq/server1/broker.xml
@@ -73,7 +73,7 @@ under the License.
 
       <security-settings>
          <!--security for example queue-->
-         <security-setting match="jms.topic.exampleTopic">
+         <security-setting match="exampleTopic">
             <permission type="createDurableQueue" roles="guest"/>
             <permission type="deleteDurableQueue" roles="guest"/>
             <permission type="createNonDurableQueue" roles="guest"/>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/07ab2001/examples/features/clustered/clustered-topic/readme.html
----------------------------------------------------------------------
diff --git a/examples/features/clustered/clustered-topic/readme.html b/examples/features/clustered/clustered-topic/readme.html
index e46fca8..a36fd05 100644
--- a/examples/features/clustered/clustered-topic/readme.html
+++ b/examples/features/clustered/clustered-topic/readme.html
@@ -40,7 +40,6 @@ under the License.
      and to load balance the messages between the nodes.</p>
      <pre class="prettyprint">
      <code>&lt;cluster-connection name="my-cluster"&gt;
-        &lt;address&gt;jms&lt;/address&gt;
         &lt;retry-interval&gt;500&lt;/retry-interval&gt;
         &lt;use-duplicate-detection&gt;true&lt;/use-duplicate-detection&gt;
         &lt;message-load-balancing&gt;STRICT&lt;/message-load-balancing&gt;

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/07ab2001/examples/features/clustered/clustered-topic/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/clustered/clustered-topic/src/main/resources/activemq/server0/broker.xml b/examples/features/clustered/clustered-topic/src/main/resources/activemq/server0/broker.xml
index a4e8dde..0385356 100644
--- a/examples/features/clustered/clustered-topic/src/main/resources/activemq/server0/broker.xml
+++ b/examples/features/clustered/clustered-topic/src/main/resources/activemq/server0/broker.xml
@@ -69,7 +69,6 @@ under the License.
 
       <cluster-connections>
          <cluster-connection name="my-cluster">
-            <address>jms</address>
             <connector-ref>netty-connector</connector-ref>
             <retry-interval>500</retry-interval>
             <use-duplicate-detection>true</use-duplicate-detection>
@@ -83,7 +82,7 @@ under the License.
 
       <security-settings>
          <!--security for example queue-->
-         <security-setting match="jms.topic.exampleTopic">
+         <security-setting match="exampleTopic">
             <permission type="createDurableQueue" roles="guest"/>
             <permission type="deleteDurableQueue" roles="guest"/>
             <permission type="createNonDurableQueue" roles="guest"/>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/07ab2001/examples/features/clustered/clustered-topic/src/main/resources/activemq/server1/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/clustered/clustered-topic/src/main/resources/activemq/server1/broker.xml b/examples/features/clustered/clustered-topic/src/main/resources/activemq/server1/broker.xml
index 78beec3..f03fb5f 100644
--- a/examples/features/clustered/clustered-topic/src/main/resources/activemq/server1/broker.xml
+++ b/examples/features/clustered/clustered-topic/src/main/resources/activemq/server1/broker.xml
@@ -67,7 +67,6 @@ under the License.
 
       <cluster-connections>
          <cluster-connection name="my-cluster">
-            <address>jms</address>
             <connector-ref>netty-connector</connector-ref>
             <retry-interval>500</retry-interval>
             <use-duplicate-detection>true</use-duplicate-detection>
@@ -81,7 +80,7 @@ under the License.
 
       <security-settings>
          <!--security for example queue-->
-         <security-setting match="jms.topic.exampleTopic">
+         <security-setting match="exampleTopic">
             <permission type="createDurableQueue" roles="guest"/>
             <permission type="deleteDurableQueue" roles="guest"/>
             <permission type="createNonDurableQueue" roles="guest"/>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/07ab2001/examples/features/clustered/queue-message-redistribution/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/clustered/queue-message-redistribution/src/main/resources/activemq/server0/broker.xml b/examples/features/clustered/queue-message-redistribution/src/main/resources/activemq/server0/broker.xml
index 70ff4d4..6df9b2b 100644
--- a/examples/features/clustered/queue-message-redistribution/src/main/resources/activemq/server0/broker.xml
+++ b/examples/features/clustered/queue-message-redistribution/src/main/resources/activemq/server0/broker.xml
@@ -67,7 +67,6 @@ under the License.
 
       <cluster-connections>
          <cluster-connection name="my-cluster">
-            <address>jms</address>
             <connector-ref>netty-connector</connector-ref>
             <retry-interval>500</retry-interval>
             <use-duplicate-detection>true</use-duplicate-detection>
@@ -81,7 +80,7 @@ under the License.
 
       <security-settings>
          <!--security for example queue-->
-         <security-setting match="jms.queue.exampleQueue">
+         <security-setting match="exampleQueue">
             <permission type="createDurableQueue" roles="guest"/>
             <permission type="deleteDurableQueue" roles="guest"/>
             <permission type="createNonDurableQueue" roles="guest"/>
@@ -97,7 +96,7 @@ under the License.
          Setting it to a value > 0 means how long to wait before redistributing, if a consumer is closed
          then another one quickly recreated you might want to set it thus, to avoid unnecessary
          redistribution -->
-         <address-setting match="jms.#">
+         <address-setting match="#">
             <redistribution-delay>0</redistribution-delay>
          </address-setting>
       </address-settings>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/07ab2001/examples/features/clustered/queue-message-redistribution/src/main/resources/activemq/server1/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/clustered/queue-message-redistribution/src/main/resources/activemq/server1/broker.xml b/examples/features/clustered/queue-message-redistribution/src/main/resources/activemq/server1/broker.xml
index 6fc6f32..5fb5257 100644
--- a/examples/features/clustered/queue-message-redistribution/src/main/resources/activemq/server1/broker.xml
+++ b/examples/features/clustered/queue-message-redistribution/src/main/resources/activemq/server1/broker.xml
@@ -68,7 +68,6 @@ under the License.
 
       <cluster-connections>
          <cluster-connection name="my-cluster">
-            <address>jms</address>
             <connector-ref>netty-connector</connector-ref>
             <retry-interval>500</retry-interval>
             <use-duplicate-detection>true</use-duplicate-detection>
@@ -82,7 +81,7 @@ under the License.
 
       <security-settings>
          <!--security for example queue-->
-         <security-setting match="jms.queue.exampleQueue">
+         <security-setting match="exampleQueue">
             <permission type="createDurableQueue" roles="guest"/>
             <permission type="deleteDurableQueue" roles="guest"/>
             <permission type="createNonDurableQueue" roles="guest"/>
@@ -98,7 +97,7 @@ under the License.
          Setting it to a value > 0 means how long to wait before redistributing, if a consumer is closed
          then another one quickly recreated you might want to set it thus, to avoid unnecessary
          redistribution -->
-         <address-setting match="jms.#">
+         <address-setting match="#">
             <redistribution-delay>0</redistribution-delay>
          </address-setting>
       </address-settings>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/07ab2001/examples/features/clustered/symmetric-cluster/readme.html
----------------------------------------------------------------------
diff --git a/examples/features/clustered/symmetric-cluster/readme.html b/examples/features/clustered/symmetric-cluster/readme.html
index 043057d..78665d6 100644
--- a/examples/features/clustered/symmetric-cluster/readme.html
+++ b/examples/features/clustered/symmetric-cluster/readme.html
@@ -53,7 +53,6 @@ under the License.
      <pre class="prettyprint">
      <code>
    &lt;cluster-connection name="my-cluster"&gt;
-      &lt;address&gt;jms&lt;/address&gt;
       &lt;connector-ref>netty-connector&lt;/connector-ref>
 	   &lt;retry-interval&gt;500&lt;/retry-interval&gt;
 	   &lt;use-duplicate-detection&gt;true&lt;/use-duplicate-detection&gt;

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/07ab2001/examples/features/clustered/symmetric-cluster/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/clustered/symmetric-cluster/src/main/resources/activemq/server0/broker.xml b/examples/features/clustered/symmetric-cluster/src/main/resources/activemq/server0/broker.xml
index cd89de7..bce8855 100644
--- a/examples/features/clustered/symmetric-cluster/src/main/resources/activemq/server0/broker.xml
+++ b/examples/features/clustered/symmetric-cluster/src/main/resources/activemq/server0/broker.xml
@@ -71,7 +71,6 @@ under the License.
 
       <cluster-connections>
          <cluster-connection name="my-cluster">
-            <address>jms</address>
             <connector-ref>netty-connector</connector-ref>
             <retry-interval>500</retry-interval>
             <use-duplicate-detection>true</use-duplicate-detection>
@@ -85,7 +84,7 @@ under the License.
 
       <security-settings>
          <!-- Default JMS security -->
-         <security-setting match="jms.#">
+         <security-setting match="#">
             <permission type="createDurableQueue" roles="guest"/>
             <permission type="deleteDurableQueue" roles="guest"/>
             <permission type="createNonDurableQueue" roles="guest"/>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/07ab2001/examples/features/clustered/symmetric-cluster/src/main/resources/activemq/server1/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/clustered/symmetric-cluster/src/main/resources/activemq/server1/broker.xml b/examples/features/clustered/symmetric-cluster/src/main/resources/activemq/server1/broker.xml
index d95a1cd..a090399 100644
--- a/examples/features/clustered/symmetric-cluster/src/main/resources/activemq/server1/broker.xml
+++ b/examples/features/clustered/symmetric-cluster/src/main/resources/activemq/server1/broker.xml
@@ -69,7 +69,6 @@ under the License.
 
       <cluster-connections>
          <cluster-connection name="my-cluster">
-            <address>jms</address>
             <connector-ref>netty-connector</connector-ref>
             <retry-interval>500</retry-interval>
             <use-duplicate-detection>true</use-duplicate-detection>
@@ -83,7 +82,7 @@ under the License.
 
       <security-settings>
          <!-- Default JMS security -->
-         <security-setting match="jms.#">
+         <security-setting match="#">
             <permission type="createDurableQueue" roles="guest"/>
             <permission type="deleteDurableQueue" roles="guest"/>
             <permission type="createNonDurableQueue" roles="guest"/>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/07ab2001/examples/features/clustered/symmetric-cluster/src/main/resources/activemq/server2/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/clustered/symmetric-cluster/src/main/resources/activemq/server2/broker.xml b/examples/features/clustered/symmetric-cluster/src/main/resources/activemq/server2/broker.xml
index ef006fd..50f3d27 100644
--- a/examples/features/clustered/symmetric-cluster/src/main/resources/activemq/server2/broker.xml
+++ b/examples/features/clustered/symmetric-cluster/src/main/resources/activemq/server2/broker.xml
@@ -69,7 +69,6 @@ under the License.
 
       <cluster-connections>
          <cluster-connection name="my-cluster">
-            <address>jms</address>
             <connector-ref>netty-connector</connector-ref>
             <retry-interval>500</retry-interval>
             <use-duplicate-detection>true</use-duplicate-detection>
@@ -83,7 +82,7 @@ under the License.
 
       <security-settings>
          <!-- Default JMS security -->
-         <security-setting match="jms.#">
+         <security-setting match="#">
             <permission type="createDurableQueue" roles="guest"/>
             <permission type="deleteDurableQueue" roles="guest"/>
             <permission type="createNonDurableQueue" roles="guest"/>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/07ab2001/examples/features/clustered/symmetric-cluster/src/main/resources/activemq/server3/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/clustered/symmetric-cluster/src/main/resources/activemq/server3/broker.xml b/examples/features/clustered/symmetric-cluster/src/main/resources/activemq/server3/broker.xml
index a780ace..14b8535 100644
--- a/examples/features/clustered/symmetric-cluster/src/main/resources/activemq/server3/broker.xml
+++ b/examples/features/clustered/symmetric-cluster/src/main/resources/activemq/server3/broker.xml
@@ -69,7 +69,6 @@ under the License.
 
       <cluster-connections>
          <cluster-connection name="my-cluster">
-            <address>jms</address>
             <connector-ref>netty-connector</connector-ref>
             <retry-interval>500</retry-interval>
             <use-duplicate-detection>true</use-duplicate-detection>
@@ -83,7 +82,7 @@ under the License.
 
       <security-settings>
          <!-- Default JMS security -->
-         <security-setting match="jms.#">
+         <security-setting match="#">
             <permission type="createDurableQueue" roles="guest"/>
             <permission type="deleteDurableQueue" roles="guest"/>
             <permission type="createNonDurableQueue" roles="guest"/>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/07ab2001/examples/features/clustered/symmetric-cluster/src/main/resources/activemq/server4/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/clustered/symmetric-cluster/src/main/resources/activemq/server4/broker.xml b/examples/features/clustered/symmetric-cluster/src/main/resources/activemq/server4/broker.xml
index 20b622e..38a4202 100644
--- a/examples/features/clustered/symmetric-cluster/src/main/resources/activemq/server4/broker.xml
+++ b/examples/features/clustered/symmetric-cluster/src/main/resources/activemq/server4/broker.xml
@@ -68,7 +68,6 @@ under the License.
 
       <cluster-connections>
          <cluster-connection name="my-cluster">
-            <address>jms</address>
             <connector-ref>netty-connector</connector-ref>
             <retry-interval>500</retry-interval>
             <use-duplicate-detection>true</use-duplicate-detection>
@@ -82,7 +81,7 @@ under the License.
 
       <security-settings>
          <!-- Default JMS security -->
-         <security-setting match="jms.#">
+         <security-setting match="#">
             <permission type="createDurableQueue" roles="guest"/>
             <permission type="deleteDurableQueue" roles="guest"/>
             <permission type="createNonDurableQueue" roles="guest"/>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/07ab2001/examples/features/clustered/symmetric-cluster/src/main/resources/activemq/server5/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/clustered/symmetric-cluster/src/main/resources/activemq/server5/broker.xml b/examples/features/clustered/symmetric-cluster/src/main/resources/activemq/server5/broker.xml
index 033af43..b450f7b 100644
--- a/examples/features/clustered/symmetric-cluster/src/main/resources/activemq/server5/broker.xml
+++ b/examples/features/clustered/symmetric-cluster/src/main/resources/activemq/server5/broker.xml
@@ -68,7 +68,6 @@ under the License.
 
       <cluster-connections>
          <cluster-connection name="my-cluster">
-            <address>jms</address>
             <connector-ref>netty-connector</connector-ref>
             <retry-interval>500</retry-interval>
             <use-duplicate-detection>true</use-duplicate-detection>
@@ -82,7 +81,7 @@ under the License.
 
       <security-settings>
          <!-- Default JMS security -->
-         <security-setting match="jms.#">
+         <security-setting match="#">
             <permission type="createDurableQueue" roles="guest"/>
             <permission type="deleteDurableQueue" roles="guest"/>
             <permission type="createNonDurableQueue" roles="guest"/>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/07ab2001/examples/features/ha/colocated-failover-scale-down/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/ha/colocated-failover-scale-down/src/main/resources/activemq/server0/broker.xml b/examples/features/ha/colocated-failover-scale-down/src/main/resources/activemq/server0/broker.xml
index d5fcbf8..b3e052b 100644
--- a/examples/features/ha/colocated-failover-scale-down/src/main/resources/activemq/server0/broker.xml
+++ b/examples/features/ha/colocated-failover-scale-down/src/main/resources/activemq/server0/broker.xml
@@ -69,13 +69,12 @@ under the License.
 
       <cluster-connections>
          <cluster-connection name="my-cluster">
-            <address>jms</address>
             <connector-ref>netty-connector</connector-ref>
             <retry-interval>500</retry-interval>
             <!-- since the backup servers scale down we need a sensible setting here so the bridge will stop -->
             <reconnect-attempts>5</reconnect-attempts>
             <use-duplicate-detection>true</use-duplicate-detection>
-            <message-load-balancing>STRICT</message-load-balancing>
+            <message-load-balancing>OFF</message-load-balancing>
             <max-hops>1</max-hops>
             <discovery-group-ref discovery-group-name="my-discovery-group"/>
          </cluster-connection>
@@ -104,7 +103,7 @@ under the License.
 
       <security-settings>
          <!--security for example queue-->
-         <security-setting match="jms.queue.exampleQueue">
+         <security-setting match="exampleQueue">
             <permission type="createDurableQueue" roles="guest"/>
             <permission type="deleteDurableQueue" roles="guest"/>
             <permission type="createNonDurableQueue" roles="guest"/>
@@ -112,7 +111,7 @@ under the License.
             <permission type="consume" roles="guest"/>
             <permission type="send" roles="guest"/>
          </security-setting>
-         <security-setting match="jms.queue.activemq.management.#">
+         <security-setting match="activemq.management.#">
             <permission type="createDurableQueue" roles="guest"/>
             <permission type="deleteDurableQueue" roles="guest"/>
             <permission type="createNonDurableQueue" roles="guest"/>
@@ -120,7 +119,7 @@ under the License.
             <permission type="consume" roles="guest"/>
             <permission type="send" roles="guest"/>
          </security-setting>
-         <security-setting match="jms.queue.activemq.management">
+         <security-setting match="activemq.management">
             <permission type="manage" roles="guest"/>
          </security-setting>
       </security-settings>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/07ab2001/examples/features/ha/colocated-failover-scale-down/src/main/resources/activemq/server1/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/ha/colocated-failover-scale-down/src/main/resources/activemq/server1/broker.xml b/examples/features/ha/colocated-failover-scale-down/src/main/resources/activemq/server1/broker.xml
index d849b10..de6f79a 100644
--- a/examples/features/ha/colocated-failover-scale-down/src/main/resources/activemq/server1/broker.xml
+++ b/examples/features/ha/colocated-failover-scale-down/src/main/resources/activemq/server1/broker.xml
@@ -69,13 +69,12 @@ under the License.
 
       <cluster-connections>
          <cluster-connection name="my-cluster">
-            <address>jms</address>
             <connector-ref>netty-connector</connector-ref>
             <retry-interval>500</retry-interval>
             <!-- since the backup servers scale down we need a sensible setting here so the bridge will stop -->
             <reconnect-attempts>5</reconnect-attempts>
             <use-duplicate-detection>true</use-duplicate-detection>
-            <message-load-balancing>STRICT</message-load-balancing>
+            <message-load-balancing>OFF</message-load-balancing>
             <max-hops>1</max-hops>
             <discovery-group-ref discovery-group-name="my-discovery-group"/>
          </cluster-connection>
@@ -102,7 +101,7 @@ under the License.
 
       <security-settings>
          <!--security for example queue-->
-         <security-setting match="jms.queue.exampleQueue">
+         <security-setting match="exampleQueue">
             <permission type="createDurableQueue" roles="guest"/>
             <permission type="deleteDurableQueue" roles="guest"/>
             <permission type="createNonDurableQueue" roles="guest"/>
@@ -110,7 +109,7 @@ under the License.
             <permission type="consume" roles="guest"/>
             <permission type="send" roles="guest"/>
          </security-setting>
-         <security-setting match="jms.queue.activemq.management.#">
+         <security-setting match="activemq.management.#">
             <permission type="createDurableQueue" roles="guest"/>
             <permission type="deleteDurableQueue" roles="guest"/>
             <permission type="createNonDurableQueue" roles="guest"/>
@@ -118,7 +117,7 @@ under the License.
             <permission type="consume" roles="guest"/>
             <permission type="send" roles="guest"/>
          </security-setting>
-         <security-setting match="jms.queue.activemq.management">
+         <security-setting match="activemq.management">
             <permission type="manage" roles="guest"/>
          </security-setting>
       </security-settings>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/07ab2001/examples/features/ha/colocated-failover/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/ha/colocated-failover/src/main/resources/activemq/server0/broker.xml b/examples/features/ha/colocated-failover/src/main/resources/activemq/server0/broker.xml
index f569d39..c1d103f 100644
--- a/examples/features/ha/colocated-failover/src/main/resources/activemq/server0/broker.xml
+++ b/examples/features/ha/colocated-failover/src/main/resources/activemq/server0/broker.xml
@@ -67,7 +67,6 @@ under the License.
 
       <cluster-connections>
          <cluster-connection name="my-cluster">
-            <address>jms</address>
             <connector-ref>netty-connector</connector-ref>
             <retry-interval>500</retry-interval>
             <use-duplicate-detection>true</use-duplicate-detection>
@@ -100,7 +99,7 @@ under the License.
 
       <security-settings>
          <!--security for example queue-->
-         <security-setting match="jms.queue.exampleQueue">
+         <security-setting match="exampleQueue">
             <permission type="createDurableQueue" roles="guest"/>
             <permission type="deleteDurableQueue" roles="guest"/>
             <permission type="createNonDurableQueue" roles="guest"/>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/07ab2001/examples/features/ha/colocated-failover/src/main/resources/activemq/server1/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/ha/colocated-failover/src/main/resources/activemq/server1/broker.xml b/examples/features/ha/colocated-failover/src/main/resources/activemq/server1/broker.xml
index 71015e5..0a33683 100644
--- a/examples/features/ha/colocated-failover/src/main/resources/activemq/server1/broker.xml
+++ b/examples/features/ha/colocated-failover/src/main/resources/activemq/server1/broker.xml
@@ -67,7 +67,6 @@ under the License.
 
       <cluster-connections>
          <cluster-connection name="my-cluster">
-            <address>jms</address>
             <connector-ref>netty-connector</connector-ref>
             <retry-interval>500</retry-interval>
             <use-duplicate-detection>true</use-duplicate-detection>
@@ -100,7 +99,7 @@ under the License.
 
       <security-settings>
          <!--security for example queue-->
-         <security-setting match="jms.queue.exampleQueue">
+         <security-setting match="exampleQueue">
             <permission type="createDurableQueue" roles="guest"/>
             <permission type="deleteDurableQueue" roles="guest"/>
             <permission type="createNonDurableQueue" roles="guest"/>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/07ab2001/examples/features/ha/ha-policy-autobackup/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/ha/ha-policy-autobackup/src/main/resources/activemq/server0/broker.xml b/examples/features/ha/ha-policy-autobackup/src/main/resources/activemq/server0/broker.xml
index db98aa0..7d6b0a1 100644
--- a/examples/features/ha/ha-policy-autobackup/src/main/resources/activemq/server0/broker.xml
+++ b/examples/features/ha/ha-policy-autobackup/src/main/resources/activemq/server0/broker.xml
@@ -77,7 +77,6 @@ under the License.
 
       <cluster-connections>
          <cluster-connection name="my-cluster">
-            <address>jms</address>
             <connector-ref>netty-connector</connector-ref>
             <retry-interval>500</retry-interval>
             <use-duplicate-detection>true</use-duplicate-detection>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/07ab2001/examples/features/ha/ha-policy-autobackup/src/main/resources/activemq/server1/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/ha/ha-policy-autobackup/src/main/resources/activemq/server1/broker.xml b/examples/features/ha/ha-policy-autobackup/src/main/resources/activemq/server1/broker.xml
index 760ce0d..435444b 100644
--- a/examples/features/ha/ha-policy-autobackup/src/main/resources/activemq/server1/broker.xml
+++ b/examples/features/ha/ha-policy-autobackup/src/main/resources/activemq/server1/broker.xml
@@ -77,7 +77,6 @@ under the License.
 
       <cluster-connections>
          <cluster-connection name="my-cluster">
-            <address>jms</address>
             <connector-ref>netty-connector</connector-ref>
             <retry-interval>500</retry-interval>
             <use-duplicate-detection>true</use-duplicate-detection>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/07ab2001/examples/features/ha/replicated-failback-static/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/ha/replicated-failback-static/src/main/resources/activemq/server0/broker.xml b/examples/features/ha/replicated-failback-static/src/main/resources/activemq/server0/broker.xml
index f6fa349..d7bdaec 100644
--- a/examples/features/ha/replicated-failback-static/src/main/resources/activemq/server0/broker.xml
+++ b/examples/features/ha/replicated-failback-static/src/main/resources/activemq/server0/broker.xml
@@ -62,7 +62,6 @@ under the License.
 
       <cluster-connections>
          <cluster-connection name="my-cluster">
-            <address>jms</address>
             <connector-ref>netty-connector</connector-ref>
             <static-connectors>
                <connector-ref>netty-backup-connector</connector-ref>
@@ -73,7 +72,7 @@ under the License.
 
       <security-settings>
          <!--security for example queue-->
-         <security-setting match="jms.queue.exampleQueue">
+         <security-setting match="exampleQueue">
             <permission type="createDurableQueue" roles="guest"/>
             <permission type="deleteDurableQueue" roles="guest"/>
             <permission type="createNonDurableQueue" roles="guest"/>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/07ab2001/examples/features/ha/replicated-failback-static/src/main/resources/activemq/server1/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/ha/replicated-failback-static/src/main/resources/activemq/server1/broker.xml b/examples/features/ha/replicated-failback-static/src/main/resources/activemq/server1/broker.xml
index 9b89d80..0ef447d 100644
--- a/examples/features/ha/replicated-failback-static/src/main/resources/activemq/server1/broker.xml
+++ b/examples/features/ha/replicated-failback-static/src/main/resources/activemq/server1/broker.xml
@@ -64,7 +64,6 @@ under the License.
 
       <cluster-connections>
          <cluster-connection name="my-cluster">
-            <address>jms</address>
             <connector-ref>netty-connector</connector-ref>
             <static-connectors>
                <connector-ref>netty-live-connector</connector-ref>
@@ -75,7 +74,7 @@ under the License.
 
       <security-settings>
          <!--security for example queue-->
-         <security-setting match="jms.queue.exampleQueue">
+         <security-setting match="exampleQueue">
             <permission type="createDurableQueue" roles="guest"/>
             <permission type="deleteDurableQueue" roles="guest"/>
             <permission type="createNonDurableQueue" roles="guest"/>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/07ab2001/examples/features/ha/replicated-failback/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/ha/replicated-failback/src/main/resources/activemq/server0/broker.xml b/examples/features/ha/replicated-failback/src/main/resources/activemq/server0/broker.xml
index c7f4783..089bb7b 100644
--- a/examples/features/ha/replicated-failback/src/main/resources/activemq/server0/broker.xml
+++ b/examples/features/ha/replicated-failback/src/main/resources/activemq/server0/broker.xml
@@ -78,7 +78,6 @@ under the License.
 
       <cluster-connections>
          <cluster-connection name="my-cluster">
-            <address>jms</address>
             <connector-ref>netty-connector</connector-ref>
             <discovery-group-ref discovery-group-name="dg-group1"/>
          </cluster-connection>
@@ -87,7 +86,7 @@ under the License.
 
       <security-settings>
          <!--security for example queue-->
-         <security-setting match="jms.queue.exampleQueue">
+         <security-setting match="exampleQueue">
             <permission type="createDurableQueue" roles="guest"/>
             <permission type="deleteDurableQueue" roles="guest"/>
             <permission type="createNonDurableQueue" roles="guest"/>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/07ab2001/examples/features/ha/replicated-failback/src/main/resources/activemq/server1/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/ha/replicated-failback/src/main/resources/activemq/server1/broker.xml b/examples/features/ha/replicated-failback/src/main/resources/activemq/server1/broker.xml
index da5a656..52aa733 100644
--- a/examples/features/ha/replicated-failback/src/main/resources/activemq/server1/broker.xml
+++ b/examples/features/ha/replicated-failback/src/main/resources/activemq/server1/broker.xml
@@ -79,7 +79,6 @@ under the License.
 
       <cluster-connections>
          <cluster-connection name="my-cluster">
-            <address>jms</address>
             <connector-ref>netty-connector</connector-ref>
             <discovery-group-ref discovery-group-name="dg-group1"/>
          </cluster-connection>
@@ -88,7 +87,7 @@ under the License.
 
       <security-settings>
          <!--security for example queue-->
-         <security-setting match="jms.queue.exampleQueue">
+         <security-setting match="exampleQueue">
             <permission type="createDurableQueue" roles="guest"/>
             <permission type="deleteDurableQueue" roles="guest"/>
             <permission type="createNonDurableQueue" roles="guest"/>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/07ab2001/examples/features/ha/replicated-multiple-failover/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/ha/replicated-multiple-failover/src/main/resources/activemq/server0/broker.xml b/examples/features/ha/replicated-multiple-failover/src/main/resources/activemq/server0/broker.xml
index 43f1693..f6e061b 100644
--- a/examples/features/ha/replicated-multiple-failover/src/main/resources/activemq/server0/broker.xml
+++ b/examples/features/ha/replicated-multiple-failover/src/main/resources/activemq/server0/broker.xml
@@ -72,7 +72,6 @@ under the License.
 
       <cluster-connections>
          <cluster-connection name="my-cluster">
-            <address>jms</address>
             <connector-ref>netty-connector</connector-ref>
             <discovery-group-ref discovery-group-name="dg-group1"/>
          </cluster-connection>
@@ -81,7 +80,7 @@ under the License.
 
       <security-settings>
          <!--security for example queue-->
-         <security-setting match="jms.queue.exampleQueue">
+         <security-setting match="exampleQueue">
             <permission type="createDurableQueue" roles="guest"/>
             <permission type="deleteDurableQueue" roles="guest"/>
             <permission type="createNonDurableQueue" roles="guest"/>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/07ab2001/examples/features/ha/replicated-multiple-failover/src/main/resources/activemq/server1/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/ha/replicated-multiple-failover/src/main/resources/activemq/server1/broker.xml b/examples/features/ha/replicated-multiple-failover/src/main/resources/activemq/server1/broker.xml
index 7f17fb8..5208153 100644
--- a/examples/features/ha/replicated-multiple-failover/src/main/resources/activemq/server1/broker.xml
+++ b/examples/features/ha/replicated-multiple-failover/src/main/resources/activemq/server1/broker.xml
@@ -72,7 +72,6 @@ under the License.
 
       <cluster-connections>
          <cluster-connection name="my-cluster">
-            <address>jms</address>
             <connector-ref>netty-connector</connector-ref>
             <discovery-group-ref discovery-group-name="dg-group1"/>
          </cluster-connection>
@@ -81,7 +80,7 @@ under the License.
 
       <security-settings>
          <!--security for example queue-->
-         <security-setting match="jms.queue.exampleQueue">
+         <security-setting match="exampleQueue">
             <permission type="createDurableQueue" roles="guest"/>
             <permission type="deleteDurableQueue" roles="guest"/>
             <permission type="createNonDurableQueue" roles="guest"/>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/07ab2001/examples/features/ha/replicated-multiple-failover/src/main/resources/activemq/server2/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/ha/replicated-multiple-failover/src/main/resources/activemq/server2/broker.xml b/examples/features/ha/replicated-multiple-failover/src/main/resources/activemq/server2/broker.xml
index c5f06cc..b43bd18 100644
--- a/examples/features/ha/replicated-multiple-failover/src/main/resources/activemq/server2/broker.xml
+++ b/examples/features/ha/replicated-multiple-failover/src/main/resources/activemq/server2/broker.xml
@@ -72,7 +72,6 @@ under the License.
 
       <cluster-connections>
          <cluster-connection name="my-cluster">
-            <address>jms</address>
             <connector-ref>netty-connector</connector-ref>
             <discovery-group-ref discovery-group-name="dg-group1"/>
          </cluster-connection>
@@ -81,7 +80,7 @@ under the License.
 
       <security-settings>
          <!--security for example queue-->
-         <security-setting match="jms.queue.exampleQueue">
+         <security-setting match="exampleQueue">
             <permission type="createDurableQueue" roles="guest"/>
             <permission type="deleteDurableQueue" roles="guest"/>
             <permission type="createNonDurableQueue" roles="guest"/>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/07ab2001/examples/features/ha/replicated-transaction-failover/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/ha/replicated-transaction-failover/src/main/resources/activemq/server0/broker.xml b/examples/features/ha/replicated-transaction-failover/src/main/resources/activemq/server0/broker.xml
index f8b076a..b8fca09 100644
--- a/examples/features/ha/replicated-transaction-failover/src/main/resources/activemq/server0/broker.xml
+++ b/examples/features/ha/replicated-transaction-failover/src/main/resources/activemq/server0/broker.xml
@@ -73,7 +73,6 @@ under the License.
 
       <cluster-connections>
          <cluster-connection name="my-cluster">
-            <address>jms</address>
             <connector-ref>netty-connector</connector-ref>
             <discovery-group-ref discovery-group-name="dg-group1"/>
          </cluster-connection>
@@ -82,7 +81,7 @@ under the License.
 
       <security-settings>
          <!--security for example queue-->
-         <security-setting match="jms.queue.exampleQueue">
+         <security-setting match="exampleQueue">
             <permission type="createDurableQueue" roles="guest"/>
             <permission type="deleteDurableQueue" roles="guest"/>
             <permission type="createNonDurableQueue" roles="guest"/>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/07ab2001/examples/features/ha/replicated-transaction-failover/src/main/resources/activemq/server1/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/ha/replicated-transaction-failover/src/main/resources/activemq/server1/broker.xml b/examples/features/ha/replicated-transaction-failover/src/main/resources/activemq/server1/broker.xml
index f64af4e..9844163 100644
--- a/examples/features/ha/replicated-transaction-failover/src/main/resources/activemq/server1/broker.xml
+++ b/examples/features/ha/replicated-transaction-failover/src/main/resources/activemq/server1/broker.xml
@@ -73,7 +73,6 @@ under the License.
 
       <cluster-connections>
          <cluster-connection name="my-cluster">
-            <address>jms</address>
             <connector-ref>netty-connector</connector-ref>
             <discovery-group-ref discovery-group-name="dg-group1"/>
          </cluster-connection>
@@ -83,7 +82,7 @@ under the License.
 
       <security-settings>
          <!--security for example queue-->
-         <security-setting match="jms.queue.exampleQueue">
+         <security-setting match="exampleQueue">
             <permission type="createDurableQueue" roles="guest"/>
             <permission type="deleteDurableQueue" roles="guest"/>
             <permission type="createNonDurableQueue" roles="guest"/>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/07ab2001/examples/features/ha/scale-down/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/ha/scale-down/src/main/resources/activemq/server0/broker.xml b/examples/features/ha/scale-down/src/main/resources/activemq/server0/broker.xml
index 559bb5a..dfb1e2c 100644
--- a/examples/features/ha/scale-down/src/main/resources/activemq/server0/broker.xml
+++ b/examples/features/ha/scale-down/src/main/resources/activemq/server0/broker.xml
@@ -67,7 +67,6 @@ under the License.
 
       <cluster-connections>
          <cluster-connection name="my-cluster">
-            <address>jms</address>
             <connector-ref>netty-connector</connector-ref>
             <retry-interval>500</retry-interval>
             <reconnect-attempts>5</reconnect-attempts>
@@ -84,7 +83,7 @@ under the License.
 
       <security-settings>
          <!--security for example queue-->
-         <security-setting match="jms.queue.exampleQueue">
+         <security-setting match="exampleQueue">
             <permission type="createDurableQueue" roles="guest"/>
             <permission type="deleteDurableQueue" roles="guest"/>
             <permission type="createNonDurableQueue" roles="guest"/>
@@ -92,7 +91,7 @@ under the License.
             <permission type="consume" roles="guest"/>
             <permission type="send" roles="guest"/>
          </security-setting>
-         <security-setting match="jms.queue.activemq.management">
+         <security-setting match="activemq.management">
             <permission type="createDurableQueue" roles="guest"/>
             <permission type="deleteDurableQueue" roles="guest"/>
             <permission type="createNonDurableQueue" roles="guest"/>
@@ -101,7 +100,7 @@ under the License.
             <permission type="send" roles="guest"/>
             <permission type="manage" roles="guest"/>
          </security-setting>
-         <security-setting match="jms.queue.activemq.management.*">
+         <security-setting match="activemq.management.*">
             <permission type="createDurableQueue" roles="guest"/>
             <permission type="deleteDurableQueue" roles="guest"/>
             <permission type="createNonDurableQueue" roles="guest"/>