Some miscellaneous fixes

Related to https://build.spring.io/browse/INT-MASTERSPRING40-JOB1-1271

* Fix race condition with subscription in the `FluxMessageChannel`:
rely on the `doOnRequest()` to start producing from upstream publishers
* Remove `SourcePollingChannelAdapterTests` since
`Class.getDeclaredConstructor().newInstance()` doesn't rethrow an exception as is
but wrap it into the `InvocationTargetException`.
This is probably the main reason to deprecate a regular `Class.newInstance()`
* Use `LettuceConnectionFactory.setEagerInitialization(true)` in the `RedisAvailableRule`
to avoid possible dead lock with lazy init
* Adjust Redis tests for new `RedisAvailableRule` behavior
This commit is contained in:
Artem Bilan
2020-11-25 12:13:33 -05:00
parent 63bd3e4938
commit efcc01804c
7 changed files with 30 additions and 135 deletions

View File

@@ -94,11 +94,10 @@ public class FluxMessageChannel extends AbstractMessageChannel
@Override
public void subscribe(Subscriber<? super Message<?>> subscriber) {
this.sink.asFlux()
.doOnRequest((r) -> this.subscribedSignal.tryEmitNext(true))
.doFinally((s) -> this.subscribedSignal.tryEmitNext(this.sink.currentSubscriberCount() > 0))
.share()
.subscribe(subscriber);
this.subscribedSignal.tryEmitNext(this.sink.currentSubscriberCount() > 0);
}
@Override