Commit f4a3881
committed
Null-proof message ignored listener
The message ignored listener in the consumer coordinator calls the
processed method on ignored messages to "simulate" the processing (e.g.
increment a counter to provide a credit in the middle of the chunk).
The MessageProcessedCallback is the chunk context in this case, which
can be null, depending on the consumer flow strategy. The listener could
trigger a null-pointer exception by calling the processed method on the
context.
This commit adds a null check to avoid the null-pointer exception. A null
chunk context (MessageProcessedCallback) means the custom behavior of
the consumer flow strategy is performed when the chunk starts, so the
call to MessageHandler.Context#processed() is not necessary.1 parent 66d7aee commit f4a3881
File tree
1 file changed
+12
-10
lines changed- src/main/java/com/rabbitmq/stream/impl
1 file changed
+12
-10
lines changedLines changed: 12 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
717 | 717 | | |
718 | 718 | | |
719 | 719 | | |
720 | | - | |
721 | | - | |
722 | | - | |
723 | | - | |
724 | | - | |
725 | | - | |
726 | | - | |
727 | | - | |
728 | | - | |
729 | | - | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
730 | 732 | | |
731 | 733 | | |
732 | 734 | | |
| |||
0 commit comments