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



##########
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:
       > Generally looking good, but I'm still not sold on the bound actor 
abstraction because:
   > 
   > * `act` can be called by several threads concurrently while OpenWire does 
is single-thread, hence the behaviour in a general purpose context won't be the 
same
   > * I cannot still fit in my mind what `flush` means and why it call 
`overLimit::run` regardless current actor pending size
   > 
   > I'm looking how the reactive stream abstraction is implemented in other 
systems because we probably need a backpressure advertizing mechanism with an 
overflow strategy that can accumulate beyond expected capacity and maybe 
there's already something implemented/tested around
   
   this is about stop reading after a certain limit is over. I still need to 
parse everything that's on the buffer.. I can't just limit the actor here... 
things would break otherwise.




-- 
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