mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-07-15 01:07:30 +08:00
Upgrade to Reactor 2020.0.0 SNAPSHOTs
See gh-22667
This commit is contained in:
parent
d0507ac2f0
commit
fb1234a22c
@ -58,7 +58,7 @@ dependencies {
|
||||
optional("io.micrometer:micrometer-registry-signalfx")
|
||||
optional("io.micrometer:micrometer-registry-statsd")
|
||||
optional("io.micrometer:micrometer-registry-wavefront")
|
||||
optional("io.projectreactor.netty:reactor-netty")
|
||||
optional("io.projectreactor.netty:reactor-netty-http")
|
||||
optional("io.r2dbc:r2dbc-pool")
|
||||
optional("io.r2dbc:r2dbc-spi")
|
||||
optional("jakarta.jms:jakarta.jms-api")
|
||||
|
@ -84,7 +84,7 @@ dependencies {
|
||||
testImplementation("org.springframework:spring-test")
|
||||
testImplementation("com.squareup.okhttp3:mockwebserver")
|
||||
|
||||
testRuntimeOnly("io.projectreactor.netty:reactor-netty")
|
||||
testRuntimeOnly("io.projectreactor.netty:reactor-netty-http")
|
||||
testRuntimeOnly("javax.xml.bind:jaxb-api")
|
||||
testRuntimeOnly("org.apache.tomcat.embed:tomcat-embed-el")
|
||||
testRuntimeOnly("org.glassfish.jersey.ext:jersey-spring5")
|
||||
|
@ -24,6 +24,7 @@ import io.micrometer.core.instrument.Tag;
|
||||
import reactor.core.publisher.Mono;
|
||||
import reactor.core.publisher.SignalType;
|
||||
import reactor.util.context.Context;
|
||||
import reactor.util.context.ContextView;
|
||||
|
||||
import org.springframework.boot.actuate.metrics.AutoTimer;
|
||||
import org.springframework.web.reactive.function.client.ClientRequest;
|
||||
@ -74,12 +75,12 @@ public class MetricsWebClientFilterFunction implements ExchangeFilterFunction {
|
||||
return next.exchange(request);
|
||||
}
|
||||
return next.exchange(request).as((responseMono) -> instrumentResponse(request, responseMono))
|
||||
.subscriberContext(this::putStartTime);
|
||||
.contextWrite(this::putStartTime);
|
||||
}
|
||||
|
||||
private Mono<ClientResponse> instrumentResponse(ClientRequest request, Mono<ClientResponse> responseMono) {
|
||||
final AtomicBoolean responseReceived = new AtomicBoolean();
|
||||
return Mono.deferWithContext((ctx) -> responseMono.doOnEach((signal) -> {
|
||||
return Mono.deferContextual((ctx) -> responseMono.doOnEach((signal) -> {
|
||||
if (signal.isOnNext() || signal.isOnError()) {
|
||||
responseReceived.set(true);
|
||||
Iterable<Tag> tags = this.tagProvider.tags(request, signal.get(), signal.getThrowable());
|
||||
@ -98,7 +99,7 @@ public class MetricsWebClientFilterFunction implements ExchangeFilterFunction {
|
||||
.register(this.meterRegistry).record(System.nanoTime() - startTime, TimeUnit.NANOSECONDS);
|
||||
}
|
||||
|
||||
private Long getStartTime(Context context) {
|
||||
private Long getStartTime(ContextView context) {
|
||||
return context.get(METRICS_WEBCLIENT_START_TIME);
|
||||
}
|
||||
|
||||
|
@ -141,7 +141,7 @@ class WebFluxEndpointIntegrationTests
|
||||
|
||||
@Bean
|
||||
WebFilter webFilter() {
|
||||
return (exchange, chain) -> chain.filter(exchange).subscriberContext(
|
||||
return (exchange, chain) -> chain.filter(exchange).contextWrite(
|
||||
ReactiveSecurityContextHolder.withAuthentication(new UsernamePasswordAuthenticationToken("Alice",
|
||||
"secret", Arrays.asList(new SimpleGrantedAuthority("ROLE_ACTUATOR")))));
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ dependencies {
|
||||
optional("com.sun.mail:jakarta.mail")
|
||||
optional("de.flapdoodle.embed:de.flapdoodle.embed.mongo")
|
||||
optional("io.lettuce:lettuce-core")
|
||||
optional("io.projectreactor.netty:reactor-netty")
|
||||
optional("io.projectreactor.netty:reactor-netty-http")
|
||||
optional("io.r2dbc:r2dbc-spi")
|
||||
optional("io.r2dbc:r2dbc-pool")
|
||||
optional("io.rsocket:rsocket-core")
|
||||
|
@ -1317,7 +1317,7 @@ bom {
|
||||
]
|
||||
}
|
||||
}
|
||||
library("Reactor Bom", "2020.0.0-M1") {
|
||||
library("Reactor Bom", "2020.0.0-SNAPSHOT") {
|
||||
group("io.projectreactor") {
|
||||
imports = [
|
||||
"reactor-bom"
|
||||
|
@ -69,7 +69,7 @@ dependencies {
|
||||
implementation(project(path: ":spring-boot-project:spring-boot-test-autoconfigure"))
|
||||
implementation("com.zaxxer:HikariCP")
|
||||
implementation("io.micrometer:micrometer-core")
|
||||
implementation("io.projectreactor.netty:reactor-netty")
|
||||
implementation("io.projectreactor.netty:reactor-netty-http")
|
||||
implementation("jakarta.servlet:jakarta.servlet-api")
|
||||
implementation("org.apache.commons:commons-dbcp2")
|
||||
implementation("org.apache.kafka:kafka-streams")
|
||||
|
@ -5,5 +5,5 @@ plugins {
|
||||
description = "Starter for using Reactor Netty as the embedded reactive HTTP server."
|
||||
|
||||
dependencies {
|
||||
api("io.projectreactor.netty:reactor-netty")
|
||||
api("io.projectreactor.netty:reactor-netty-http")
|
||||
}
|
||||
|
@ -14,7 +14,7 @@ dependencies {
|
||||
optional("com.fasterxml.jackson.core:jackson-databind")
|
||||
optional("com.google.code.gson:gson")
|
||||
optional("com.jayway.jsonpath:json-path")
|
||||
optional("io.projectreactor.netty:reactor-netty")
|
||||
optional("io.projectreactor.netty:reactor-netty-http")
|
||||
optional("javax.json.bind:javax.json.bind-api")
|
||||
optional("javax.servlet:javax.servlet-api")
|
||||
optional("junit:junit")
|
||||
|
@ -25,7 +25,7 @@ dependencies {
|
||||
optional("com.zaxxer:HikariCP")
|
||||
optional("io.netty:netty-tcnative-boringssl-static")
|
||||
optional("io.projectreactor:reactor-tools")
|
||||
optional("io.projectreactor.netty:reactor-netty")
|
||||
optional("io.projectreactor.netty:reactor-netty-http")
|
||||
optional("io.rsocket:rsocket-core")
|
||||
optional("io.rsocket:rsocket-transport-netty")
|
||||
optional("io.undertow:undertow-servlet") {
|
||||
|
@ -58,7 +58,7 @@ final class GracefulShutdown {
|
||||
private void doShutdown(GracefulShutdownCallback callback, DisposableServer server) {
|
||||
this.shuttingDown = true;
|
||||
try {
|
||||
server.disposeNow(Duration.ofMillis(Long.MAX_VALUE));
|
||||
server.disposeNow(Duration.ofNanos(Long.MAX_VALUE));
|
||||
logger.info("Graceful shutdown complete");
|
||||
callback.shutdownComplete(GracefulShutdownResult.IDLE);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user