Revert "Start building against Reactor 2022.0.0-M4 snapshots"
This reverts commit 47993c094b
.
Couchbase and Spring Data Couchbase are not compatibile with the
latest Reactor snapshots as they use deprecated API that has now
been removed.
See gh-31609
This commit is contained in:
parent
acd8d05315
commit
a5b178657f
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2012-2022 the original author or authors.
|
||||
* Copyright 2012-2021 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.
|
||||
|
@ -25,12 +25,9 @@ import io.lettuce.core.TimeoutOptions;
|
|||
import io.lettuce.core.cluster.ClusterClientOptions;
|
||||
import io.lettuce.core.cluster.ClusterTopologyRefreshOptions;
|
||||
import io.lettuce.core.cluster.ClusterTopologyRefreshOptions.Builder;
|
||||
import io.lettuce.core.event.Event;
|
||||
import io.lettuce.core.event.EventBus;
|
||||
import io.lettuce.core.resource.ClientResources;
|
||||
import io.lettuce.core.resource.DefaultClientResources;
|
||||
import org.apache.commons.pool2.impl.GenericObjectPoolConfig;
|
||||
import reactor.core.publisher.Flux;
|
||||
|
||||
import org.springframework.beans.factory.ObjectProvider;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
||||
|
@ -72,18 +69,6 @@ class LettuceConnectionConfiguration extends RedisConnectionConfiguration {
|
|||
@ConditionalOnMissingBean(ClientResources.class)
|
||||
DefaultClientResources lettuceClientResources(ObjectProvider<ClientResourcesBuilderCustomizer> customizers) {
|
||||
DefaultClientResources.Builder builder = DefaultClientResources.builder();
|
||||
builder.eventBus(new EventBus() {
|
||||
|
||||
@Override
|
||||
public Flux<Event> get() {
|
||||
return Flux.empty();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void publish(Event event) {
|
||||
}
|
||||
|
||||
});
|
||||
customizers.orderedStream().forEach((customizer) -> customizer.customize(builder));
|
||||
return builder.build();
|
||||
}
|
||||
|
|
|
@ -31,7 +31,6 @@ import java.util.Map;
|
|||
import io.undertow.UndertowOptions;
|
||||
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.boot.context.properties.DeprecatedConfigurationProperty;
|
||||
import org.springframework.boot.context.properties.NestedConfigurationProperty;
|
||||
import org.springframework.boot.convert.DurationUnit;
|
||||
import org.springframework.boot.web.server.Compression;
|
||||
|
@ -1385,13 +1384,10 @@ public class ServerProperties {
|
|||
this.initialBufferSize = initialBufferSize;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
@DeprecatedConfigurationProperty(reason = "Deprecated for removal in Reactor Netty")
|
||||
public DataSize getMaxChunkSize() {
|
||||
return this.maxChunkSize;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public void setMaxChunkSize(DataSize maxChunkSize) {
|
||||
this.maxChunkSize = maxChunkSize;
|
||||
}
|
||||
|
|
|
@ -19,7 +19,6 @@ package org.springframework.boot.autoconfigure.web.embedded;
|
|||
import java.time.Duration;
|
||||
|
||||
import io.netty.channel.ChannelOption;
|
||||
import reactor.netty.http.server.HttpRequestDecoderSpec;
|
||||
|
||||
import org.springframework.boot.autoconfigure.web.ServerProperties;
|
||||
import org.springframework.boot.cloud.CloudPlatform;
|
||||
|
@ -87,7 +86,8 @@ public class NettyWebServerFactoryCustomizer
|
|||
.to((maxHttpRequestHeader) -> httpRequestDecoderSpec
|
||||
.maxHeaderSize((int) maxHttpRequestHeader.toBytes()));
|
||||
ServerProperties.Netty nettyProperties = this.serverProperties.getNetty();
|
||||
maxChunkSize(propertyMapper, httpRequestDecoderSpec, nettyProperties);
|
||||
propertyMapper.from(nettyProperties.getMaxChunkSize()).whenNonNull()
|
||||
.to((maxChunkSize) -> httpRequestDecoderSpec.maxChunkSize((int) maxChunkSize.toBytes()));
|
||||
propertyMapper.from(nettyProperties.getMaxInitialLineLength()).whenNonNull()
|
||||
.to((maxInitialLineLength) -> httpRequestDecoderSpec
|
||||
.maxInitialLineLength((int) maxInitialLineLength.toBytes()));
|
||||
|
@ -102,13 +102,6 @@ public class NettyWebServerFactoryCustomizer
|
|||
}));
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
private void maxChunkSize(PropertyMapper propertyMapper, HttpRequestDecoderSpec httpRequestDecoderSpec,
|
||||
ServerProperties.Netty nettyProperties) {
|
||||
propertyMapper.from(nettyProperties.getMaxChunkSize()).whenNonNull()
|
||||
.to((maxChunkSize) -> httpRequestDecoderSpec.maxChunkSize((int) maxChunkSize.toBytes()));
|
||||
}
|
||||
|
||||
private void customizeIdleTimeout(NettyReactiveWebServerFactory factory, Duration idleTimeout) {
|
||||
factory.addServerCustomizers((httpServer) -> httpServer.idleTimeout(idleTimeout));
|
||||
}
|
||||
|
|
|
@ -514,7 +514,6 @@ class ServerPropertiesTests {
|
|||
}
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("deprecation")
|
||||
void nettyMaxChunkSizeMatchesHttpDecoderSpecDefault() {
|
||||
assertThat(this.properties.getNetty().getMaxChunkSize().toBytes())
|
||||
.isEqualTo(HttpDecoderSpec.DEFAULT_MAX_CHUNK_SIZE);
|
||||
|
|
|
@ -132,7 +132,7 @@ class NettyWebServerFactoryCustomizerTests {
|
|||
nettyProperties.setValidateHeaders(false);
|
||||
nettyProperties.setInitialBufferSize(DataSize.ofBytes(512));
|
||||
nettyProperties.setH2cMaxContentLength(DataSize.ofKilobytes(1));
|
||||
setMaxChunkSize(nettyProperties);
|
||||
nettyProperties.setMaxChunkSize(DataSize.ofKilobytes(16));
|
||||
nettyProperties.setMaxInitialLineLength(DataSize.ofKilobytes(32));
|
||||
NettyReactiveWebServerFactory factory = mock(NettyReactiveWebServerFactory.class);
|
||||
this.customizer.customize(factory);
|
||||
|
@ -143,18 +143,8 @@ class NettyWebServerFactoryCustomizerTests {
|
|||
assertThat(decoder.validateHeaders()).isFalse();
|
||||
assertThat(decoder.initialBufferSize()).isEqualTo(nettyProperties.getInitialBufferSize().toBytes());
|
||||
assertThat(decoder.h2cMaxContentLength()).isEqualTo(nettyProperties.getH2cMaxContentLength().toBytes());
|
||||
assertMaxChunkSize(nettyProperties, decoder);
|
||||
assertThat(decoder.maxInitialLineLength()).isEqualTo(nettyProperties.getMaxInitialLineLength().toBytes());
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
private void setMaxChunkSize(ServerProperties.Netty nettyProperties) {
|
||||
nettyProperties.setMaxChunkSize(DataSize.ofKilobytes(16));
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
private void assertMaxChunkSize(ServerProperties.Netty nettyProperties, HttpRequestDecoderSpec decoder) {
|
||||
assertThat(decoder.maxChunkSize()).isEqualTo(nettyProperties.getMaxChunkSize().toBytes());
|
||||
assertThat(decoder.maxInitialLineLength()).isEqualTo(nettyProperties.getMaxInitialLineLength().toBytes());
|
||||
}
|
||||
|
||||
private void verifyConnectionTimeout(NettyReactiveWebServerFactory factory, Integer expected) {
|
||||
|
|
|
@ -1188,7 +1188,7 @@ bom {
|
|||
]
|
||||
}
|
||||
}
|
||||
library("Reactor Bom", "2022.0.0-SNAPSHOT") {
|
||||
library("Reactor Bom", "2022.0.0-M2") {
|
||||
group("io.projectreactor") {
|
||||
imports = [
|
||||
"reactor-bom"
|
||||
|
|
Loading…
Reference in New Issue