Fix bug in the RabbitAmqpListenerTests for consumeIsDone
The logic if the `processQ1AndQ2Data()` listener method is to collect 10 messages, where one of them is a duplication after `requeue`. The first `discard` is accepted into `received` result, but the second is terminated by the exception. However, `countDown()` in the `finally` block is still called for all the cases. Therefore, `11` times: 7 for normal data, 1 for `discard`, 2 for `requeue`, and 1 for exception.
This commit is contained in:
@@ -170,7 +170,7 @@ class RabbitAmqpListenerTests extends RabbitAmqpTestBase {
|
||||
|
||||
final List<String> received = Collections.synchronizedList(new ArrayList<>());
|
||||
|
||||
CountDownLatch consumeIsDone = new CountDownLatch(10);
|
||||
CountDownLatch consumeIsDone = new CountDownLatch(11);
|
||||
|
||||
@RabbitListener(queues = {"q1", "q2"},
|
||||
ackMode = "#{T(org.springframework.amqp.core.AcknowledgeMode).MANUAL}",
|
||||
|
||||
Reference in New Issue
Block a user