You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by or...@apache.org on 2024/03/26 07:42:44 UTC

(camel) 01/02: CAMEL-19832: send more messages to force them to be pulled

This is an automated email from the ASF dual-hosted git repository.

orpiske pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git

commit c2ad3be41919d7df9593a30aab6db9fd1f03548c
Author: Otavio Rodolfo Piske <an...@gmail.com>
AuthorDate: Fri Mar 22 11:48:35 2024 +0100

    CAMEL-19832: send more messages to force them to be pulled
---
 .../camel/component/rocketmq/RocketMQRequestReplyRouteIT.java     | 6 +++++-
 .../java/org/apache/camel/component/rocketmq/RocketMQRouteIT.java | 8 ++++++--
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/components/camel-rocketmq/src/test/java/org/apache/camel/component/rocketmq/RocketMQRequestReplyRouteIT.java b/components/camel-rocketmq/src/test/java/org/apache/camel/component/rocketmq/RocketMQRequestReplyRouteIT.java
index ccad6958a12..eb9ec64648f 100644
--- a/components/camel-rocketmq/src/test/java/org/apache/camel/component/rocketmq/RocketMQRequestReplyRouteIT.java
+++ b/components/camel-rocketmq/src/test/java/org/apache/camel/component/rocketmq/RocketMQRequestReplyRouteIT.java
@@ -54,6 +54,8 @@ public class RocketMQRequestReplyRouteIT extends RocketMQTestSupport {
 
     private static final String EXPECTED_MESSAGE = "Hi.";
 
+    private static final int MESSAGE_COUNT = 5;
+
     private MockEndpoint resultEndpoint;
 
     private DefaultMQPushConsumer replierConsumer;
@@ -119,7 +121,9 @@ public class RocketMQRequestReplyRouteIT extends RocketMQTestSupport {
         resultEndpoint.expectedBodiesReceived(EXPECTED_MESSAGE);
         resultEndpoint.message(0).header(RocketMQConstants.TOPIC).isEqualTo("REPLY_TO_TOPIC");
 
-        template.sendBody(START_ENDPOINT_URI, "hello, RocketMQ.");
+        for (int i = 0; i < MESSAGE_COUNT; i++) {
+            template.sendBody(START_ENDPOINT_URI, "hello, RocketMQ.");
+        }
 
         resultEndpoint.assertIsSatisfied();
     }
diff --git a/components/camel-rocketmq/src/test/java/org/apache/camel/component/rocketmq/RocketMQRouteIT.java b/components/camel-rocketmq/src/test/java/org/apache/camel/component/rocketmq/RocketMQRouteIT.java
index 8af0c846da6..9cede0d4ccb 100644
--- a/components/camel-rocketmq/src/test/java/org/apache/camel/component/rocketmq/RocketMQRouteIT.java
+++ b/components/camel-rocketmq/src/test/java/org/apache/camel/component/rocketmq/RocketMQRouteIT.java
@@ -41,9 +41,11 @@ public class RocketMQRouteIT extends RocketMQTestSupport {
 
     private static final String RESULT_ENDPOINT_URI = "mock:result";
 
+    private static final int MESSAGE_COUNT = 5;
+
     private MockEndpoint resultEndpoint;
 
-    private CountDownLatch latch = new CountDownLatch(1);
+    private CountDownLatch latch = new CountDownLatch(MESSAGE_COUNT);
 
     @BeforeAll
     static void beforeAll() throws Exception {
@@ -87,7 +89,9 @@ public class RocketMQRouteIT extends RocketMQTestSupport {
         resultEndpoint.message(0).header(RocketMQConstants.TOPIC).isEqualTo("START_TOPIC");
         resultEndpoint.message(0).header(RocketMQConstants.TAG).isEqualTo("startTag");
 
-        template.sendBody(START_ENDPOINT_URI, EXPECTED_MESSAGE);
+        for (int i = 0; i < MESSAGE_COUNT; i++) {
+            template.sendBody(START_ENDPOINT_URI, EXPECTED_MESSAGE);
+        }
 
         Assertions.assertTrue(latch.await(5, TimeUnit.SECONDS), "Should have received a message");
         resultEndpoint.assertIsSatisfied();