Switch to Reactor 2020.0.0 snapshots

A switch to RSocket 1.0.1 snapshots is also required to pick up a
for froward compatibility with Reactor Netty 1.0.

See gh-25085
This commit is contained in:
Rossen Stoyanchev
2020-05-29 15:07:07 +01:00
parent 42ff01b5aa
commit 6d6269f1ee
13 changed files with 84 additions and 45 deletions

View File

@@ -82,7 +82,7 @@ public class ReactorClientHttpConnector implements ClientHttpConnector {
LoopResources resources = resourceFactory.getLoopResources();
Assert.notNull(provider, "No ConnectionProvider: is ReactorResourceFactory not initialized yet?");
Assert.notNull(resources, "No LoopResources: is ReactorResourceFactory not initialized yet?");
return HttpClient.create(provider).tcpConfiguration(tcpClient -> tcpClient.runOn(resources));
return HttpClient.create(provider).runOn(resources);
}
/**

View File

@@ -47,8 +47,7 @@ public class ReactorResourceFactory implements InitializingBean, DisposableBean
@Nullable
private Consumer<HttpResources> globalResourcesConsumer;
@SuppressWarnings("deprecation")
private Supplier<ConnectionProvider> connectionProviderSupplier = () -> ConnectionProvider.fixed("webflux", 500);
private Supplier<ConnectionProvider> connectionProviderSupplier = () -> ConnectionProvider.create("webflux", 500);
@Nullable
private ConnectionProvider connectionProvider;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2018 the original author or authors.
* Copyright 2002-2020 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -16,6 +16,7 @@
package org.springframework.web.testfixture.http.server.reactive.bootstrap;
import java.net.InetSocketAddress;
import java.util.concurrent.atomic.AtomicReference;
import reactor.netty.DisposableServer;
@@ -38,8 +39,7 @@ public class ReactorHttpServer extends AbstractHttpServer {
protected void initServer() {
this.reactorHandler = createHttpHandlerAdapter();
this.reactorServer = reactor.netty.http.server.HttpServer.create()
.tcpConfiguration(server -> server.host(getHost()))
.port(getPort());
.host(getHost()).port(getPort());
}
private ReactorHttpHandlerAdapter createHttpHandlerAdapter() {
@@ -49,7 +49,7 @@ public class ReactorHttpServer extends AbstractHttpServer {
@Override
protected void startInternal() {
DisposableServer server = this.reactorServer.handle(this.reactorHandler).bind().block();
setPort(server.address().getPort());
setPort(((InetSocketAddress) server.address()).getPort());
this.serverRef.set(server);
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2018 the original author or authors.
* Copyright 2002-2020 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -16,6 +16,7 @@
package org.springframework.web.testfixture.http.server.reactive.bootstrap;
import java.net.InetSocketAddress;
import java.util.concurrent.atomic.AtomicReference;
import io.netty.handler.ssl.SslContextBuilder;
@@ -57,7 +58,7 @@ public class ReactorHttpsServer extends AbstractHttpServer {
@Override
protected void startInternal() {
DisposableServer server = this.reactorServer.handle(this.reactorHandler).bind().block();
setPort(server.address().getPort());
setPort(((InetSocketAddress) server.address()).getPort());
this.serverRef.set(server);
}