Skip to content

Commit

Permalink
BeforeFinallyHttpOperator: support re-subscribe to the message body (
Browse files Browse the repository at this point in the history
…#2409)

Motivation:

`BeforeFinallyHttpOperator` has a single `state` inside `ResponseCompletionSubscriber` that is shared between `Single` and `Publisher` of the message body. If users re-subscribe to the message body, the state is already in `TERMINATED` position and does not propagate signals.

Modifications:

- Move message body processing logic into a new `MessageBodySubscriber` class;
- Each subscribe operation creates a new `MessageBodySubscriber` and their states are managed independently;
- Improve `IdleTimeoutConnectionFilterTest` to always create a new response object (otherwise, the response payload body can be transformed multiple times);

Result:

Users of `BeforeFinallyOperator` always see all terminal events, even for re-subscribe. Terminal signal will always be delivered to the second subscriber, even when `discardEventsAfterCancel` is set.
  • Loading branch information
idelpivnitskiy authored Oct 27, 2022
1 parent 78c3ee0 commit 5d22672
Show file tree
Hide file tree
Showing 3 changed files with 299 additions and 240 deletions.
Loading

0 comments on commit 5d22672

Please sign in to comment.