Commit b25ae82
GH-3039: Move Recovery in BlockingQueueConsumer into
Fixes: #3039
Issue link: #3039
Currently, the `BlockingQueueConsumer` initiates a Basic Recovery command on the
channel for transactional consumer immediately after Basic Cancel.
However, it is possible still to try to handle in-flight messages during `shutdownTimeout`
in the listener container
* Leave only Basic Cancel command in the `BlockingQueueConsumer.basicCancel()` API
* Revert `BlockingQueueConsumer.nextMessage(timeout)` method logic to normal loop
until message pulled from the in-memory cache is `null`
* Call `basicCancel(true)` from the `stop()` is not cancelled yet
* Perform `channel.basicRecover()` for transactional channel in the `stop()`.
This `stop()` is usually called from the listener container when in-flight messages
have not been processed during `shutdownTimeout`
(cherry picked from commit 14fe215)stop()
1 parent 2dc9c56 commit b25ae82
File tree
1 file changed
+26
-40
lines changed- spring-rabbit/src/main/java/org/springframework/amqp/rabbit/listener
1 file changed
+26
-40
lines changedLines changed: 26 additions & 40 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
461 | 461 | | |
462 | 462 | | |
463 | 463 | | |
464 | | - | |
| 464 | + | |
465 | 465 | | |
466 | 466 | | |
467 | 467 | | |
468 | 468 | | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
469 | 475 | | |
470 | 476 | | |
471 | | - | |
472 | | - | |
473 | | - | |
474 | | - | |
475 | | - | |
476 | 477 | | |
477 | 478 | | |
478 | 479 | | |
| |||
555 | 556 | | |
556 | 557 | | |
557 | 558 | | |
558 | | - | |
559 | | - | |
560 | | - | |
561 | | - | |
562 | | - | |
563 | | - | |
564 | | - | |
565 | | - | |
566 | | - | |
567 | | - | |
568 | | - | |
569 | | - | |
570 | | - | |
571 | | - | |
572 | | - | |
573 | | - | |
574 | | - | |
575 | | - | |
576 | | - | |
577 | | - | |
578 | | - | |
579 | | - | |
580 | | - | |
581 | | - | |
582 | | - | |
583 | | - | |
584 | | - | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
585 | 563 | | |
586 | | - | |
| 564 | + | |
587 | 565 | | |
588 | 566 | | |
589 | 567 | | |
| |||
809 | 787 | | |
810 | 788 | | |
811 | 789 | | |
812 | | - | |
813 | | - | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
814 | 800 | | |
815 | | - | |
816 | | - | |
817 | | - | |
818 | | - | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
819 | 805 | | |
820 | 806 | | |
821 | 807 | | |
| |||
0 commit comments