Upgrade to Reactor-3.0.6

According to some rework and deprecations in the latest Reactor,
fix Reactor-based components to follow with the latest paradigmas

* Use `Flux` wrapper in the `ReactiveChannel` to track cancellation
instead of deprecated `Operators.SubscriberAdapter`
* Do similar `Flux.from(publisher)` in the `doSubscribeTo()`
to avoid subscribers delegation and, therefore, unnecessary call stack
* Rework `ReactiveConsumer` to wrap to a new `BaseSubscriber`
on each `ReactiveConsumer.start()`.
We need this wrapping to prevent subscriber cancellation from the
upstream `Publisher` on error.
We can't rely here on the `Flux.retry()` because upstream
`DirectProcessor` is marked as terminated on any error

Apply Reactor-3.0.6.RELEASE
This commit is contained in:
Artem Bilan
2017-04-03 14:00:32 -04:00
committed by Gary Russell
parent 8902fb9489
commit 499e1167d1
5 changed files with 66 additions and 72 deletions

View File

@@ -26,6 +26,7 @@ import static org.mockito.BDDMockito.willAnswer;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import java.util.LinkedList;
@@ -59,6 +60,7 @@ import reactor.core.publisher.EmitterProcessor;
/**
* @author Artem Bilan
*
* @since 5.0
*/
public class ReactiveConsumerTests {
@@ -199,6 +201,9 @@ public class ReactiveConsumerTests {
reactiveConsumer.start();
verify(testSubscriber, times(2)).onSubscribe(subscriptionArgumentCaptor.capture());
subscription = subscriptionArgumentCaptor.getValue();
subscription.request(2);
Message<?> testMessage2 = new GenericMessage<>("test2");