Quantcast

[1/2] activemq-artemis git commit: ARTEMIS-1023 - fixx Openwire auto creation of queues

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[1/2] activemq-artemis git commit: ARTEMIS-1023 - fixx Openwire auto creation of queues

clebertsuconic-2
Repository: activemq-artemis
Updated Branches:
  refs/heads/master a4beb18a6 -> e105e4a60


ARTEMIS-1023 - fixx Openwire auto creation of queues

https://issues.apache.org/jira/browse/ARTEMIS-1023


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

Branch: refs/heads/master
Commit: 8ab7588910ae6391c8ec4a0998886d6fc4cb5f53
Parents: a4beb18
Author: Andy Taylor <[hidden email]>
Authored: Fri Mar 17 12:28:10 2017 +0000
Committer: Andy Taylor <[hidden email]>
Committed: Fri Mar 17 12:28:10 2017 +0000

----------------------------------------------------------------------
 .../protocol/openwire/OpenWireConnection.java   |  2 +-
 .../artemis/core/server/ActiveMQServer.java     |  3 +
 .../core/server/impl/ActiveMQServerImpl.java    | 12 ++++
 .../amq/ProducerAutoCreateQueueTest.java        | 59 ++++++++++++++++++++
 4 files changed, 75 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/8ab75889/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 46fe372..6b1b579 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
@@ -731,7 +731,7 @@ public class OpenWireConnection extends AbstractRemotingConnection implements Se
                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, RoutingType.ANYCAST, qName, connInfo == null ? null : SimpleString.toSimpleString(connInfo.getUserName()), true, false);
+               server.createQueue(qName, RoutingType.ANYCAST, qName, connInfo == null ? null : SimpleString.toSimpleString(connInfo.getUserName()), null,true, false);
             }
          }
       }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/8ab75889/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 5798142..bfd9aec 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
@@ -287,6 +287,9 @@ public interface ActiveMQServer extends ServiceComponent {
    Queue createQueue(SimpleString address, RoutingType routingType, SimpleString queueName, SimpleString filter,
                      boolean durable, boolean temporary) throws Exception;
 
+   Queue createQueue(final SimpleString address, final RoutingType routingType, final SimpleString queueName, final SimpleString user,
+                               final SimpleString filterString,  final boolean durable, final boolean temporary) throws Exception;
+
    Queue createQueue(SimpleString address, RoutingType routingType, SimpleString queueName, SimpleString filter,
                      boolean durable, boolean temporary, int maxConsumers, boolean purgeOnNoConsumers,
                      boolean autoCreateAddress) throws Exception;

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/8ab75889/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 c31a323..7351b1e 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
@@ -1531,6 +1531,18 @@ public class ActiveMQServerImpl implements ActiveMQServer {
    public Queue createQueue(final SimpleString address,
                             final RoutingType routingType,
                             final SimpleString queueName,
+                            final SimpleString user,
+                            final SimpleString filterString,
+                            final boolean durable,
+                            final boolean temporary) throws Exception {
+      AddressSettings as = getAddressSettingsRepository().getMatch(address.toString());
+      return createQueue(address, routingType, queueName, filterString, user, durable, temporary, false, as.getDefaultMaxConsumers(), as.isDefaultPurgeOnNoConsumers(), as.isAutoCreateAddresses());
+   }
+
+   @Override
+   public Queue createQueue(final SimpleString address,
+                            final RoutingType routingType,
+                            final SimpleString queueName,
                             final SimpleString filter,
                             final boolean durable,
                             final boolean temporary,

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/8ab75889/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/ProducerAutoCreateQueueTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/ProducerAutoCreateQueueTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/ProducerAutoCreateQueueTest.java
new file mode 100644
index 0000000..c45ff7d
--- /dev/null
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/ProducerAutoCreateQueueTest.java
@@ -0,0 +1,59 @@
+/*
+ * 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.openwire.amq;
+
+import org.apache.activemq.artemis.api.core.SimpleString;
+import org.apache.activemq.artemis.core.config.Configuration;
+import org.apache.activemq.artemis.core.settings.impl.AddressSettings;
+import org.apache.activemq.artemis.tests.integration.openwire.BasicOpenWireTest;
+import org.junit.Assert;
+import org.junit.Test;
+
+import javax.jms.Connection;
+import javax.jms.MessageProducer;
+import javax.jms.Queue;
+import javax.jms.Session;
+import java.util.Map;
+
+public class ProducerAutoCreateQueueTest extends BasicOpenWireTest {
+
+   @Override
+   protected void extraServerConfig(Configuration serverConfig) {
+      String match = "#";
+      Map<String, AddressSettings> asMap = serverConfig.getAddressesSettings();
+      asMap.get(match).setAutoCreateAddresses(true).setAutoCreateQueues(true);
+   }
+
+   @Test
+   public void testProducerBlockWontGetTimeout() throws Exception {
+      Connection connection = null;
+      try {
+         connection = factory.createConnection("admin", "password");
+         Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+         Queue trash = session.createQueue("trash");
+         final MessageProducer producer = session.createProducer(trash);
+         producer.send(session.createTextMessage("foo"));
+         Assert.assertNotNull(server.getPostOffice().getBinding(new SimpleString("trash")));
+      } finally {
+         if (connection != null) {
+            connection.close();
+         }
+      }
+
+
+   }
+}

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[2/2] activemq-artemis git commit: This closes #1100

clebertsuconic-2
This closes #1100


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

Branch: refs/heads/master
Commit: e105e4a60fffb1db73b70f9b75f5b7c6fbe8e252
Parents: a4beb18 8ab7588
Author: Clebert Suconic <[hidden email]>
Authored: Fri Mar 17 15:06:58 2017 -0400
Committer: Clebert Suconic <[hidden email]>
Committed: Fri Mar 17 15:06:58 2017 -0400

----------------------------------------------------------------------
 .../protocol/openwire/OpenWireConnection.java   |  2 +-
 .../artemis/core/server/ActiveMQServer.java     |  3 +
 .../core/server/impl/ActiveMQServerImpl.java    | 12 ++++
 .../amq/ProducerAutoCreateQueueTest.java        | 59 ++++++++++++++++++++
 4 files changed, 75 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


Loading...