activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbert...@apache.org
Subject [11/48] activemq-artemis git commit: Fix AutoCreateQueueClusterTest
Date Wed, 23 Nov 2016 17:43:12 GMT
Fix AutoCreateQueueClusterTest


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

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

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


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

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

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


Mime
View raw message