Commit 14fe215
committed
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`
**Auto-cherry-pick to `3.2.x` & `3.1.x`**stop()
1 parent 1dd3f4d commit 14fe215
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 | |
|---|---|---|---|
| |||
464 | 464 | | |
465 | 465 | | |
466 | 466 | | |
467 | | - | |
| 467 | + | |
468 | 468 | | |
469 | 469 | | |
470 | 470 | | |
471 | 471 | | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
472 | 478 | | |
473 | 479 | | |
474 | | - | |
475 | | - | |
476 | | - | |
477 | | - | |
478 | | - | |
479 | 480 | | |
480 | 481 | | |
481 | 482 | | |
| |||
559 | 560 | | |
560 | 561 | | |
561 | 562 | | |
562 | | - | |
563 | | - | |
564 | | - | |
565 | | - | |
566 | | - | |
567 | | - | |
568 | | - | |
569 | | - | |
570 | | - | |
571 | | - | |
572 | | - | |
573 | | - | |
574 | | - | |
575 | | - | |
576 | | - | |
577 | | - | |
578 | | - | |
579 | | - | |
580 | | - | |
581 | | - | |
582 | | - | |
583 | | - | |
584 | | - | |
585 | | - | |
586 | | - | |
587 | | - | |
588 | | - | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
589 | 567 | | |
590 | | - | |
| 568 | + | |
591 | 569 | | |
592 | 570 | | |
593 | 571 | | |
| |||
815 | 793 | | |
816 | 794 | | |
817 | 795 | | |
818 | | - | |
819 | | - | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
820 | 806 | | |
821 | | - | |
822 | | - | |
823 | | - | |
824 | | - | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
825 | 811 | | |
826 | 812 | | |
827 | 813 | | |
| |||
0 commit comments