Skip to content

Commit 0defd4b

Browse files
committed
test confirm for messages expired with x-message-ttl=0
1 parent fdc0c0d commit 0defd4b

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

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

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,6 @@ protected void setUp() throws IOException {
5454
channel.queueDeclare("confirm-test-2", true, true, false, null);
5555
channel.basicConsume("confirm-test-2", true,
5656
new DefaultConsumer(channel));
57-
Map<String, Object> argMap =
58-
Collections.singletonMap(TTL_ARG, (Object)1);
59-
channel.queueDeclare("confirm-ttl", true, true, false, argMap);
6057
channel.queueBind("confirm-test", "amq.direct",
6158
"confirm-multiple-queues");
6259
channel.queueBind("confirm-test-2", "amq.direct",
@@ -140,9 +137,16 @@ public void testBasicReject()
140137
public void testQueueTTL()
141138
throws IOException, InterruptedException
142139
{
143-
publishN("", "confirm-ttl", true, false, false);
140+
for (int ttl : new int[]{ 1, 0 }) {
141+
Map<String, Object> argMap =
142+
Collections.singletonMap(TTL_ARG, (Object)ttl);
143+
channel.queueDeclare("confirm-ttl", true, true, false, argMap);
144144

145-
channel.waitForConfirmsOrDie();
145+
publishN("", "confirm-ttl", true, false, false);
146+
channel.waitForConfirmsOrDie();
147+
148+
channel.queueDelete("confirm-ttl");
149+
}
146150
}
147151

148152
public void testBasicRejectRequeue()

0 commit comments

Comments
 (0)