You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2026/08/24 17:07:02 UTC
(camel) branch backport/25630-to-camel-4.22.x created (now a004b9f79828)
This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a change to branch backport/25630-to-camel-4.22.x
in repository https://gitbox.apache.org/repos/asf/camel.git
at a004b9f79828 chore: fix NATS JetStream IT tests sharing a stream/durable name (#25630)
This branch includes the following new commits:
new a004b9f79828 chore: fix NATS JetStream IT tests sharing a stream/durable name (#25630)
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
(camel) 01/01: chore: fix NATS JetStream IT tests sharing a stream/durable name (#25630)
Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch backport/25630-to-camel-4.22.x
in repository https://gitbox.apache.org/repos/asf/camel.git
commit a004b9f798286c9a5643cfd3a933110324b30791
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Mon Aug 24 19:04:45 2026 +0200
chore: fix NATS JetStream IT tests sharing a stream/durable name (#25630)
NatsJetstreamConsumerAckPolicyNoneIT, NatsJetstreamConsumerMaxDeliverIT, and
NatsJetstreamConsumerRedeliveryIT all used the identical JetStream stream
name, subject, and durable consumer name. NatsITSupport does not tear down
streams/consumers between IT classes, and NatsConsumer.setupJetStreamConsumer()
never reconciles an existing durable consumer's config with a new subscribe
request, so whichever test ran first bound its ackPolicy/maxDeliver config to
the shared durable consumer server-side, and the next test(s) in the suite
silently bound to that stale, mismatched consumer and received zero messages.
This is why two of the three tests were previously guarded with
@DisabledIfSystemProperty for being flaky on GitHub Actions; the guard was
removed without addressing the underlying collision.
Give each test its own unique stream/subject/durable name, matching the
convention already used by the other JetStream IT tests in this package.
Test-only change, no production code touched.
Signed-off-by: Claus Ibsen <cl...@gmail.com>
Co-authored-by: Claude <no...@anthropic.com>
---
.../nats/jetstream/NatsJetstreamConsumerAckPolicyNoneIT.java | 6 +++---
.../component/nats/jetstream/NatsJetstreamConsumerMaxDeliverIT.java | 4 ++--
.../component/nats/jetstream/NatsJetstreamConsumerRedeliveryIT.java | 6 +++---
3 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/components/camel-nats/src/test/java/org/apache/camel/component/nats/jetstream/NatsJetstreamConsumerAckPolicyNoneIT.java b/components/camel-nats/src/test/java/org/apache/camel/component/nats/jetstream/NatsJetstreamConsumerAckPolicyNoneIT.java
index 11a408588ead..a265f88d7931 100644
--- a/components/camel-nats/src/test/java/org/apache/camel/component/nats/jetstream/NatsJetstreamConsumerAckPolicyNoneIT.java
+++ b/components/camel-nats/src/test/java/org/apache/camel/component/nats/jetstream/NatsJetstreamConsumerAckPolicyNoneIT.java
@@ -40,12 +40,12 @@ public class NatsJetstreamConsumerAckPolicyNoneIT extends NatsITSupport {
@Test
public void testConsumer() throws Exception {
mockResultEndpoint.expectedBodiesReceived("Hello World 3");
- mockResultEndpoint.expectedHeaderReceived(NatsConstants.NATS_SUBJECT, "mytopic2");
+ mockResultEndpoint.expectedHeaderReceived(NatsConstants.NATS_SUBJECT, "mytopic2-ackpolicynone");
mockResultEndpoint.expectedHeaderReceived("counter", 3);
mockResultEndpoint.expectedHeaderReceived(NatsConstants.NATS_DELIVERY_COUNTER, 1);
mockInputEndpoint.expectedBodiesReceived("Hello World 1", "Hello World 2", "Hello World 3");
- mockInputEndpoint.expectedHeaderReceived(NatsConstants.NATS_SUBJECT, "mytopic2");
+ mockInputEndpoint.expectedHeaderReceived(NatsConstants.NATS_SUBJECT, "mytopic2-ackpolicynone");
mockInputEndpoint.message(0).header(NatsConstants.NATS_DELIVERY_COUNTER).isEqualTo(1);
mockInputEndpoint.message(1).header(NatsConstants.NATS_DELIVERY_COUNTER).isEqualTo(1);
mockInputEndpoint.message(2).header(NatsConstants.NATS_DELIVERY_COUNTER).isEqualTo(1);
@@ -65,7 +65,7 @@ public class NatsJetstreamConsumerAckPolicyNoneIT extends NatsITSupport {
@Override
public void configure() {
String uri
- = "nats:mytopic2?jetstreamEnabled=true&jetstreamName=mystream2&jetstreamAsync=false&durableName=camel2&pullSubscription=false&ackPolicy=none";
+ = "nats:mytopic2-ackpolicynone?jetstreamEnabled=true&jetstreamName=mystream2-ackpolicynone&jetstreamAsync=false&durableName=camel2-ackpolicynone&pullSubscription=false&ackPolicy=none";
from("direct:send")
// when running full test suite then send can fail due to nats server setup/teardown
diff --git a/components/camel-nats/src/test/java/org/apache/camel/component/nats/jetstream/NatsJetstreamConsumerMaxDeliverIT.java b/components/camel-nats/src/test/java/org/apache/camel/component/nats/jetstream/NatsJetstreamConsumerMaxDeliverIT.java
index 53470c80b6fa..cc78a43432a2 100644
--- a/components/camel-nats/src/test/java/org/apache/camel/component/nats/jetstream/NatsJetstreamConsumerMaxDeliverIT.java
+++ b/components/camel-nats/src/test/java/org/apache/camel/component/nats/jetstream/NatsJetstreamConsumerMaxDeliverIT.java
@@ -42,7 +42,7 @@ public class NatsJetstreamConsumerMaxDeliverIT extends NatsITSupport {
mockResultEndpoint.expectedMessageCount(0);
mockInputEndpoint.expectedMessageCount(3);
- mockInputEndpoint.expectedHeaderReceived(NatsConstants.NATS_SUBJECT, "mytopic2");
+ mockInputEndpoint.expectedHeaderReceived(NatsConstants.NATS_SUBJECT, "mytopic2-maxdeliver");
mockInputEndpoint.message(0).header(NatsConstants.NATS_DELIVERY_COUNTER).isEqualTo(1);
mockInputEndpoint.message(1).header(NatsConstants.NATS_DELIVERY_COUNTER).isEqualTo(2);
mockInputEndpoint.message(2).header(NatsConstants.NATS_DELIVERY_COUNTER).isEqualTo(3);
@@ -60,7 +60,7 @@ public class NatsJetstreamConsumerMaxDeliverIT extends NatsITSupport {
@Override
public void configure() {
String uri
- = "nats:mytopic2?jetstreamEnabled=true&jetstreamName=mystream2&jetstreamAsync=false&durableName=camel2&pullSubscription=false&nackWait=10&maxDeliver=3";
+ = "nats:mytopic2-maxdeliver?jetstreamEnabled=true&jetstreamName=mystream2-maxdeliver&jetstreamAsync=false&durableName=camel2-maxdeliver&pullSubscription=false&nackWait=10&maxDeliver=3";
from("direct:send")
// when running full test suite then send can fail due to nats server setup/teardown
diff --git a/components/camel-nats/src/test/java/org/apache/camel/component/nats/jetstream/NatsJetstreamConsumerRedeliveryIT.java b/components/camel-nats/src/test/java/org/apache/camel/component/nats/jetstream/NatsJetstreamConsumerRedeliveryIT.java
index 3690e35f8ed8..cbcbf5371500 100644
--- a/components/camel-nats/src/test/java/org/apache/camel/component/nats/jetstream/NatsJetstreamConsumerRedeliveryIT.java
+++ b/components/camel-nats/src/test/java/org/apache/camel/component/nats/jetstream/NatsJetstreamConsumerRedeliveryIT.java
@@ -40,12 +40,12 @@ public class NatsJetstreamConsumerRedeliveryIT extends NatsITSupport {
@Test
public void testConsumer() throws Exception {
mockResultEndpoint.expectedBodiesReceived("Hello World");
- mockResultEndpoint.expectedHeaderReceived(NatsConstants.NATS_SUBJECT, "mytopic2");
+ mockResultEndpoint.expectedHeaderReceived(NatsConstants.NATS_SUBJECT, "mytopic2-redelivery");
mockResultEndpoint.expectedHeaderReceived("counter", 3);
mockResultEndpoint.expectedHeaderReceived(NatsConstants.NATS_DELIVERY_COUNTER, 3);
mockInputEndpoint.expectedMessageCount(3);
- mockInputEndpoint.expectedHeaderReceived(NatsConstants.NATS_SUBJECT, "mytopic2");
+ mockInputEndpoint.expectedHeaderReceived(NatsConstants.NATS_SUBJECT, "mytopic2-redelivery");
mockInputEndpoint.message(0).header(NatsConstants.NATS_DELIVERY_COUNTER).isEqualTo(1);
mockInputEndpoint.message(1).header(NatsConstants.NATS_DELIVERY_COUNTER).isEqualTo(2);
mockInputEndpoint.message(2).header(NatsConstants.NATS_DELIVERY_COUNTER).isEqualTo(3);
@@ -63,7 +63,7 @@ public class NatsJetstreamConsumerRedeliveryIT extends NatsITSupport {
@Override
public void configure() {
String uri
- = "nats:mytopic2?jetstreamEnabled=true&jetstreamName=mystream2&jetstreamAsync=false&durableName=camel2&pullSubscription=false&nackWait=10";
+ = "nats:mytopic2-redelivery?jetstreamEnabled=true&jetstreamName=mystream2-redelivery&jetstreamAsync=false&durableName=camel2-redelivery&pullSubscription=false&nackWait=10";
from("direct:send")
// when running full test suite then send can fail due to nats server setup/teardown