Skip to content

Commit 1715d7b

Browse files
committed
Do not check for CC deletion for RabbitMQ 3.13+
After message container merge, when a message is dead-lettered with a routing key. (cherry picked from commit 1f3f444)
1 parent 7f3f9d3 commit 1715d7b

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

src/test/java/com/rabbitmq/client/test/BrokerTestCase.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,13 @@
2828
import java.util.UUID;
2929
import java.util.concurrent.TimeoutException;
3030

31+
import static com.rabbitmq.client.test.TestUtils.currentVersion;
32+
import static com.rabbitmq.client.test.TestUtils.versionCompare;
3133
import static org.junit.jupiter.api.Assertions.*;
3234

3335
public class BrokerTestCase {
3436

37+
private String brokerVersion;
3538
private boolean ha = false;
3639

3740
protected volatile TestInfo testInfo;
@@ -65,6 +68,7 @@ public void setUp(TestInfo testInfo) throws IOException, TimeoutException {
6568
Assumptions.assumeTrue(shouldRun());
6669
this.testInfo = testInfo;
6770
openConnection();
71+
this.brokerVersion = currentVersion(this.connection.getServerProperties().get("version").toString());
6872
openChannel();
6973

7074
createResources();
@@ -343,4 +347,8 @@ protected boolean ha() {
343347
return this.ha;
344348
}
345349

350+
protected boolean beforeMessageContainers() {
351+
return versionCompare(this.brokerVersion, "3.13.0") < 0;
352+
}
353+
346354
}

src/test/java/com/rabbitmq/client/test/TestUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ private static boolean atLeastVersion(String expectedVersion, String currentVers
141141
}
142142
}
143143

144-
private static String currentVersion(String currentVersion) {
144+
static String currentVersion(String currentVersion) {
145145
// versions built from source: 3.7.0+rc.1.4.gedc5d96
146146
if (currentVersion.contains("+")) {
147147
currentVersion = currentVersion.substring(0, currentVersion.indexOf("+"));

src/test/java/com/rabbitmq/client/test/functional/DeadLetterExchange.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,9 @@ public void handleDelivery(String consumerTag, Envelope envelope,
394394
consumeN(DLQ2, MSG_COUNT, getResponse -> {
395395
Map<String, Object> headers1 = getResponse.getProps().getHeaders();
396396
assertNotNull(headers1);
397-
assertNull(headers1.get("CC"));
397+
if (beforeMessageContainers()) {
398+
assertNull(headers1.get("CC"));
399+
}
398400
assertNull(headers1.get("BCC"));
399401

400402
ArrayList<Object> death = (ArrayList<Object>) headers1.get("x-death");

0 commit comments

Comments
 (0)