Details
Description
The attached test case tests slow consumer handling with a variety of topic policies and SessionFactory/ConnectionFactory settings. The expectation is that a normal (i.e. fast) consumer will continue to receive messages whilst a slow consumer is blocking.
Without a prefetch limit, the expected behaviour is seen with setOptimizeAcknowledge both true and false.
If a prefetch limit is set, setOptimizeAcknowledge(true) causes the normal/fast consumer to miss messages whilst the slow consumer is blocking.
Would be nice to be able to turn on OptimiseAcknowledge for performance reasons, however it is also necessary to set the prefetch limit in order to trigger SlowConsumerStrategy/MessageEvictionStrategySupport logic.
Publisher: Send 0 SlowConsumer: Receive 0 FastConsumer: Receive 0 testDefaultSettings: Publisher Sent: 30 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29] testDefaultSettings: Whilst slow consumer blocked: - SlowConsumer Received: 1 [0] - FastConsumer Received: 30 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29] testDefaultSettings: After slow consumer unblocked: - SlowConsumer Received: 30 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29] - FastConsumer Received: 30 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29]
testDefaultSettingsWithOptimiseAcknowledge: Publisher Sent: 30 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29] testDefaultSettingsWithOptimiseAcknowledge: Whilst slow consumer blocked: - SlowConsumer Received: 1 [0] - FastConsumer Received: 30 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29] testDefaultSettingsWithOptimiseAcknowledge: After slow consumer unblocked: - SlowConsumer Received: 30 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29] - FastConsumer Received: 30 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29]
testBounded: Publisher Sent: 30 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29] testBounded: Whilst slow consumer blocked: - SlowConsumer Received: 1 [0] - FastConsumer Received: 30 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29] testBounded: After slow consumer unblocked: - SlowConsumer Received: 10 [0, 1, 2, 3, 4, 25, 26, 27, 28, 29] - FastConsumer Received: 30 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29]
testBoundedWithOptimiseAcknowledge: Publisher Sent: 30 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29] testBoundedWithOptimiseAcknowledge: Whilst slow consumer blocked: - SlowConsumer Received: 1 [0] - FastConsumer Received: 5 [0, 1, 2, 3, 4] testBoundedWithOptimiseAcknowledge: After slow consumer unblocked: - SlowConsumer Received: 5 [0, 1, 2, 3, 4] - FastConsumer Received: 5 [0, 1, 2, 3, 4] java.lang.AssertionError: Fast consumer missed messages whilst slow consumer was blocking expected:<[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29]> but was:<[0, 1, 2, 3, 4]>
Attachments
Attachments
Issue Links
- relates to
-
AMQ-3676 Setting OptimizeAcknowledge on a consumer with a small prefetch size appears to prevent messages from being acknowledged
- Closed