Propagate Reactor Context when using FluxSink
This commit makes sure that the Reactor context from a given mono or flux is propagated to the Flux returned by a FluxSink. This change affects both DataBufferUtils::write and internal classes used by the DefaultPartHttpMessageReader. Closes gh-27517
This commit is contained in:
@@ -47,6 +47,7 @@ import reactor.core.publisher.Flux;
|
||||
import reactor.core.publisher.FluxSink;
|
||||
import reactor.core.publisher.Mono;
|
||||
import reactor.core.publisher.SynchronousSink;
|
||||
import reactor.util.context.Context;
|
||||
|
||||
import org.springframework.core.io.Resource;
|
||||
import org.springframework.lang.Nullable;
|
||||
@@ -1057,6 +1058,12 @@ public abstract class DataBufferUtils {
|
||||
protected void hookOnComplete() {
|
||||
this.sink.complete();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Context currentContext() {
|
||||
return this.sink.currentContext();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1148,6 +1155,12 @@ public abstract class DataBufferUtils {
|
||||
this.sink.next(dataBuffer);
|
||||
this.dataBuffer.set(null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Context currentContext() {
|
||||
return this.sink.currentContext();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user