franz1981 commented on a change in pull request #3876:
URL: https://github.com/apache/activemq-artemis/pull/3876#discussion_r766732410



##########
File path: 
tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/paging/FloodServerWithAsyncSendTest.java
##########
@@ -0,0 +1,174 @@
+/*
+ * 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.smoke.paging;
+
+import javax.jms.Connection;
+import javax.jms.ConnectionFactory;
+import javax.jms.MessageConsumer;
+import javax.jms.MessageProducer;
+import javax.jms.Queue;
+import javax.jms.Session;
+import javax.jms.TextMessage;
+import java.util.concurrent.atomic.AtomicInteger;
+
+import org.apache.activemq.artemis.tests.smoke.common.SmokeTestBase;
+import org.apache.activemq.artemis.tests.util.CFUtil;
+import org.apache.activemq.artemis.utils.RandomUtil;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+public class FloodServerWithAsyncSendTest extends SmokeTestBase {
+
+   public static final String SERVER_NAME_0 = "paging";
+
+   volatile boolean running = true;
+
+   AtomicInteger errors = new AtomicInteger(0);
+
+   @Before
+   public void before() throws Exception {
+      cleanupData(SERVER_NAME_0);
+      startServer(SERVER_NAME_0, 0, 30000);
+   }
+
+   @Test
+   public void testAsyncPagingOpenWire() throws Exception {
+      String protocol = "OPENWIRE";
+      internalTest(protocol);
+
+   }
+
+   ConnectionFactory newCF(String protocol) {
+      if (protocol.equalsIgnoreCase("OPENWIRE")) {
+         return CFUtil.createConnectionFactory(protocol, 
"tcp://localhost:61616?jms.useAsyncSend=true");
+      } else {
+         Assert.fail("unsuported protocol");
+         return null;
+      }
+   }
+
+   private void internalTest(String protocol) throws Exception {
+
+      Thread consume1 = new Thread(() -> consume(protocol, "queue1"), 
"ProducerQueue1");
+      consume1.start();
+      Thread consume2 = new Thread(() -> consume(protocol, "queue2"), 
"ProducerQueue2");
+      consume2.start();
+
+      Thread produce1 = new Thread(() -> produce(protocol, "queue1"), 
"ConsumerQueue1");
+      produce1.start();
+      Thread produce2 = new Thread(() -> produce(protocol, "queue2"), 
"ConsumerQueue2");
+      produce2.start();
+
+      Thread.sleep(10_000);

Review comment:
       Yeah, in this case is a limit aware actor in this case: it better 
capture what it does




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to