activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbert...@apache.org
Subject [2/8] activemq-artemis git commit: Support new address-settings to control auto-created queue config
Date Thu, 08 Dec 2016 16:18:08 GMT
Support new address-settings to control auto-created queue config


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

Branch: refs/heads/ARTEMIS-780
Commit: 3c2747f09ff165c293dfb49da97eb32e31b4ea26
Parents: 4601f7c
Author: jbertram <jbertram@apache.com>
Authored: Tue Dec 6 15:41:05 2016 -0600
Committer: jbertram <jbertram@apache.com>
Committed: Thu Dec 8 08:43:21 2016 -0600

----------------------------------------------------------------------
 .../artemis/api/core/client/ClientSession.java  |  49 ++++++--
 .../core/client/impl/AddressQueryImpl.java      |  38 ++++--
 .../core/client/impl/ClientSessionImpl.java     |  30 ++++-
 .../core/impl/ActiveMQSessionContext.java       |  13 ++-
 .../core/protocol/core/impl/ChannelImpl.java    |   2 +
 .../core/protocol/core/impl/PacketDecoder.java  |   6 +
 .../core/protocol/core/impl/PacketImpl.java     |   2 +
 .../SessionBindingQueryResponseMessage.java     |   8 +-
 .../SessionBindingQueryResponseMessage_V2.java  |  28 +++--
 .../SessionBindingQueryResponseMessage_V3.java  |  37 +++---
 .../SessionBindingQueryResponseMessage_V4.java  | 116 +++++++++++++++++++
 .../artemis/core/server/AddressQueryResult.java |  14 ++-
 .../jms/client/ActiveMQMessageProducer.java     |   6 +-
 .../artemis/jms/client/ActiveMQSession.java     |  35 +++---
 .../jms/server/impl/JMSServerManagerImpl.java   |   6 +-
 .../artemis/junit/EmbeddedActiveMQResource.java |   3 +-
 .../amqp/broker/AMQPSessionCallback.java        |   2 +-
 .../client/HornetQClientSessionContext.java     |   3 +-
 .../protocol/openwire/OpenWireConnection.java   |   2 +-
 .../core/protocol/openwire/amq/AMQSession.java  |   2 +-
 .../core/ServerSessionPacketHandler.java        |   9 +-
 .../artemis/core/server/BindingQueryResult.java |  38 ++++--
 .../core/server/impl/ActiveMQServerImpl.java    |  36 +++---
 .../core/settings/impl/AddressSettings.java     |  67 ++++++++++-
 .../core/settings/AddressSettingsTest.java      |   3 +
 .../management/ActiveMQServerControlTest.java   |   4 +-
 .../jms/tests/message/MessageHeaderTest.java    |  24 ++++
 27 files changed, 470 insertions(+), 113 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3c2747f0/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 c8d483c..3530303 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
@@ -62,16 +62,18 @@ public interface ClientSession extends XAResource, AutoCloseable {
       List<SimpleString> getQueueNames();
 
       /**
-       * Returns <code>true</code> if auto-creation for this address is enabled and if the address queried is for a JMS
-       * queue, <code>false</code> else.
+       * Returns <code>true</code> if auto-queue-creation for this address is enabled, <code>false</code> else.
        */
-      boolean isAutoCreateJmsQueues();
+      boolean isAutoCreateQueues();
 
       /**
-       * Returns <code>true</code> if auto-creation for this address is enabled and if the address queried is for a JMS
-       * topic, <code>false</code> else.
+       * Returns <code>true</code> if auto-address-creation for this address is enabled, <code>false</code> else.
        */
-      boolean isAutoCreateJmsTopics();
+      boolean isAutoCreateAddresses();
+
+      boolean isDefaultDeleteOnNoConsumers();
+
+      int getDefaultMaxConsumers();
    }
 
    /**
@@ -510,8 +512,23 @@ public interface ClientSession extends XAResource, AutoCloseable {
     * @throws ActiveMQException in an exception occurs while creating the queue
     */
    void createQueue(SimpleString address, RoutingType routingType, SimpleString queueName, SimpleString filter,
-                    boolean durable,
-                    boolean autoCreated) throws ActiveMQException;
+                    boolean durable, boolean autoCreated) throws ActiveMQException;
+
+   /**
+    * Creates a <em>non-temporary</em> queue.
+    *
+    * @param address      the queue will be bound to this address
+    * @param routingType  the delivery mode for this queue, MULTICAST or ANYCAST
+    * @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
+    * @param maxConsumers how many concurrent consumers will be allowed on this queue
+    * @param deleteOnNoConsumers whether to delete the queue when the last consumer disconnects
+    * @throws ActiveMQException
+    */
+   void createQueue(SimpleString address, RoutingType routingType, SimpleString queueName, SimpleString filter,
+                    boolean durable, boolean autoCreated, int maxConsumers, boolean deleteOnNoConsumers) throws ActiveMQException;
 
    /**
     * Creates a <em>non-temporary</em>queue.
@@ -527,6 +544,22 @@ public interface ClientSession extends XAResource, AutoCloseable {
    void createQueue(String address, RoutingType routingType, String queueName, String 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 routingType the delivery mode for this queue, MULTICAST or ANYCAST
+    * @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
+    * @param maxConsumers how many concurrent consumers will be allowed on this queue
+    * @param deleteOnNoConsumers whether to delete the queue when the last consumer disconnects
+    * @throws ActiveMQException
+    */
+   void createQueue(String address, RoutingType routingType, String queueName, String filter, boolean durable, boolean autoCreated,
+                           int maxConsumers, boolean deleteOnNoConsumers) 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/3c2747f0/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/AddressQueryImpl.java
----------------------------------------------------------------------
diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/AddressQueryImpl.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/AddressQueryImpl.java
index 9d38dbb..1692cc6 100644
--- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/AddressQueryImpl.java
+++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/AddressQueryImpl.java
@@ -28,18 +28,26 @@ public class AddressQueryImpl implements ClientSession.AddressQuery {
 
    private final ArrayList<SimpleString> queueNames;
 
-   private final boolean autoCreateJmsQueues;
+   private final boolean autoCreateQueues;
 
-   private final boolean autoCreateJmsTopics;
+   private final boolean autoCreateAddresses;
+
+   private final boolean defaultDeleteOnNoConsumers;
+
+   private final int defaultMaxConsumers;
 
    public AddressQueryImpl(final boolean exists,
                            final List<SimpleString> queueNames,
-                           final boolean autoCreateJmsQueues,
-                           final boolean autoCreateJmsTopics) {
+                           final boolean autoCreateQueues,
+                           final boolean autoCreateAddresses,
+                           final boolean defaultDeleteOnNoConsumers,
+                           final int defaultMaxConsumers) {
       this.exists = exists;
       this.queueNames = new ArrayList<>(queueNames);
-      this.autoCreateJmsQueues = autoCreateJmsQueues;
-      this.autoCreateJmsTopics = autoCreateJmsTopics;
+      this.autoCreateQueues = autoCreateQueues;
+      this.autoCreateAddresses = autoCreateAddresses;
+      this.defaultDeleteOnNoConsumers = defaultDeleteOnNoConsumers;
+      this.defaultMaxConsumers = defaultMaxConsumers;
    }
 
    @Override
@@ -53,12 +61,22 @@ public class AddressQueryImpl implements ClientSession.AddressQuery {
    }
 
    @Override
-   public boolean isAutoCreateJmsQueues() {
-      return autoCreateJmsQueues;
+   public boolean isAutoCreateQueues() {
+      return autoCreateQueues;
+   }
+
+   @Override
+   public boolean isAutoCreateAddresses() {
+      return autoCreateAddresses;
+   }
+
+   @Override
+   public boolean isDefaultDeleteOnNoConsumers() {
+      return defaultDeleteOnNoConsumers;
    }
 
    @Override
-   public boolean isAutoCreateJmsTopics() {
-      return autoCreateJmsTopics;
+   public int getDefaultMaxConsumers() {
+      return defaultMaxConsumers;
    }
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3c2747f0/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 f1b9cef..72a2391 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
@@ -377,8 +377,7 @@ public final class ClientSessionImpl implements ClientSessionInternal, FailureLi
 
    @Override
    public void createQueue(final String address, final RoutingType routingType, final String queueName, final String filterString,
-                           final boolean durable,
-                           final boolean autoCreated) throws ActiveMQException {
+                           final boolean durable, final boolean autoCreated) throws ActiveMQException {
       createQueue(SimpleString.toSimpleString(address),
                   SimpleString.toSimpleString(queueName),
                   SimpleString.toSimpleString(filterString),
@@ -386,6 +385,33 @@ public final class ClientSessionImpl implements ClientSessionInternal, FailureLi
                   autoCreated);
    }
 
+
+   @Override
+   public void createQueue(final SimpleString address, final RoutingType routingType, final SimpleString queueName, final SimpleString filterString,
+                           final boolean durable, final boolean autoCreated, final int maxConsumers, final boolean deleteOnNoConsumers) throws ActiveMQException {
+      internalCreateQueue(address,
+                          queueName, routingType,
+                          filterString,
+                          durable,
+                          false,
+                          maxConsumers,
+                          deleteOnNoConsumers,
+                          autoCreated);
+   }
+
+   @Override
+   public void createQueue(final String address, final RoutingType routingType, final String queueName, final String filterString,
+                           final boolean durable, final boolean autoCreated, final int maxConsumers, final boolean deleteOnNoConsumers) throws ActiveMQException {
+      createQueue(SimpleString.toSimpleString(address),
+                  routingType,
+                  SimpleString.toSimpleString(queueName),
+                  SimpleString.toSimpleString(filterString),
+                  durable,
+                  autoCreated,
+                  maxConsumers,
+                  deleteOnNoConsumers);
+   }
+
    @Override
    public void createTemporaryQueue(final SimpleString address,
                                     final RoutingType routingType,

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3c2747f0/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 5707645..f77817c 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
@@ -68,6 +68,7 @@ import org.apache.activemq.artemis.core.protocol.core.impl.wireformat.SessionBin
 import org.apache.activemq.artemis.core.protocol.core.impl.wireformat.SessionBindingQueryResponseMessage;
 import org.apache.activemq.artemis.core.protocol.core.impl.wireformat.SessionBindingQueryResponseMessage_V2;
 import org.apache.activemq.artemis.core.protocol.core.impl.wireformat.SessionBindingQueryResponseMessage_V3;
+import org.apache.activemq.artemis.core.protocol.core.impl.wireformat.SessionBindingQueryResponseMessage_V4;
 import org.apache.activemq.artemis.core.protocol.core.impl.wireformat.SessionCloseMessage;
 import org.apache.activemq.artemis.core.protocol.core.impl.wireformat.SessionConsumerCloseMessage;
 import org.apache.activemq.artemis.core.protocol.core.impl.wireformat.SessionConsumerFlowCreditMessage;
@@ -306,18 +307,22 @@ public class ActiveMQSessionContext extends SessionContext {
 
    @Override
    public ClientSession.AddressQuery addressQuery(final SimpleString address) throws ActiveMQException {
-      if (sessionChannel.supports(PacketImpl.SESS_BINDINGQUERY_RESP_V3, getServerVersion())) {
+      if (sessionChannel.supports(PacketImpl.SESS_BINDINGQUERY_RESP_V4, getServerVersion())) {
+         Packet packet = sessionChannel.sendBlocking(new SessionBindingQueryMessage(address), PacketImpl.SESS_BINDINGQUERY_RESP_V4);
+         SessionBindingQueryResponseMessage_V4 response = (SessionBindingQueryResponseMessage_V4) packet;
+         return new AddressQueryImpl(response.isExists(), response.getQueueNames(), response.isAutoCreateQueues(), response.isAutoCreateAddresses(), response.isDefaultDeleteOnNoConsumers(), response.getDefaultMaxConsumers());
+      } else if (sessionChannel.supports(PacketImpl.SESS_BINDINGQUERY_RESP_V3, getServerVersion())) {
          Packet packet = sessionChannel.sendBlocking(new SessionBindingQueryMessage(address), PacketImpl.SESS_BINDINGQUERY_RESP_V3);
          SessionBindingQueryResponseMessage_V3 response = (SessionBindingQueryResponseMessage_V3) packet;
-         return new AddressQueryImpl(response.isExists(), response.getQueueNames(), response.isAutoCreateJmsQueues(), response.isAutoCreateJmsTopics());
+         return new AddressQueryImpl(response.isExists(), response.getQueueNames(), response.isAutoCreateQueues(), response.isAutoCreateAddresses(), ActiveMQDefaultConfiguration.getDefaultDeleteQueueOnNoConsumers(), ActiveMQDefaultConfiguration.getDefaultMaxQueueConsumers());
       } else if (sessionChannel.supports(PacketImpl.SESS_BINDINGQUERY_RESP_V2, getServerVersion())) {
          Packet packet = sessionChannel.sendBlocking(new SessionBindingQueryMessage(address), PacketImpl.SESS_BINDINGQUERY_RESP_V2);
          SessionBindingQueryResponseMessage_V2 response = (SessionBindingQueryResponseMessage_V2) packet;
-         return new AddressQueryImpl(response.isExists(), response.getQueueNames(), response.isAutoCreateJmsQueues(), false);
+         return new AddressQueryImpl(response.isExists(), response.getQueueNames(), response.isAutoCreateQueues(), false, ActiveMQDefaultConfiguration.getDefaultDeleteQueueOnNoConsumers(), ActiveMQDefaultConfiguration.getDefaultMaxQueueConsumers());
       } else {
          Packet packet = sessionChannel.sendBlocking(new SessionBindingQueryMessage(address), PacketImpl.SESS_BINDINGQUERY_RESP);
          SessionBindingQueryResponseMessage response = (SessionBindingQueryResponseMessage) packet;
-         return new AddressQueryImpl(response.isExists(), response.getQueueNames(), false, false);
+         return new AddressQueryImpl(response.isExists(), response.getQueueNames(), false, false, ActiveMQDefaultConfiguration.getDefaultDeleteQueueOnNoConsumers(), ActiveMQDefaultConfiguration.getDefaultMaxQueueConsumers());
       }
    }
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3c2747f0/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/ChannelImpl.java
----------------------------------------------------------------------
diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/ChannelImpl.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/ChannelImpl.java
index d1b17bf..5f20f46 100644
--- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/ChannelImpl.java
+++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/ChannelImpl.java
@@ -174,6 +174,8 @@ public final class ChannelImpl implements Channel {
             return version >= 127;
          case PacketImpl.SESS_QUEUEQUERY_RESP_V3:
             return version >= 129;
+         case PacketImpl.SESS_BINDINGQUERY_RESP_V4:
+            return version >= 129;
          default:
             return true;
       }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3c2747f0/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 89a6c9a..d7f243a 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
@@ -50,6 +50,7 @@ import org.apache.activemq.artemis.core.protocol.core.impl.wireformat.SessionBin
 import org.apache.activemq.artemis.core.protocol.core.impl.wireformat.SessionBindingQueryResponseMessage;
 import org.apache.activemq.artemis.core.protocol.core.impl.wireformat.SessionBindingQueryResponseMessage_V2;
 import org.apache.activemq.artemis.core.protocol.core.impl.wireformat.SessionBindingQueryResponseMessage_V3;
+import org.apache.activemq.artemis.core.protocol.core.impl.wireformat.SessionBindingQueryResponseMessage_V4;
 import org.apache.activemq.artemis.core.protocol.core.impl.wireformat.SessionCloseMessage;
 import org.apache.activemq.artemis.core.protocol.core.impl.wireformat.SessionCommitMessage;
 import org.apache.activemq.artemis.core.protocol.core.impl.wireformat.SessionConsumerCloseMessage;
@@ -114,6 +115,7 @@ import static org.apache.activemq.artemis.core.protocol.core.impl.PacketImpl.SES
 import static org.apache.activemq.artemis.core.protocol.core.impl.PacketImpl.SESS_BINDINGQUERY_RESP;
 import static org.apache.activemq.artemis.core.protocol.core.impl.PacketImpl.SESS_BINDINGQUERY_RESP_V2;
 import static org.apache.activemq.artemis.core.protocol.core.impl.PacketImpl.SESS_BINDINGQUERY_RESP_V3;
+import static org.apache.activemq.artemis.core.protocol.core.impl.PacketImpl.SESS_BINDINGQUERY_RESP_V4;
 import static org.apache.activemq.artemis.core.protocol.core.impl.PacketImpl.SESS_CLOSE;
 import static org.apache.activemq.artemis.core.protocol.core.impl.PacketImpl.SESS_COMMIT;
 import static org.apache.activemq.artemis.core.protocol.core.impl.PacketImpl.SESS_CONSUMER_CLOSE;
@@ -287,6 +289,10 @@ public abstract class PacketDecoder implements Serializable {
             packet = new SessionBindingQueryResponseMessage_V3();
             break;
          }
+         case SESS_BINDINGQUERY_RESP_V4: {
+            packet = new SessionBindingQueryResponseMessage_V4();
+            break;
+         }
          case SESS_XA_START: {
             packet = new SessionXAStartMessage();
             break;

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3c2747f0/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 5bdf727..96cde97 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
@@ -257,6 +257,8 @@ public class PacketImpl implements Packet {
 
    public static final byte SESS_QUEUEQUERY_RESP_V3 = -14;
 
+   public static final byte SESS_BINDINGQUERY_RESP_V4 = -15;
+
    // Static --------------------------------------------------------
 
    public PacketImpl(final byte type) {

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3c2747f0/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionBindingQueryResponseMessage.java
----------------------------------------------------------------------
diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionBindingQueryResponseMessage.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionBindingQueryResponseMessage.java
index 4cccfdc..cb89bda 100644
--- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionBindingQueryResponseMessage.java
+++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionBindingQueryResponseMessage.java
@@ -92,9 +92,15 @@ public class SessionBindingQueryResponseMessage extends PacketImpl {
    @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(", exists=" + exists);
       buff.append(", queueNames=" + queueNames);
-      buff.append("]");
       return buff.toString();
    }
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3c2747f0/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionBindingQueryResponseMessage_V2.java
----------------------------------------------------------------------
diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionBindingQueryResponseMessage_V2.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionBindingQueryResponseMessage_V2.java
index 0a48743..b3e226e 100644
--- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionBindingQueryResponseMessage_V2.java
+++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionBindingQueryResponseMessage_V2.java
@@ -23,18 +23,18 @@ import org.apache.activemq.artemis.api.core.SimpleString;
 
 public class SessionBindingQueryResponseMessage_V2 extends SessionBindingQueryResponseMessage {
 
-   protected boolean autoCreateJmsQueues;
+   protected boolean autoCreateQueues;
 
    public SessionBindingQueryResponseMessage_V2(final boolean exists,
                                                 final List<SimpleString> queueNames,
-                                                final boolean autoCreateJmsQueues) {
+                                                final boolean autoCreateQueues) {
       super(SESS_BINDINGQUERY_RESP_V2);
 
       this.exists = exists;
 
       this.queueNames = queueNames;
 
-      this.autoCreateJmsQueues = autoCreateJmsQueues;
+      this.autoCreateQueues = autoCreateQueues;
    }
 
    public SessionBindingQueryResponseMessage_V2() {
@@ -45,41 +45,45 @@ public class SessionBindingQueryResponseMessage_V2 extends SessionBindingQueryRe
       super(v);
    }
 
-   public boolean isAutoCreateJmsQueues() {
-      return autoCreateJmsQueues;
+   public boolean isAutoCreateQueues() {
+      return autoCreateQueues;
    }
 
    @Override
    public void encodeRest(final ActiveMQBuffer buffer) {
       super.encodeRest(buffer);
-      buffer.writeBoolean(autoCreateJmsQueues);
+      buffer.writeBoolean(autoCreateQueues);
    }
 
    @Override
    public void decodeRest(final ActiveMQBuffer buffer) {
       super.decodeRest(buffer);
-      autoCreateJmsQueues = buffer.readBoolean();
+      autoCreateQueues = buffer.readBoolean();
    }
 
    @Override
    public int hashCode() {
       final int prime = 31;
       int result = super.hashCode();
-      result = prime * result + (autoCreateJmsQueues ? 1231 : 1237);
+      result = prime * result + (autoCreateQueues ? 1231 : 1237);
       return result;
    }
 
    @Override
    public String toString() {
       StringBuffer buff = new StringBuffer(getParentString());
-      buff.append(", exists=" + exists);
-      buff.append(", queueNames=" + queueNames);
-      buff.append(", autoCreateJmsQueues=" + autoCreateJmsQueues);
       buff.append("]");
       return buff.toString();
    }
 
    @Override
+   public String getParentString() {
+      StringBuffer buff = new StringBuffer(super.getParentString());
+      buff.append(", autoCreateQueues=" + autoCreateQueues);
+      return buff.toString();
+   }
+
+   @Override
    public boolean equals(Object obj) {
       if (this == obj)
          return true;
@@ -88,7 +92,7 @@ public class SessionBindingQueryResponseMessage_V2 extends SessionBindingQueryRe
       if (!(obj instanceof SessionBindingQueryResponseMessage_V2))
          return false;
       SessionBindingQueryResponseMessage_V2 other = (SessionBindingQueryResponseMessage_V2) obj;
-      if (autoCreateJmsQueues != other.autoCreateJmsQueues)
+      if (autoCreateQueues != other.autoCreateQueues)
          return false;
       return true;
    }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3c2747f0/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionBindingQueryResponseMessage_V3.java
----------------------------------------------------------------------
diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionBindingQueryResponseMessage_V3.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionBindingQueryResponseMessage_V3.java
index 3ed489f..27df666 100644
--- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionBindingQueryResponseMessage_V3.java
+++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionBindingQueryResponseMessage_V3.java
@@ -23,63 +23,70 @@ import org.apache.activemq.artemis.api.core.SimpleString;
 
 public class SessionBindingQueryResponseMessage_V3 extends SessionBindingQueryResponseMessage_V2 {
 
-   private boolean autoCreateJmsTopics;
+   protected boolean autoCreateAddresses;
 
    public SessionBindingQueryResponseMessage_V3(final boolean exists,
                                                 final List<SimpleString> queueNames,
-                                                final boolean autoCreateJmsQueues,
-                                                final boolean autoCreateJmsTopics) {
+                                                final boolean autoCreateQueues,
+                                                final boolean autoCreateAddresses) {
       super(SESS_BINDINGQUERY_RESP_V3);
 
       this.exists = exists;
 
       this.queueNames = queueNames;
 
-      this.autoCreateJmsQueues = autoCreateJmsQueues;
+      this.autoCreateQueues = autoCreateQueues;
 
-      this.autoCreateJmsTopics = autoCreateJmsTopics;
+      this.autoCreateAddresses = autoCreateAddresses;
    }
 
    public SessionBindingQueryResponseMessage_V3() {
       super(SESS_BINDINGQUERY_RESP_V3);
    }
 
-   public boolean isAutoCreateJmsTopics() {
-      return autoCreateJmsTopics;
+   public SessionBindingQueryResponseMessage_V3(byte v) {
+      super(v);
+   }
+
+   public boolean isAutoCreateAddresses() {
+      return autoCreateAddresses;
    }
 
    @Override
    public void encodeRest(final ActiveMQBuffer buffer) {
       super.encodeRest(buffer);
-      buffer.writeBoolean(autoCreateJmsTopics);
+      buffer.writeBoolean(autoCreateAddresses);
    }
 
    @Override
    public void decodeRest(final ActiveMQBuffer buffer) {
       super.decodeRest(buffer);
-      autoCreateJmsTopics = buffer.readBoolean();
+      autoCreateAddresses = buffer.readBoolean();
    }
 
    @Override
    public int hashCode() {
       final int prime = 31;
       int result = super.hashCode();
-      result = prime * result + (autoCreateJmsTopics ? 1231 : 1237);
+      result = prime * result + (autoCreateAddresses ? 1231 : 1237);
       return result;
    }
 
    @Override
    public String toString() {
       StringBuffer buff = new StringBuffer(getParentString());
-      buff.append(", exists=" + exists);
-      buff.append(", queueNames=" + queueNames);
-      buff.append(", autoCreateJmsQueues=" + autoCreateJmsQueues);
-      buff.append(", autoCreateJmsTopics=" + autoCreateJmsTopics);
       buff.append("]");
       return buff.toString();
    }
 
    @Override
+   public String getParentString() {
+      StringBuffer buff = new StringBuffer(super.getParentString());
+      buff.append(", autoCreateAddresses=" + autoCreateAddresses);
+      return buff.toString();
+   }
+
+   @Override
    public boolean equals(Object obj) {
       if (this == obj)
          return true;
@@ -88,7 +95,7 @@ public class SessionBindingQueryResponseMessage_V3 extends SessionBindingQueryRe
       if (!(obj instanceof SessionBindingQueryResponseMessage_V3))
          return false;
       SessionBindingQueryResponseMessage_V3 other = (SessionBindingQueryResponseMessage_V3) obj;
-      if (autoCreateJmsTopics != other.autoCreateJmsTopics)
+      if (autoCreateAddresses != other.autoCreateAddresses)
          return false;
       return true;
    }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3c2747f0/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionBindingQueryResponseMessage_V4.java
----------------------------------------------------------------------
diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionBindingQueryResponseMessage_V4.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionBindingQueryResponseMessage_V4.java
new file mode 100644
index 0000000..f173504
--- /dev/null
+++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionBindingQueryResponseMessage_V4.java
@@ -0,0 +1,116 @@
+/*
+ * 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 java.util.List;
+
+import org.apache.activemq.artemis.api.core.ActiveMQBuffer;
+import org.apache.activemq.artemis.api.core.SimpleString;
+
+public class SessionBindingQueryResponseMessage_V4 extends SessionBindingQueryResponseMessage_V3 {
+
+   private boolean defaultDeleteOnNoConsumers;
+
+   private int defaultMaxConsumers;
+
+   public SessionBindingQueryResponseMessage_V4(final boolean exists,
+                                                final List<SimpleString> queueNames,
+                                                final boolean autoCreateQueues,
+                                                final boolean autoCreateAddresses,
+                                                final boolean defaultDeleteOnNoConsumers,
+                                                final int defaultMaxConsumers) {
+      super(SESS_BINDINGQUERY_RESP_V4);
+
+      this.exists = exists;
+
+      this.queueNames = queueNames;
+
+      this.autoCreateQueues = autoCreateQueues;
+
+      this.autoCreateAddresses = autoCreateAddresses;
+
+      this.defaultDeleteOnNoConsumers = defaultDeleteOnNoConsumers;
+
+      this.defaultMaxConsumers = defaultMaxConsumers;
+   }
+
+   public SessionBindingQueryResponseMessage_V4() {
+      super(SESS_BINDINGQUERY_RESP_V4);
+   }
+
+   public boolean isDefaultDeleteOnNoConsumers() {
+      return defaultDeleteOnNoConsumers;
+   }
+
+   public int getDefaultMaxConsumers() {
+      return defaultMaxConsumers;
+   }
+
+   @Override
+   public void encodeRest(final ActiveMQBuffer buffer) {
+      super.encodeRest(buffer);
+      buffer.writeBoolean(defaultDeleteOnNoConsumers);
+      buffer.writeInt(defaultMaxConsumers);
+   }
+
+   @Override
+   public void decodeRest(final ActiveMQBuffer buffer) {
+      super.decodeRest(buffer);
+      defaultDeleteOnNoConsumers = buffer.readBoolean();
+      defaultMaxConsumers = buffer.readInt();
+   }
+
+   @Override
+   public int hashCode() {
+      final int prime = 31;
+      int result = super.hashCode();
+      result = prime * result + (defaultDeleteOnNoConsumers ? 1231 : 1237);
+      result = prime * result + defaultMaxConsumers;
+      return result;
+   }
+
+   @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(", defaultDeleteOnNoConsumers=" + defaultDeleteOnNoConsumers);
+      buff.append(", defaultMaxConsumers=" + defaultMaxConsumers);
+      return buff.toString();
+   }
+
+   @Override
+   public boolean equals(Object obj) {
+      if (this == obj)
+         return true;
+      if (!super.equals(obj))
+         return false;
+      if (!(obj instanceof SessionBindingQueryResponseMessage_V4))
+         return false;
+      SessionBindingQueryResponseMessage_V4 other = (SessionBindingQueryResponseMessage_V4) obj;
+      if (defaultDeleteOnNoConsumers != other.defaultDeleteOnNoConsumers)
+         return false;
+      if (defaultMaxConsumers != other.defaultMaxConsumers)
+         return false;
+      return true;
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3c2747f0/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/server/AddressQueryResult.java
----------------------------------------------------------------------
diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/server/AddressQueryResult.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/server/AddressQueryResult.java
index 07d7406..a3bb034 100644
--- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/server/AddressQueryResult.java
+++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/server/AddressQueryResult.java
@@ -28,8 +28,10 @@ public class AddressQueryResult {
    private final boolean autoCreated;
    private final boolean exists;
    private final boolean autoCreateAddresses;
+   private final boolean defaultDeleteOnNoConsumers;
+   private final int defaultMaxConsumers;
 
-   public AddressQueryResult(SimpleString name, Set<RoutingType> routingTypes, long id, boolean autoCreated, boolean exists, boolean autoCreateAddresses) {
+   public AddressQueryResult(SimpleString name, Set<RoutingType> routingTypes, long id, boolean autoCreated, boolean exists, boolean autoCreateAddresses, boolean defaultDeleteOnNoConsumers, int defaultMaxConsumers) {
 
       this.name = name;
       this.routingTypes = routingTypes;
@@ -38,6 +40,8 @@ public class AddressQueryResult {
       this.autoCreated = autoCreated;
       this.exists = exists;
       this.autoCreateAddresses = autoCreateAddresses;
+      this.defaultDeleteOnNoConsumers = defaultDeleteOnNoConsumers;
+      this.defaultMaxConsumers = defaultMaxConsumers;
    }
 
    public SimpleString getName() {
@@ -63,4 +67,12 @@ public class AddressQueryResult {
    public boolean isAutoCreateAddresses() {
       return autoCreateAddresses;
    }
+
+   public boolean isDefaultDeleteOnNoConsumers() {
+      return defaultDeleteOnNoConsumers;
+   }
+
+   public int getDefaultMaxConsumers() {
+      return defaultMaxConsumers;
+   }
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3c2747f0/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 4827fd5..ecc47bc 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
@@ -406,7 +406,7 @@ public class ActiveMQMessageProducer implements MessageProducer, QueueSender, To
                ClientSession.AddressQuery query = clientSession.addressQuery(address);
 
                if (!query.isExists()) {
-                  if (destination.isQueue() && query.isAutoCreateJmsQueues()) {
+                  if (destination.isQueue() && query.isAutoCreateQueues()) {
                      clientSession.createAddress(address, RoutingType.ANYCAST, true);
                      if (destination.isTemporary()) {
                         // TODO is it right to use the address for the queue name here?
@@ -414,9 +414,9 @@ public class ActiveMQMessageProducer implements MessageProducer, QueueSender, To
                      } else {
                         clientSession.createQueue(address, RoutingType.ANYCAST, address, null, true, true);
                      }
-                  } else if (!destination.isQueue() && query.isAutoCreateJmsTopics()) {
+                  } else if (!destination.isQueue() && query.isAutoCreateAddresses()) {
                      clientSession.createAddress(address, RoutingType.MULTICAST, true);
-                  } else if ((destination.isQueue() && !query.isAutoCreateJmsQueues()) || (!destination.isQueue() && !query.isAutoCreateJmsTopics())) {
+                  } else if ((destination.isQueue() && !query.isAutoCreateQueues()) || (!destination.isQueue() && !query.isAutoCreateAddresses())) {
                      throw new InvalidDestinationException("Destination " + address + " does not exist");
                   }
                } else {

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3c2747f0/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 b85ff21..024b8a2 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
@@ -302,11 +302,11 @@ public class ActiveMQSession implements QueueSession, TopicSession {
 
             if (!response.isExists()) {
                try {
-                  if (jbd.isQueue() && response.isAutoCreateJmsQueues()) {
+                  if (jbd.isQueue() && response.isAutoCreateQueues()) {
                      // perhaps just relying on the broker to do it is simplest (i.e. deleteOnNoConsumers)
                      session.createAddress(jbd.getSimpleAddress(), RoutingType.ANYCAST, true);
-                     session.createQueue(jbd.getSimpleAddress(), RoutingType.ANYCAST, jbd.getSimpleAddress(), null, true, true);
-                  } else if (!jbd.isQueue() && response.isAutoCreateJmsTopics()) {
+                     session.createQueue(jbd.getSimpleAddress(), RoutingType.ANYCAST, jbd.getSimpleAddress(), null, true, true, response.getDefaultMaxConsumers(), response.isDefaultDeleteOnNoConsumers());
+                  } else if (!jbd.isQueue() && response.isAutoCreateAddresses()) {
                      session.createAddress(jbd.getSimpleAddress(), RoutingType.MULTICAST, true);
                   } else {
                      throw new InvalidDestinationException("Destination " + jbd.getName() + " does not exist");
@@ -571,7 +571,7 @@ public class ActiveMQSession implements QueueSession, TopicSession {
 
          AddressQuery response = session.addressQuery(dest.getSimpleAddress());
 
-         if (!response.isExists() && !response.isAutoCreateJmsTopics()) {
+         if (!response.isExists() && !response.isAutoCreateAddresses()) {
             throw ActiveMQJMSClientBundle.BUNDLE.destinationDoesNotExist(dest.getSimpleAddress());
          }
 
@@ -651,9 +651,9 @@ public class ActiveMQSession implements QueueSession, TopicSession {
              * not a LOCAL binding for the address exists. If no LOCAL binding exists then it should be created here.
              */
             if (!response.isExists() || !response.getQueueNames().contains(dest.getSimpleAddress())) {
-               if (response.isAutoCreateJmsQueues()) {
+               if (response.isAutoCreateQueues()) {
                   try {
-                     session.createQueue(dest.getSimpleAddress(), RoutingType.ANYCAST, dest.getSimpleAddress(), null, true, true);
+                     session.createQueue(dest.getSimpleAddress(), RoutingType.ANYCAST, dest.getSimpleAddress(), null, true, true, response.getDefaultMaxConsumers(), response.isDefaultDeleteOnNoConsumers());
                   } catch (ActiveMQQueueExistsException e) {
                      // The queue was created by another client/admin between the query check and send create queue packet
                   }
@@ -669,7 +669,7 @@ public class ActiveMQSession implements QueueSession, TopicSession {
             AddressQuery response = session.addressQuery(dest.getSimpleAddress());
 
             if (!response.isExists()) {
-               if (response.isAutoCreateJmsTopics()) {
+               if (response.isAutoCreateAddresses()) {
                   session.createAddress(dest.getSimpleAddress(), RoutingType.MULTICAST, true);
                } else {
                   throw new InvalidDestinationException("Topic " + dest.getName() + " does not exist");
@@ -709,7 +709,8 @@ public class ActiveMQSession implements QueueSession, TopicSession {
                QueueQuery subResponse = session.queueQuery(queueName);
 
                if (!subResponse.isExists()) {
-                  session.createQueue(dest.getSimpleAddress(), RoutingType.MULTICAST, queueName, coreFilterString, true);
+                  // durable subscription queues are not technically considered to be auto-created
+                  session.createQueue(dest.getSimpleAddress(), RoutingType.MULTICAST, queueName, coreFilterString, true, false, response.getDefaultMaxConsumers(), response.isDefaultDeleteOnNoConsumers());
                } else {
                   // Already exists
                   if (subResponse.getConsumerCount() > 0) {
@@ -718,12 +719,10 @@ public class ActiveMQSession implements QueueSession, TopicSession {
 
                   // From javax.jms.Session Javadoc (and also JMS 1.1 6.11.1):
                   // A client can change an existing durable subscription by
-                  // creating a durable
-                  // TopicSubscriber with the same name and a new topic and/or
-                  // message selector.
-                  // Changing a durable subscriber is equivalent to
-                  // unsubscribing (deleting) the old
-                  // one and creating a new one.
+                  // creating a durable TopicSubscriber with the same name and
+                  // a new topic and/or message selector.
+                  // Changing a durable subscriber is equivalent to unsubscribing
+                  // (deleting) the old one and creating a new one.
 
                   SimpleString oldFilterString = subResponse.getFilterString();
 
@@ -742,7 +741,7 @@ public class ActiveMQSession implements QueueSession, TopicSession {
                      session.deleteQueue(queueName);
 
                      // Create the new one
-                     session.createQueue(dest.getSimpleAddress(), queueName, coreFilterString, true);
+                     session.createQueue(dest.getSimpleAddress(), RoutingType.MULTICAST, queueName, coreFilterString, true, false, response.getDefaultMaxConsumers(), response.isDefaultDeleteOnNoConsumers());
                   }
                }
 
@@ -803,8 +802,8 @@ public class ActiveMQSession implements QueueSession, TopicSession {
       try {
          AddressQuery response = session.addressQuery(new SimpleString(activeMQDestination.getAddress()));
          if (!response.isExists()) {
-            if (response.isAutoCreateJmsQueues()) {
-               session.createQueue(activeMQDestination.getSimpleAddress(), activeMQDestination.getSimpleAddress(), null, true, true);
+            if (response.isAutoCreateQueues()) {
+               session.createQueue(activeMQDestination.getSimpleAddress(), RoutingType.ANYCAST, activeMQDestination.getSimpleAddress(), null, true, true, response.getDefaultMaxConsumers(), response.isDefaultDeleteOnNoConsumers());
             } else {
                throw new InvalidDestinationException("Destination " + activeMQDestination.getName() + " does not exist");
             }
@@ -1102,7 +1101,7 @@ public class ActiveMQSession implements QueueSession, TopicSession {
 
       AddressQuery query = session.addressQuery(topic.getSimpleAddress());
 
-      if (!query.isExists() && !query.isAutoCreateJmsTopics()) {
+      if (!query.isExists() && !query.isAutoCreateAddresses()) {
          return null;
       } else {
          return topic;

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3c2747f0/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 1325cf4..6daf9fb 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
@@ -1618,9 +1618,9 @@ public class JMSServerManagerImpl implements JMSServerManager, ActivateCallback
 //      @Override
 //      public boolean create(SimpleString address) throws Exception {
 //         AddressSettings settings = server.getAddressSettingsRepository().getMatch(address.toString());
-//         if (address.toString().startsWith(ActiveMQDestination.JMS_QUEUE_ADDRESS_PREFIX) && settings.isAutoCreateJmsQueues()) {
+//         if (address.toString().startsWith(ActiveMQDestination.JMS_QUEUE_ADDRESS_PREFIX) && settings.isAutoCreateQueues()) {
 //            return internalCreateJMSQueue(false, address.toString().substring(ActiveMQDestination.JMS_QUEUE_ADDRESS_PREFIX.length()), null, true, true);
-//         } else if (address.toString().startsWith(ActiveMQDestination.JMS_TOPIC_ADDRESS_PREFIX) && settings.isAutoCreateJmsTopics()) {
+//         } else if (address.toString().startsWith(ActiveMQDestination.JMS_TOPIC_ADDRESS_PREFIX) && settings.isAutoCreateAddresses()) {
 //            return createTopic(false, address.toString().substring(ActiveMQDestination.JMS_TOPIC_ADDRESS_PREFIX.length()), true);
 //         } else {
 //            return false;
@@ -1667,7 +1667,7 @@ public class JMSServerManagerImpl implements JMSServerManager, ActivateCallback
 //          * for that dummy subscription is created we don't want to call createTopic again. Therefore we make sure the
 //          * queue name doesn't start with the topic prefix.
 //          */
-//         if (address.toString().startsWith(ActiveMQDestination.JMS_TOPIC_ADDRESS_PREFIX) && settings.isAutoCreateJmsTopics() && !queueName.toString().startsWith(ActiveMQDestination.JMS_TOPIC_ADDRESS_PREFIX)) {
+//         if (address.toString().startsWith(ActiveMQDestination.JMS_TOPIC_ADDRESS_PREFIX) && settings.isAutoCreateAddresses() && !queueName.toString().startsWith(ActiveMQDestination.JMS_TOPIC_ADDRESS_PREFIX)) {
 //            createTopic(false, address.toString().substring(ActiveMQDestination.JMS_TOPIC_ADDRESS_PREFIX.length()), true);
 //         }
 //      }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3c2747f0/artemis-junit/src/main/java/org/apache/activemq/artemis/junit/EmbeddedActiveMQResource.java
----------------------------------------------------------------------
diff --git a/artemis-junit/src/main/java/org/apache/activemq/artemis/junit/EmbeddedActiveMQResource.java b/artemis-junit/src/main/java/org/apache/activemq/artemis/junit/EmbeddedActiveMQResource.java
index 5b386e8..fb425d7 100644
--- a/artemis-junit/src/main/java/org/apache/activemq/artemis/junit/EmbeddedActiveMQResource.java
+++ b/artemis-junit/src/main/java/org/apache/activemq/artemis/junit/EmbeddedActiveMQResource.java
@@ -20,7 +20,6 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
-import org.apache.activemq.artemis.api.config.ActiveMQDefaultConfiguration;
 import org.apache.activemq.artemis.api.core.ActiveMQException;
 import org.apache.activemq.artemis.api.core.SimpleString;
 import org.apache.activemq.artemis.api.core.TransportConfiguration;
@@ -362,7 +361,7 @@ public class EmbeddedActiveMQResource extends ExternalResource {
       boolean temporary = false;
       Queue queue = null;
       try {
-         queue = server.getActiveMQServer().createQueue(address, RoutingType.MULTICAST, name, filter, isUseDurableQueue(), temporary, ActiveMQDefaultConfiguration.getDefaultMaxQueueConsumers(), ActiveMQDefaultConfiguration.getDefaultDeleteQueueOnNoConsumers(), true);
+         queue = server.getActiveMQServer().createQueue(address, RoutingType.MULTICAST, name, filter, isUseDurableQueue(), temporary, server.getActiveMQServer().getAddressSettingsRepository().getMatch(address.toString()).getDefaultMaxConsumers(), server.getActiveMQServer().getAddressSettingsRepository().getMatch(address.toString()).isDefaultDeleteOnNoConsumers(), true);
       } catch (Exception ex) {
          throw new EmbeddedActiveMQResourceException(String.format("Failed to create queue: queueName = %s, name = %s", address.toString(), name.toString()), ex);
       }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3c2747f0/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPSessionCallback.java
----------------------------------------------------------------------
diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPSessionCallback.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPSessionCallback.java
index c0dc34e..48c51bd 100644
--- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPSessionCallback.java
+++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPSessionCallback.java
@@ -235,7 +235,7 @@ public class AMQPSessionCallback implements SessionCallback {
 
    public boolean bindingQuery(String address) throws Exception {
       BindingQueryResult bindingQueryResult = serverSession.executeBindingQuery(SimpleString.toSimpleString(address));
-      if (!bindingQueryResult.isExists() && bindingQueryResult.isAutoCreateJmsQueues()) {
+      if (!bindingQueryResult.isExists() && bindingQueryResult.isAutoCreateQueues()) {
          try {
             serverSession.createQueue(new SimpleString(address), new SimpleString(address), null, false, true);
          } catch (ActiveMQQueueExistsException e) {

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3c2747f0/artemis-protocols/artemis-hqclient-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/hornetq/client/HornetQClientSessionContext.java
----------------------------------------------------------------------
diff --git a/artemis-protocols/artemis-hqclient-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/hornetq/client/HornetQClientSessionContext.java b/artemis-protocols/artemis-hqclient-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/hornetq/client/HornetQClientSessionContext.java
index caa94a1..1aad1e4 100644
--- a/artemis-protocols/artemis-hqclient-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/hornetq/client/HornetQClientSessionContext.java
+++ b/artemis-protocols/artemis-hqclient-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/hornetq/client/HornetQClientSessionContext.java
@@ -19,6 +19,7 @@ package org.apache.activemq.artemis.core.protocol.hornetq.client;
 
 import java.util.concurrent.Executor;
 
+import org.apache.activemq.artemis.api.config.ActiveMQDefaultConfiguration;
 import org.apache.activemq.artemis.api.core.ActiveMQException;
 import org.apache.activemq.artemis.api.core.SimpleString;
 import org.apache.activemq.artemis.api.core.client.ClientSession;
@@ -71,7 +72,7 @@ public class HornetQClientSessionContext extends ActiveMQSessionContext {
    public ClientSession.AddressQuery addressQuery(final SimpleString address) throws ActiveMQException {
       SessionBindingQueryResponseMessage response = (SessionBindingQueryResponseMessage) getSessionChannel().sendBlocking(new SessionBindingQueryMessage(address), PacketImpl.SESS_BINDINGQUERY_RESP);
 
-      return new AddressQueryImpl(response.isExists(), response.getQueueNames(), false, false);
+      return new AddressQueryImpl(response.isExists(), response.getQueueNames(), false, false, ActiveMQDefaultConfiguration.getDefaultDeleteQueueOnNoConsumers(), ActiveMQDefaultConfiguration.getDefaultMaxQueueConsumers());
    }
 
    @Override

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3c2747f0/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 9e65f17..f90c0b7 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
@@ -913,7 +913,7 @@ public class OpenWireConnection extends AbstractRemotingConnection implements Se
       if (destination.isQueue()) {
          SimpleString physicalName = new SimpleString(destination.getPhysicalName());
          BindingQueryResult result = server.bindingQuery(physicalName);
-         if (!result.isExists() && !result.isAutoCreateJmsQueues()) {
+         if (!result.isExists() && !result.isAutoCreateQueues()) {
             throw ActiveMQMessageBundle.BUNDLE.noSuchQueue(physicalName);
          }
       }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3c2747f0/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 a0826a7..c73c56b 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
@@ -173,7 +173,7 @@ public class AMQSession implements SessionCallback {
          BindingQueryResult bindingQuery = server.bindingQuery(queueName);
          QueueQueryResult queueBinding = server.queueQuery(queueName);
 
-         boolean isAutoCreate = bindingQuery.isExists() ? true : bindingQuery.isAutoCreateJmsQueues();
+         boolean isAutoCreate = bindingQuery.isExists() ? true : bindingQuery.isAutoCreateQueues();
 
          if (!queueBinding.isExists()) {
             if (isAutoCreate) {

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3c2747f0/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 d3cc617..acb1c4c 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
@@ -44,6 +44,7 @@ import org.apache.activemq.artemis.core.protocol.core.impl.wireformat.SessionBin
 import org.apache.activemq.artemis.core.protocol.core.impl.wireformat.SessionBindingQueryResponseMessage;
 import org.apache.activemq.artemis.core.protocol.core.impl.wireformat.SessionBindingQueryResponseMessage_V2;
 import org.apache.activemq.artemis.core.protocol.core.impl.wireformat.SessionBindingQueryResponseMessage_V3;
+import org.apache.activemq.artemis.core.protocol.core.impl.wireformat.SessionBindingQueryResponseMessage_V4;
 import org.apache.activemq.artemis.core.protocol.core.impl.wireformat.SessionConsumerCloseMessage;
 import org.apache.activemq.artemis.core.protocol.core.impl.wireformat.SessionConsumerFlowCreditMessage;
 import org.apache.activemq.artemis.core.protocol.core.impl.wireformat.SessionCreateConsumerMessage;
@@ -300,10 +301,12 @@ public class ServerSessionPacketHandler implements ChannelHandler {
                   requiresResponse = true;
                   SessionBindingQueryMessage request = (SessionBindingQueryMessage) packet;
                   BindingQueryResult result = session.executeBindingQuery(request.getAddress());
-                  if (channel.supports(PacketImpl.SESS_BINDINGQUERY_RESP_V3)) {
-                     response = new SessionBindingQueryResponseMessage_V3(result.isExists(), result.getQueueNames(), result.isAutoCreateJmsQueues(), result.isAutoCreateJmsTopics());
+                  if (channel.supports(PacketImpl.SESS_BINDINGQUERY_RESP_V4)) {
+                     response = new SessionBindingQueryResponseMessage_V4(result.isExists(), result.getQueueNames(), result.isAutoCreateQueues(), result.isAutoCreateAddresses(), result.isDefaultDeleteOnNoConsumers(), result.getDefaultMaxConsumers());
+                  } else if (channel.supports(PacketImpl.SESS_BINDINGQUERY_RESP_V3)) {
+                     response = new SessionBindingQueryResponseMessage_V3(result.isExists(), result.getQueueNames(), result.isAutoCreateQueues(), result.isAutoCreateAddresses());
                   } else if (channel.supports(PacketImpl.SESS_BINDINGQUERY_RESP_V2)) {
-                     response = new SessionBindingQueryResponseMessage_V2(result.isExists(), result.getQueueNames(), result.isAutoCreateJmsQueues());
+                     response = new SessionBindingQueryResponseMessage_V2(result.isExists(), result.getQueueNames(), result.isAutoCreateQueues());
                   } else {
                      response = new SessionBindingQueryResponseMessage(result.isExists(), result.getQueueNames());
                   }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3c2747f0/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/BindingQueryResult.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/BindingQueryResult.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/BindingQueryResult.java
index fce3a2e..739b960 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/BindingQueryResult.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/BindingQueryResult.java
@@ -26,36 +26,54 @@ public class BindingQueryResult {
 
    private List<SimpleString> queueNames;
 
-   private boolean autoCreateJmsQueues;
+   private boolean autoCreateQueues;
 
-   private boolean autoCreateJmsTopics;
+   private boolean autoCreateAddresses;
+
+   private boolean defaultDeleteOnNoConsumers;
+
+   private int defaultMaxConsumers;
 
    public BindingQueryResult(final boolean exists,
                              final List<SimpleString> queueNames,
-                             final boolean autoCreateJmsQueues,
-                             final boolean autoCreateJmsTopics) {
+                             final boolean autoCreateQueues,
+                             final boolean autoCreateAddresses,
+                             final boolean defaultDeleteOnNoConsumers,
+                             final int defaultMaxConsumers) {
       this.exists = exists;
 
       this.queueNames = queueNames;
 
-      this.autoCreateJmsQueues = autoCreateJmsQueues;
+      this.autoCreateQueues = autoCreateQueues;
+
+      this.autoCreateAddresses = autoCreateAddresses;
+
+      this.defaultDeleteOnNoConsumers = defaultDeleteOnNoConsumers;
 
-      this.autoCreateJmsTopics = autoCreateJmsTopics;
+      this.defaultMaxConsumers = defaultMaxConsumers;
    }
 
    public boolean isExists() {
       return exists;
    }
 
-   public boolean isAutoCreateJmsQueues() {
-      return autoCreateJmsQueues;
+   public boolean isAutoCreateQueues() {
+      return autoCreateQueues;
    }
 
-   public boolean isAutoCreateJmsTopics() {
-      return autoCreateJmsTopics;
+   public boolean isAutoCreateAddresses() {
+      return autoCreateAddresses;
    }
 
    public List<SimpleString> getQueueNames() {
       return queueNames;
    }
+
+   public boolean isDefaultDeleteOnNoConsumers() {
+      return defaultDeleteOnNoConsumers;
+   }
+
+   public int getDefaultMaxConsumers() {
+      return defaultMaxConsumers;
+   }
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3c2747f0/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 6d30a28..2f1fd53 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
@@ -691,8 +691,12 @@ public class ActiveMQServerImpl implements ActiveMQServer {
          throw ActiveMQMessageBundle.BUNDLE.addressIsNull();
       }
 
-      boolean autoCreateJmsQueues = getAddressSettingsRepository().getMatch(address.toString()).isAutoCreateQueues();
-      boolean autoCreateJmsTopics = getAddressSettingsRepository().getMatch(address.toString()).isAutoCreateAddresses();
+      AddressSettings addressSettings = getAddressSettingsRepository().getMatch(address.toString());
+
+      boolean autoCreateQeueus = addressSettings.isAutoCreateQueues();
+      boolean autoCreateAddresses = addressSettings.isAutoCreateAddresses();
+      boolean defaultDeleteOnNoConsumers = addressSettings.isDefaultDeleteOnNoConsumers();
+      int defaultMaxConsumers = addressSettings.getDefaultMaxConsumers();
 
       List<SimpleString> names = new ArrayList<>();
 
@@ -700,7 +704,7 @@ public class ActiveMQServerImpl implements ActiveMQServer {
       ManagementService managementService = getManagementService();
       if (managementService != null) {
          if (address.equals(managementService.getManagementAddress())) {
-            return new BindingQueryResult(true, names, autoCreateJmsQueues, autoCreateJmsTopics);
+            return new BindingQueryResult(true, names, autoCreateQeueus, autoCreateAddresses, defaultDeleteOnNoConsumers, defaultMaxConsumers);
          }
       }
 
@@ -712,7 +716,7 @@ public class ActiveMQServerImpl implements ActiveMQServer {
          }
       }
 
-      return new BindingQueryResult(getAddressInfo(address) != null, names, autoCreateJmsQueues, autoCreateJmsTopics);
+      return new BindingQueryResult(getAddressInfo(address) != null, names, autoCreateQeueus, autoCreateAddresses, defaultDeleteOnNoConsumers, defaultMaxConsumers);
    }
 
    @Override
@@ -722,6 +726,8 @@ public class ActiveMQServerImpl implements ActiveMQServer {
       }
 
       boolean autoCreateQueues = getAddressSettingsRepository().getMatch(name.toString()).isAutoCreateQueues();
+      boolean defaultDeleteOnNoConsumers = getAddressSettingsRepository().getMatch(name.toString()).isDefaultDeleteOnNoConsumers();
+      int defaultMaxConsumers = getAddressSettingsRepository().getMatch(name.toString()).getDefaultMaxConsumers();
 
       QueueQueryResult response;
 
@@ -741,7 +747,7 @@ public class ActiveMQServerImpl implements ActiveMQServer {
          // make an exception for the management address (see HORNETQ-29)
          response = new QueueQueryResult(name, managementAddress, true, false, null, -1, -1, autoCreateQueues, true, false, false, RoutingType.MULTICAST, -1);
       } else if (autoCreateQueues) {
-         response = new QueueQueryResult(name, name, true, false, null, 0, 0, true, false, false, false, RoutingType.MULTICAST, 0);
+         response = new QueueQueryResult(name, name, true, false, null, 0, 0, true, false, false, defaultDeleteOnNoConsumers, RoutingType.MULTICAST, defaultMaxConsumers);
       } else {
          response = new QueueQueryResult(null, null, false, false, null, 0, 0, false, false, false, false, RoutingType.MULTICAST, 0);
       }
@@ -755,14 +761,18 @@ public class ActiveMQServerImpl implements ActiveMQServer {
          throw ActiveMQMessageBundle.BUNDLE.queueNameIsNull();
       }
 
-      boolean autoCreateAddresses = getAddressSettingsRepository().getMatch(name.toString()).isAutoCreateAddresses();
+      AddressSettings addressSettings = getAddressSettingsRepository().getMatch(name.toString());
+
+      boolean autoCreateAddresses = addressSettings.isAutoCreateAddresses();
+      boolean defaultDeleteOnNoConsumers = addressSettings.isDefaultDeleteOnNoConsumers();
+      int defaultMaxConsumers = addressSettings.getDefaultMaxConsumers();
 
       AddressInfo addressInfo = postOffice.getAddressInfo(name);
       AddressQueryResult response;
       if (addressInfo != null) {
-         response = new AddressQueryResult(addressInfo.getName(), addressInfo.getRoutingTypes(), addressInfo.getId(), addressInfo.isAutoCreated(), true, autoCreateAddresses);
+         response = new AddressQueryResult(addressInfo.getName(), addressInfo.getRoutingTypes(), addressInfo.getId(), addressInfo.isAutoCreated(), true, autoCreateAddresses, defaultDeleteOnNoConsumers, defaultMaxConsumers);
       } else {
-         response = new AddressQueryResult(name, null, -1, false, false, autoCreateAddresses);
+         response = new AddressQueryResult(name, null, -1, false, false, autoCreateAddresses, defaultDeleteOnNoConsumers, defaultMaxConsumers);
       }
       return response;
    }
@@ -1490,7 +1500,7 @@ public class ActiveMQServerImpl implements ActiveMQServer {
                             final SimpleString filterString,
                             final boolean durable,
                             final boolean temporary) throws Exception {
-      return createQueue(address, routingType, queueName, filterString, null, durable, temporary, ActiveMQDefaultConfiguration.getDefaultMaxQueueConsumers(), ActiveMQDefaultConfiguration.getDefaultDeleteQueueOnNoConsumers(), false);
+      return createQueue(address, routingType, queueName, filterString, null, durable, temporary, getAddressSettingsRepository().getMatch(address.toString()).getDefaultMaxConsumers(), getAddressSettingsRepository().getMatch(address.toString()).isDefaultDeleteOnNoConsumers(), false);
    }
 
    @Override
@@ -1523,7 +1533,7 @@ public class ActiveMQServerImpl implements ActiveMQServer {
                             final SimpleString user,
                             final boolean durable,
                             final boolean temporary) throws Exception {
-      return createQueue(address, routingType, queueName, filterString, user, durable, temporary, ActiveMQDefaultConfiguration.getDefaultMaxQueueConsumers(), ActiveMQDefaultConfiguration.getDefaultDeleteQueueOnNoConsumers(), true);
+      return createQueue(address, routingType, queueName, filterString, user, durable, temporary, getAddressSettingsRepository().getMatch(address.toString()).getDefaultMaxConsumers(), getAddressSettingsRepository().getMatch(address.toString()).isDefaultDeleteOnNoConsumers(), true);
    }
 
    @Override
@@ -1547,8 +1557,8 @@ public class ActiveMQServerImpl implements ActiveMQServer {
                             final boolean temporary,
                             final boolean autoCreated) throws Exception {
       return createQueue(address, routingType, queueName, filterString, user, durable, temporary,
-                         ActiveMQDefaultConfiguration.getDefaultMaxQueueConsumers(),
-                         ActiveMQDefaultConfiguration.getDefaultDeleteQueueOnNoConsumers(), autoCreated);
+                         getAddressSettingsRepository().getMatch(address.toString()).getDefaultMaxConsumers(),
+                         getAddressSettingsRepository().getMatch(address.toString()).isDefaultDeleteOnNoConsumers(), autoCreated);
    }
 
    @Override
@@ -1664,7 +1674,7 @@ public class ActiveMQServerImpl implements ActiveMQServer {
                             final boolean durable,
                             final boolean temporary,
                             final boolean autoCreated) throws Exception {
-      return deployQueue(address, routingType, queueName, filterString, durable, temporary, autoCreated, ActiveMQDefaultConfiguration.getDefaultMaxQueueConsumers(), ActiveMQDefaultConfiguration.getDefaultDeleteQueueOnNoConsumers(), true);
+      return deployQueue(address, routingType, queueName, filterString, durable, temporary, autoCreated, getAddressSettingsRepository().getMatch(address.toString()).getDefaultMaxConsumers(), getAddressSettingsRepository().getMatch(address.toString()).isDefaultDeleteOnNoConsumers(), true);
    }
 
    @Override

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3c2747f0/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 a63ee9b..5d65e05 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
@@ -18,6 +18,7 @@ package org.apache.activemq.artemis.core.settings.impl;
 
 import java.io.Serializable;
 
+import org.apache.activemq.artemis.api.config.ActiveMQDefaultConfiguration;
 import org.apache.activemq.artemis.api.core.ActiveMQBuffer;
 import org.apache.activemq.artemis.api.core.SimpleString;
 import org.apache.activemq.artemis.core.journal.EncodingSupport;
@@ -129,12 +130,16 @@ public class AddressSettings implements Mergeable<AddressSettings>, Serializable
 
    private SlowConsumerPolicy slowConsumerPolicy = null;
 
+   @Deprecated
    private Boolean autoCreateJmsQueues = null;
 
+   @Deprecated
    private Boolean autoDeleteJmsQueues = null;
 
+   @Deprecated
    private Boolean autoCreateJmsTopics = null;
 
+   @Deprecated
    private Boolean autoDeleteJmsTopics = null;
 
    private Boolean autoCreateQueues = null;
@@ -149,6 +154,10 @@ public class AddressSettings implements Mergeable<AddressSettings>, Serializable
 
    private Long maxSizeBytesRejectThreshold = null;
 
+   private Integer defaultMaxConsumers = null;
+
+   private Boolean defaultDeleteOnNoConsumers = null;
+
    //from amq5
    //make it transient
    private transient Integer queuePrefetch = null;
@@ -184,6 +193,8 @@ public class AddressSettings implements Mergeable<AddressSettings>, Serializable
       this.managementBrowsePageSize = other.managementBrowsePageSize;
       this.queuePrefetch = other.queuePrefetch;
       this.maxSizeBytesRejectThreshold = other.maxSizeBytesRejectThreshold;
+      this.defaultMaxConsumers = other.defaultMaxConsumers;
+      this.defaultDeleteOnNoConsumers = other.defaultDeleteOnNoConsumers;
    }
 
    public AddressSettings() {
@@ -269,6 +280,24 @@ public class AddressSettings implements Mergeable<AddressSettings>, Serializable
       return this;
    }
 
+   public int getDefaultMaxConsumers() {
+      return defaultMaxConsumers != null ? defaultMaxConsumers : ActiveMQDefaultConfiguration.getDefaultMaxQueueConsumers();
+   }
+
+   public AddressSettings setDefaultMaxConsumers(Integer defaultMaxConsumers) {
+      this.defaultMaxConsumers = defaultMaxConsumers;
+      return this;
+   }
+
+   public boolean isDefaultDeleteOnNoConsumers() {
+      return defaultDeleteOnNoConsumers != null ? defaultDeleteOnNoConsumers : ActiveMQDefaultConfiguration.getDefaultDeleteQueueOnNoConsumers();
+   }
+
+   public AddressSettings setDefaultDeleteOnNoConsumers(Boolean defaultDeleteOnNoConsumers) {
+      this.defaultDeleteOnNoConsumers = defaultDeleteOnNoConsumers;
+      return this;
+   }
+
    public boolean isLastValueQueue() {
       return lastValueQueue != null ? lastValueQueue : AddressSettings.DEFAULT_LAST_VALUE_QUEUE;
    }
@@ -554,6 +583,12 @@ public class AddressSettings implements Mergeable<AddressSettings>, Serializable
       if (maxSizeBytesRejectThreshold == null) {
          maxSizeBytesRejectThreshold = merged.maxSizeBytesRejectThreshold;
       }
+      if (defaultMaxConsumers == null) {
+         defaultMaxConsumers = merged.defaultMaxConsumers;
+      }
+      if (defaultDeleteOnNoConsumers == null) {
+         defaultDeleteOnNoConsumers = merged.defaultDeleteOnNoConsumers;
+      }
    }
 
    @Override
@@ -627,6 +662,10 @@ public class AddressSettings implements Mergeable<AddressSettings>, Serializable
       managementBrowsePageSize = BufferHelper.readNullableInteger(buffer);
 
       maxSizeBytesRejectThreshold = BufferHelper.readNullableLong(buffer);
+
+      defaultMaxConsumers = BufferHelper.readNullableInteger(buffer);
+
+      defaultDeleteOnNoConsumers = BufferHelper.readNullableBoolean(buffer);
    }
 
    @Override
@@ -660,7 +699,9 @@ public class AddressSettings implements Mergeable<AddressSettings>, Serializable
          BufferHelper.sizeOfNullableBoolean(autoCreateAddresses) +
          BufferHelper.sizeOfNullableBoolean(autoDeleteAddresses) +
          BufferHelper.sizeOfNullableInteger(managementBrowsePageSize) +
-         BufferHelper.sizeOfNullableLong(maxSizeBytesRejectThreshold);
+         BufferHelper.sizeOfNullableLong(maxSizeBytesRejectThreshold) +
+         BufferHelper.sizeOfNullableInteger(defaultMaxConsumers) +
+         BufferHelper.sizeOfNullableBoolean(defaultDeleteOnNoConsumers);
    }
 
    @Override
@@ -722,6 +763,10 @@ public class AddressSettings implements Mergeable<AddressSettings>, Serializable
       BufferHelper.writeNullableInteger(buffer, managementBrowsePageSize);
 
       BufferHelper.writeNullableLong(buffer, maxSizeBytesRejectThreshold);
+
+      BufferHelper.writeNullableInteger(buffer, defaultMaxConsumers);
+
+      BufferHelper.writeNullableBoolean(buffer, defaultDeleteOnNoConsumers);
    }
 
    /* (non-Javadoc)
@@ -760,7 +805,9 @@ public class AddressSettings implements Mergeable<AddressSettings>, Serializable
       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());
+      result = prime * result + ((maxSizeBytesRejectThreshold == null) ? 0 : maxSizeBytesRejectThreshold.hashCode());
+      result = prime * result + ((defaultMaxConsumers == null) ? 0 : defaultMaxConsumers.hashCode());
+      result = prime * result + ((defaultDeleteOnNoConsumers == null) ? 0 : defaultDeleteOnNoConsumers.hashCode());
       return result;
    }
 
@@ -927,6 +974,18 @@ public class AddressSettings implements Mergeable<AddressSettings>, Serializable
             return false;
       } else if (!maxSizeBytesRejectThreshold.equals(other.maxSizeBytesRejectThreshold))
          return false;
+
+      if (defaultMaxConsumers == null) {
+         if (other.defaultMaxConsumers != null)
+            return false;
+      } else if (!defaultMaxConsumers.equals(other.defaultMaxConsumers))
+         return false;
+
+      if (defaultDeleteOnNoConsumers == null) {
+         if (other.defaultDeleteOnNoConsumers != null)
+            return false;
+      } else if (!defaultDeleteOnNoConsumers.equals(other.defaultDeleteOnNoConsumers))
+         return false;
       return true;
    }
 
@@ -992,6 +1051,10 @@ public class AddressSettings implements Mergeable<AddressSettings>, Serializable
          autoDeleteAddresses +
          ", managementBrowsePageSize=" +
          managementBrowsePageSize +
+         ", defaultMaxConsumers=" +
+         defaultMaxConsumers +
+         ", defaultDeleteOnNoConsumers=" +
+         defaultDeleteOnNoConsumers +
          "]";
    }
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3c2747f0/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 6a6ec55..48562ec 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
@@ -16,6 +16,7 @@
  */
 package org.apache.activemq.artemis.core.settings;
 
+import org.apache.activemq.artemis.api.config.ActiveMQDefaultConfiguration;
 import org.apache.activemq.artemis.api.core.SimpleString;
 import org.apache.activemq.artemis.core.settings.impl.AddressFullMessagePolicy;
 import org.apache.activemq.artemis.core.settings.impl.AddressSettings;
@@ -47,6 +48,8 @@ public class AddressSettingsTest extends ActiveMQTestBase {
       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());
+      Assert.assertEquals(ActiveMQDefaultConfiguration.getDefaultDeleteQueueOnNoConsumers(), addressSettings.isDefaultDeleteOnNoConsumers());
+      Assert.assertEquals(ActiveMQDefaultConfiguration.getDefaultMaxQueueConsumers(), addressSettings.getDefaultMaxConsumers());
    }
 
    @Test

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3c2747f0/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 829410d..06d7a6f 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
@@ -584,7 +584,7 @@ public class ActiveMQServerControlTest extends ManagementTestBase {
       assertEquals(slowConsumerPolicy, info.getSlowConsumerPolicy());
       assertEquals(autoCreateJmsQueues, info.isAutoCreateJmsQueues());
       assertEquals(autoDeleteJmsQueues, info.isAutoDeleteJmsQueues());
-//      assertEquals(autoCreateJmsTopics, info.isAutoCreateJmsTopics());
+//      assertEquals(autoCreateJmsTopics, info.isAutoCreateAddresses());
       assertEquals(autoDeleteJmsTopics, info.isAutoDeleteJmsTopics());
 
       serverControl.addAddressSettings(addressMatch, DLA, expiryAddress, expiryDelay, lastValueQueue, deliveryAttempts, -1, 1000, pageMaxCacheSize, redeliveryDelay, redeliveryMultiplier, maxRedeliveryDelay, redistributionDelay, sendToDLAOnNoRoute, addressFullMessagePolicy, slowConsumerThreshold, slowConsumerCheckPeriod, slowConsumerPolicy, autoCreateJmsQueues, autoDeleteJmsQueues, autoCreateJmsTopics, autoDeleteJmsTopics);
@@ -610,7 +610,7 @@ public class ActiveMQServerControlTest extends ManagementTestBase {
       assertEquals(slowConsumerPolicy, info.getSlowConsumerPolicy());
       assertEquals(autoCreateJmsQueues, info.isAutoCreateJmsQueues());
       assertEquals(autoDeleteJmsQueues, info.isAutoDeleteJmsQueues());
-//      assertEquals(autoCreateJmsTopics, info.isAutoCreateJmsTopics());
+//      assertEquals(autoCreateJmsTopics, info.isAutoCreateAddresses());
       assertEquals(autoDeleteJmsTopics, info.isAutoDeleteJmsTopics());
 
       ex = false;

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3c2747f0/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 71bc8a1..4bf8950 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
@@ -1005,6 +1005,18 @@ public class MessageHeaderTest extends MessageHeaderTestBase {
 
       }
 
+      @Override
+      public void createQueue(SimpleString address,
+                              RoutingType routingType,
+                              SimpleString queueName,
+                              SimpleString filter,
+                              boolean durable,
+                              boolean autoCreated,
+                              int maxConsumers,
+                              boolean deleteOnNoConsumers) throws ActiveMQException {
+
+      }
+
       /**
        * Creates a <em>non-temporary</em>queue.
        *
@@ -1023,6 +1035,18 @@ public class MessageHeaderTest extends MessageHeaderTestBase {
 
       }
 
+      @Override
+      public void createQueue(String address,
+                              RoutingType routingType,
+                              String queueName,
+                              String filter,
+                              boolean durable,
+                              boolean autoCreated,
+                              int maxConsumers,
+                              boolean deleteOnNoConsumers) throws ActiveMQException {
+
+      }
+
       /**
        * Creates a <em>temporary</em> queue.
        *


Mime
View raw message