Remove deprecations.
This commit is contained in:
@@ -127,7 +127,7 @@ that management context path. This requirement was removed beginning in Edgware
|
||||
|
||||
=== Registering a Secure Application
|
||||
|
||||
If your app wants to be contacted over HTTPS, you can set two flags in the `EurekaInstanceConfig`:
|
||||
If your app wants to be contacted over HTTPS, you can set two flags in the `EurekaInstanceConfigBean`:
|
||||
|
||||
* `eureka.instance.[nonSecurePortEnabled]=[false]`
|
||||
* `eureka.instance.[securePortEnabled]=[true]`
|
||||
@@ -214,10 +214,10 @@ If the application is planned to be deployed to an AWS cloud, the Eureka instanc
|
||||
@Bean
|
||||
@Profile("!default")
|
||||
public EurekaInstanceConfigBean eurekaInstanceConfig(InetUtils inetUtils) {
|
||||
EurekaInstanceConfigBean b = new EurekaInstanceConfigBean(inetUtils);
|
||||
EurekaInstanceConfigBean bean = new EurekaInstanceConfigBean(inetUtils);
|
||||
AmazonInfo info = AmazonInfo.Builder.newBuilder().autoBuild("eureka");
|
||||
b.setDataCenterInfo(info);
|
||||
return b;
|
||||
bean.setDataCenterInfo(info);
|
||||
return bean;
|
||||
}
|
||||
----
|
||||
|
||||
|
||||
@@ -20,7 +20,6 @@ import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import com.netflix.appinfo.EurekaInstanceConfig;
|
||||
import com.netflix.appinfo.InstanceInfo;
|
||||
import com.netflix.discovery.EurekaClient;
|
||||
import com.netflix.discovery.EurekaClientConfig;
|
||||
@@ -48,11 +47,6 @@ public class EurekaDiscoveryClient implements DiscoveryClient {
|
||||
|
||||
private final EurekaClientConfig clientConfig;
|
||||
|
||||
@Deprecated
|
||||
public EurekaDiscoveryClient(EurekaInstanceConfig config, EurekaClient eurekaClient) {
|
||||
this(eurekaClient, eurekaClient.getEurekaClientConfig());
|
||||
}
|
||||
|
||||
public EurekaDiscoveryClient(EurekaClient eurekaClient, EurekaClientConfig clientConfig) {
|
||||
this.clientConfig = clientConfig;
|
||||
this.eurekaClient = eurekaClient;
|
||||
|
||||
@@ -51,17 +51,6 @@ import org.springframework.context.annotation.Configuration;
|
||||
@ConditionalOnBlockingDiscoveryEnabled
|
||||
public class EurekaDiscoveryClientConfiguration {
|
||||
|
||||
/**
|
||||
* Deprecated in favor of auto configuration order.
|
||||
* @return Marker bean
|
||||
* @deprecated in favor of auto configuration order.
|
||||
*/
|
||||
@Deprecated
|
||||
@Bean
|
||||
public Marker eurekaDiscoverClientMarker() {
|
||||
return new Marker();
|
||||
}
|
||||
|
||||
@Bean
|
||||
@ConditionalOnMissingBean
|
||||
public EurekaDiscoveryClient discoveryClient(EurekaClient client, EurekaClientConfig clientConfig) {
|
||||
@@ -83,16 +72,6 @@ public class EurekaDiscoveryClientConfiguration {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Deprecated in favor of auto configuration order.
|
||||
*
|
||||
* @deprecated in favor of auto configuration order.
|
||||
*/
|
||||
@Deprecated
|
||||
class Marker {
|
||||
|
||||
}
|
||||
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
@ConditionalOnClass(RefreshScopeRefreshedEvent.class)
|
||||
protected static class EurekaClientConfigurationRefresher
|
||||
|
||||
@@ -28,11 +28,6 @@ import org.springframework.web.reactive.function.client.WebClient;
|
||||
*/
|
||||
public class WebClientDiscoveryClientOptionalArgs extends AbstractDiscoveryClientOptionalArgs<Void> {
|
||||
|
||||
@Deprecated
|
||||
public WebClientDiscoveryClientOptionalArgs() {
|
||||
this(WebClient::builder);
|
||||
}
|
||||
|
||||
public WebClientDiscoveryClientOptionalArgs(Supplier<WebClient.Builder> builder) {
|
||||
setTransportClientFactories(new WebClientTransportClientFactories(builder));
|
||||
}
|
||||
|
||||
@@ -45,7 +45,6 @@ import org.springframework.http.MediaType;
|
||||
import org.springframework.http.codec.ClientCodecConfigurer;
|
||||
import org.springframework.http.codec.json.Jackson2JsonDecoder;
|
||||
import org.springframework.http.codec.json.Jackson2JsonEncoder;
|
||||
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
|
||||
import org.springframework.web.reactive.function.client.ClientResponse;
|
||||
import org.springframework.web.reactive.function.client.ExchangeFilterFunction;
|
||||
import org.springframework.web.reactive.function.client.ExchangeFilterFunctions;
|
||||
@@ -63,11 +62,6 @@ public class WebClientTransportClientFactory implements TransportClientFactory {
|
||||
|
||||
private final Supplier<WebClient.Builder> builderSupplier;
|
||||
|
||||
@Deprecated
|
||||
public WebClientTransportClientFactory() {
|
||||
this(WebClient::builder);
|
||||
}
|
||||
|
||||
public WebClientTransportClientFactory(Supplier<WebClient.Builder> builderSupplier) {
|
||||
this.builderSupplier = builderSupplier;
|
||||
}
|
||||
@@ -99,6 +93,19 @@ public class WebClientTransportClientFactory implements TransportClientFactory {
|
||||
return builder.baseUrl(url);
|
||||
}
|
||||
|
||||
private static BeanSerializerModifier createJsonSerializerModifier() {
|
||||
return new BeanSerializerModifier() {
|
||||
@Override
|
||||
public JsonSerializer<?> modifySerializer(SerializationConfig config, BeanDescription beanDesc,
|
||||
JsonSerializer<?> serializer) {
|
||||
if (beanDesc.getBeanClass().isAssignableFrom(InstanceInfo.class)) {
|
||||
return new InstanceInfoJsonBeanSerializer((BeanSerializerBase) serializer, false);
|
||||
}
|
||||
return serializer;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
private void setCodecs(WebClient.Builder builder) {
|
||||
ObjectMapper objectMapper = objectMapper();
|
||||
builder.codecs(configurer -> {
|
||||
@@ -109,37 +116,6 @@ public class WebClientTransportClientFactory implements TransportClientFactory {
|
||||
});
|
||||
}
|
||||
|
||||
// Skip over 4xx http errors
|
||||
private ExchangeFilterFunction http4XxErrorExchangeFilterFunction() {
|
||||
return ExchangeFilterFunction.ofResponseProcessor(clientResponse -> {
|
||||
// literally 400 pass the tests, not 4xxClientError
|
||||
if (clientResponse.statusCode().value() == 400) {
|
||||
ClientResponse newResponse = ClientResponse.from(clientResponse).statusCode(HttpStatus.OK).build();
|
||||
newResponse.body((clientHttpResponse, context) -> clientHttpResponse.getBody());
|
||||
return Mono.just(newResponse);
|
||||
}
|
||||
return Mono.just(clientResponse);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Provides the serialization configurations required by the Eureka Server. JSON
|
||||
* content exchanged with eureka requires a root node matching the entity being
|
||||
* serialized or deserialized. Achieved with
|
||||
* {@link SerializationFeature#WRAP_ROOT_VALUE} and
|
||||
* {@link DeserializationFeature#UNWRAP_ROOT_VALUE}.
|
||||
* {@link PropertyNamingStrategy.SnakeCaseStrategy} is applied to the underlying
|
||||
* {@link ObjectMapper}.
|
||||
* @deprecated to be removed.
|
||||
* @return a {@link MappingJackson2HttpMessageConverter} object
|
||||
*/
|
||||
@Deprecated
|
||||
public MappingJackson2HttpMessageConverter mappingJacksonHttpMessageConverter() {
|
||||
MappingJackson2HttpMessageConverter converter = new MappingJackson2HttpMessageConverter();
|
||||
converter.setObjectMapper(objectMapper());
|
||||
return converter;
|
||||
}
|
||||
|
||||
/**
|
||||
* Provides the serialization configurations required by the Eureka Server. JSON
|
||||
* content exchanged with eureka requires a root node matching the entity being
|
||||
@@ -166,18 +142,17 @@ public class WebClientTransportClientFactory implements TransportClientFactory {
|
||||
return objectMapper;
|
||||
}
|
||||
|
||||
@Deprecated // reduce visibility in future release
|
||||
public static BeanSerializerModifier createJsonSerializerModifier() {
|
||||
return new BeanSerializerModifier() {
|
||||
@Override
|
||||
public JsonSerializer<?> modifySerializer(SerializationConfig config, BeanDescription beanDesc,
|
||||
JsonSerializer<?> serializer) {
|
||||
if (beanDesc.getBeanClass().isAssignableFrom(InstanceInfo.class)) {
|
||||
return new InstanceInfoJsonBeanSerializer((BeanSerializerBase) serializer, false);
|
||||
}
|
||||
return serializer;
|
||||
// Skip over 4xx http errors
|
||||
private ExchangeFilterFunction http4XxErrorExchangeFilterFunction() {
|
||||
return ExchangeFilterFunction.ofResponseProcessor(clientResponse -> {
|
||||
// literally 400 pass the tests, not 4xxClientError
|
||||
if (clientResponse.statusCode().value() == 400) {
|
||||
ClientResponse newResponse = ClientResponse.from(clientResponse).statusCode(HttpStatus.OK).build();
|
||||
newResponse.body((clientHttpResponse, context) -> clientHttpResponse.getBody());
|
||||
return Mono.just(newResponse);
|
||||
}
|
||||
};
|
||||
return Mono.just(clientResponse);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -526,7 +526,6 @@ public class EurekaClientAutoConfigurationTests {
|
||||
assertBeanNotPresent(DiscoveryClient.class);
|
||||
assertBeanNotPresent(EurekaServiceRegistry.class);
|
||||
assertBeanNotPresent(EurekaClient.class);
|
||||
assertBeanNotPresent(EurekaDiscoveryClientConfiguration.Marker.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -18,7 +18,6 @@ package org.springframework.cloud.netflix.eureka.server;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.boot.context.properties.DeprecatedConfigurationProperty;
|
||||
|
||||
import static org.springframework.cloud.netflix.eureka.server.InstanceRegistryProperties.PREFIX;
|
||||
|
||||
@@ -59,17 +58,6 @@ public class InstanceRegistryProperties {
|
||||
this.expectedNumberOfClientsSendingRenews = expectedNumberOfClientsSendingRenews;
|
||||
}
|
||||
|
||||
@DeprecatedConfigurationProperty(replacement = PREFIX + ".expected-number-of-clients-sending-renews")
|
||||
@Deprecated
|
||||
public int getExpectedNumberOfRenewsPerMin() {
|
||||
return getExpectedNumberOfClientsSendingRenews();
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public void setExpectedNumberOfRenewsPerMin(int expectedNumberOfRenewsPerMin) {
|
||||
setExpectedNumberOfClientsSendingRenews(expectedNumberOfRenewsPerMin);
|
||||
}
|
||||
|
||||
public int getDefaultOpenForTrafficCount() {
|
||||
return defaultOpenForTrafficCount;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user