Handle new Reactor Emission FAIL_NON_SERIALIZED
* Rework WebFlux test to JUnit 5
This commit is contained in:
@@ -83,6 +83,9 @@ public class FluxMessageChannel extends AbstractMessageChannel
|
||||
|
||||
private boolean tryEmitMessage(Message<?> message) {
|
||||
switch (this.sink.tryEmitNext(message)) {
|
||||
case OK:
|
||||
return true;
|
||||
case FAIL_NON_SERIALIZED:
|
||||
case FAIL_OVERFLOW:
|
||||
return false;
|
||||
case FAIL_TERMINATED:
|
||||
@@ -90,7 +93,7 @@ public class FluxMessageChannel extends AbstractMessageChannel
|
||||
throw new IllegalStateException("Cannot emit messages into the cancelled or terminated sink: "
|
||||
+ this.sink);
|
||||
default:
|
||||
return true;
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -124,14 +124,14 @@ public final class IntegrationReactiveUtils {
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private static <T> Flux<Message<T>> adaptSubscribableChannelToPublisher(SubscribableChannel inputChannel) {
|
||||
return Flux.defer(() -> {
|
||||
Sinks.Many<Message<T>> sink = Sinks.many().unicast().onBackpressureError();
|
||||
MessageHandler messageHandler = (message) -> {
|
||||
while (true) {
|
||||
@SuppressWarnings("unchecked")
|
||||
Sinks.Emission emission = sink.tryEmitNext((Message<T>) message);
|
||||
switch (emission) {
|
||||
switch (sink.tryEmitNext((Message<T>) message)) {
|
||||
case FAIL_NON_SERIALIZED:
|
||||
case FAIL_OVERFLOW:
|
||||
LockSupport.parkNanos(1000); // NOSONAR
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user