From 87ec1d75cb00653fa963170e3842d86882de3715 Mon Sep 17 00:00:00 2001 From: Olga Maciaszek-Sharma Date: Thu, 7 Nov 2024 16:20:45 +0100 Subject: [PATCH 1/7] Set up RestClient-based TransportClientFactories (#4363) --- .../ROOT/pages/spring-cloud-netflix.adoc | 7 +- docs/modules/ROOT/partials/_configprops.adoc | 211 +++++++++--------- .../netflix/eureka/EurekaClientTests.java | 8 +- .../eureka/RestClientEurekaClientTests.java | 106 +++++++++ .../eureka/RestTemplateEurekaClientTests.java | 56 ++--- .../eureka/RestClientTimeoutProperties.java | 37 +++ .../eureka/RestTemplateTimeoutProperties.java | 70 +----- .../netflix/eureka/TimeoutProperties.java | 92 ++++++++ ...coveryClientOptionalArgsConfiguration.java | 147 +++++++----- ...ekaConfigServerBootstrapConfiguration.java | 144 +++++++----- .../EurekaConfigServerBootstrapper.java | 9 +- ...urekaClientHttpRequestFactorySupplier.java | 34 ++- .../eureka/http/EurekaHttpClientUtils.java | 18 ++ ...RestClientDiscoveryClientOptionalArgs.java | 19 +- .../RestClientTransportClientFactories.java | 16 +- .../RestClientTransportClientFactory.java | 46 +++- ...stTemplateDiscoveryClientOptionalArgs.java | 5 + .../http/RestTemplateEurekaHttpClient.java | 4 + .../RestTemplateTransportClientFactories.java | 14 +- .../RestTemplateTransportClientFactory.java | 50 ++--- .../http/RestClientEurekaHttpClientTests.java | 10 +- ...RestClientTransportClientFactoryTests.java | 10 +- 22 files changed, 728 insertions(+), 385 deletions(-) create mode 100644 spring-cloud-netflix-eureka-client-tls-tests/src/test/java/org/springframework/cloud/netflix/eureka/RestClientEurekaClientTests.java create mode 100644 spring-cloud-netflix-eureka-client/src/main/java/org/springframework/cloud/netflix/eureka/RestClientTimeoutProperties.java create mode 100644 spring-cloud-netflix-eureka-client/src/main/java/org/springframework/cloud/netflix/eureka/TimeoutProperties.java diff --git a/docs/modules/ROOT/pages/spring-cloud-netflix.adoc b/docs/modules/ROOT/pages/spring-cloud-netflix.adoc index 336bba140..e1bc0d282 100755 --- a/docs/modules/ROOT/pages/spring-cloud-netflix.adoc +++ b/docs/modules/ROOT/pages/spring-cloud-netflix.adoc @@ -98,13 +98,18 @@ NOTE: Because of a limitation in Eureka, it is not possible to support per-serve If you want to customize the RestTemplate used by the Eureka HTTP Client you may want to create a bean of `EurekaClientHttpRequestFactorySupplier` and provide your own logic for generating a `ClientHttpRequestFactory` instance. -All default timeout-related properties for RestTemplate used by the Eureka HTTP Client are set to 3 minutes (in keeping with Apache HC5 default `RequestConfig` and `SocketConfig`). Therefore, to specify the timeout values, you must specify the value directly with the properties in `eureka.client.rest-template-timeout`. (All timeout properties are in milliseconds.) +All default timeout-related properties for RestTemplate and RestClient used by the Eureka HTTP Client are set to 3 minutes (in keeping with Apache HC5 default `RequestConfig` and `SocketConfig`). Therefore, to specify the timeout values, you must specify the value directly with the properties in `eureka.client.rest-template-timeout` or `eureka.client.restclient.timeout`. All timeout properties are in milliseconds. .application.yml [source,yaml] ---- eureka: client: + restclient: + timeout: + connect-timeout: 5000 + connect-request-timeout: 8000 + socket-timeout: 10000 rest-template-timeout: connect-timeout: 5000 connect-request-timeout: 8000 diff --git a/docs/modules/ROOT/partials/_configprops.adoc b/docs/modules/ROOT/partials/_configprops.adoc index cdd6374b6..aa4ea8916 100644 --- a/docs/modules/ROOT/partials/_configprops.adoc +++ b/docs/modules/ROOT/partials/_configprops.adoc @@ -36,7 +36,7 @@ |eureka.client.on-demand-update-status-change | `+++true+++` | If set to true, local status updates via ApplicationInfoManager will trigger on-demand (but rate limited) register/updates to remote eureka servers. |eureka.client.order | `+++0+++` | Order of the discovery client used by `CompositeDiscoveryClient` for sorting available clients. |eureka.client.prefer-same-zone-eureka | `+++true+++` | Indicates whether or not this instance should try to use the eureka server in the same zone for latency and/or other reason. Ideally eureka clients are configured to talk to servers in the same zone The changes are effective at runtime at the next registry fetch cycle as specified by registryFetchIntervalSeconds -|eureka.client.property-resolver | | +|eureka.client.property-resolver | | |eureka.client.proxy-host | | Gets the proxy host to eureka server if any. |eureka.client.proxy-password | | Gets the proxy password if any. |eureka.client.proxy-port | | Gets the proxy port to eureka server if any. @@ -46,21 +46,24 @@ |eureka.client.register-with-eureka | `+++true+++` | Indicates whether or not this instance should register its information with eureka server for discovery by others. In some cases, you do not want your instances to be discovered whereas you just want do discover other instances. |eureka.client.registry-fetch-interval-seconds | `+++30+++` | Indicates how often(in seconds) to fetch the registry information from the eureka server. |eureka.client.registry-refresh-single-vip-address | | Indicates whether the client is only interested in the registry information for a single VIP. -|eureka.client.rest-template-timeout.connect-request-timeout | `+++180000+++` | +|eureka.client.rest-template-timeout.connect-request-timeout | `+++180000+++` | |eureka.client.rest-template-timeout.connect-timeout | `+++180000+++` | Default values are set to 180000, in keeping with {@link RequestConfig} and {@link SocketConfig} defaults. -|eureka.client.rest-template-timeout.socket-timeout | `+++180000+++` | +|eureka.client.rest-template-timeout.socket-timeout | `+++180000+++` | |eureka.client.restclient.enabled | `+++false+++` | Enables the use of RestClient for Eureka HTTP Client. +|eureka.client.restclient.timeout.connect-request-timeout | `+++180000+++` | +|eureka.client.restclient.timeout.connect-timeout | `+++180000+++` | Default values are set to 180000, in keeping with {@link RequestConfig} and {@link SocketConfig} defaults. +|eureka.client.restclient.timeout.socket-timeout | `+++180000+++` | |eureka.client.service-url | | Map of availability zone to list of fully qualified URLs to communicate with eureka server. Each value can be a single URL or a comma separated list of alternative locations. Typically the eureka server URLs carry protocol,host,port,context and version information if any. Example: https://ec2-256-156-243-129.compute-1.amazonaws.com:7001/eureka/ The changes are effective at runtime at the next service url refresh cycle as specified by eurekaServiceUrlPollIntervalSeconds. |eureka.client.should-enforce-registration-at-init | `+++false+++` | Indicates whether the client should enforce registration during initialization. Defaults to false. |eureka.client.should-unregister-on-shutdown | `+++true+++` | Indicates whether the client should explicitly unregister itself from the remote server on client shutdown. -|eureka.client.tls.enabled | | -|eureka.client.tls.key-password | | -|eureka.client.tls.key-store | | -|eureka.client.tls.key-store-password | | -|eureka.client.tls.key-store-type | | -|eureka.client.tls.trust-store | | -|eureka.client.tls.trust-store-password | | -|eureka.client.tls.trust-store-type | | +|eureka.client.tls.enabled | | +|eureka.client.tls.key-password | | +|eureka.client.tls.key-store | | +|eureka.client.tls.key-store-password | | +|eureka.client.tls.key-store-type | | +|eureka.client.tls.trust-store | | +|eureka.client.tls.trust-store-password | | +|eureka.client.tls.trust-store-type | | |eureka.client.use-dns-for-fetching-service-urls | `+++false+++` | Indicates whether the eureka client should use the DNS mechanism to fetch a list of eureka servers to talk to. When the DNS name is updated to have additional servers, that information is used immediately after the eureka client polls for that information as specified in eurekaServiceUrlPollIntervalSeconds. Alternatively, the service urls can be returned serviceUrls, but the users should implement their own mechanism to return the updated list in case of changes. The changes are effective at runtime. |eureka.client.webclient.enabled | `+++false+++` | Enables the use of WebClient for Eureka HTTP Client. |eureka.dashboard.enabled | `+++true+++` | Flag to enable the Eureka dashboard. Default true. @@ -72,8 +75,8 @@ |eureka.instance.appname | `+++unknown+++` | Get the name of the application to be registered with eureka. |eureka.instance.async-client-initialization | `+++false+++` | If true the EurekaClient will be initialized asynchronously when the InstanceRegistry bean is created. |eureka.instance.data-center-info | | Returns the data center this instance is deployed. This information is used to get some AWS specific instance information if the instance is deployed in AWS. -|eureka.instance.default-address-resolution-order | `+++[]+++` | -|eureka.instance.environment | | +|eureka.instance.default-address-resolution-order | `+++[]+++` | +|eureka.instance.environment | | |eureka.instance.health-check-url | | Gets the absolute health check page URL for this instance. The users can provide the healthCheckUrlPath if the health check page resides in the same instance talking to eureka, else in the cases where the instance is a proxy for some other server, users can provide the full URL. If the full URL is provided it takes precedence.

It is normally used for making educated decisions based on the health of the instance - for example, it can be used to determine whether to proceed deployments to an entire farm or stop the deployments without causing further damage. The full URL should follow the format http://${eureka.hostname}:7001/ where the value ${eureka.hostname} is replaced at runtime. |eureka.instance.health-check-url-path | | Gets the relative health check URL path for this instance. The health check page URL is then constructed out of the hostname and the type of communication - secure or unsecure as specified in securePort and nonSecurePort. It is normally used for making educated decisions based on the health of the instance - for example, it can be used to determine whether to proceed deployments to an entire farm or stop the deployments without causing further damage. |eureka.instance.home-page-url | | Gets the absolute home page URL for this instance. The users can provide the homePageUrlPath if the home page resides in the same instance talking to eureka, else in the cases where the instance is a proxy for some other server, users can provide the full URL. If the full URL is provided it takes precedence. It is normally used for informational purposes for other services to use it as a landing page. The full URL should follow the format http://${eureka.hostname}:7001/ where the value ${eureka.hostname} is replaced at runtime. @@ -92,7 +95,7 @@ |eureka.instance.non-secure-port-enabled | `+++true+++` | Indicates whether the non-secure port should be enabled for traffic or not. |eureka.instance.prefer-ip-address | `+++false+++` | Flag to say that, when guessing a hostname, the IP address of the server should be used in preference to the hostname reported by the OS. |eureka.instance.registry.default-open-for-traffic-count | `+++1+++` | Value used in determining when leases are cancelled, default to 1 for standalone. Should be set to 0 for peer replicated eurekas -|eureka.instance.registry.expected-number-of-clients-sending-renews | `+++1+++` | +|eureka.instance.registry.expected-number-of-clients-sending-renews | `+++1+++` | |eureka.instance.secure-health-check-url | | Gets the absolute secure health check page URL for this instance. The users can provide the secureHealthCheckUrl if the health check page resides in the same instance talking to eureka, else in the cases where the instance is a proxy for some other server, users can provide the full URL. If the full URL is provided it takes precedence.

It is normally used for making educated decisions based on the health of the instance - for example, it can be used to determine whether to proceed deployments to an entire farm or stop the deployments without causing further damage. The full URL should follow the format http://${eureka.hostname}:7001/ where the value ${eureka.hostname} is replaced at runtime. |eureka.instance.secure-port | `+++443+++` | Get the Secure port on which the instance should receive traffic. |eureka.instance.secure-port-enabled | `+++false+++` | Indicates whether the secure port should be enabled for traffic or not. @@ -100,83 +103,83 @@ |eureka.instance.status-page-url | | Gets the absolute status page URL path for this instance. The users can provide the statusPageUrlPath if the status page resides in the same instance talking to eureka, else in the cases where the instance is a proxy for some other server, users can provide the full URL. If the full URL is provided it takes precedence. It is normally used for informational purposes for other services to find about the status of this instance. Users can provide a simple HTML indicating what is the current status of the instance. |eureka.instance.status-page-url-path | | Gets the relative status page URL path for this instance. The status page URL is then constructed out of the hostName and the type of communication - secure or unsecure as specified in securePort and nonSecurePort. It is normally used for informational purposes for other services to find about the status of this instance. Users can provide a simple HTML indicating what is the current status of the instance. |eureka.instance.virtual-host-name | `+++unknown+++` | Gets the virtual host name defined for this instance. This is typically the way other instance would find this instance by using the virtual host name.Think of this as similar to the fully qualified domain name, that the users of your services will need to find this instance. -|eureka.server.a-s-g-cache-expiry-timeout-ms | `+++600000+++` | -|eureka.server.a-s-g-query-timeout-ms | `+++300+++` | -|eureka.server.a-s-g-update-interval-ms | `+++300000+++` | -|eureka.server.a-w-s-access-id | | -|eureka.server.a-w-s-secret-key | | -|eureka.server.batch-replication | `+++false+++` | -|eureka.server.binding-strategy | `+++eip+++` | -|eureka.server.delta-retention-timer-interval-in-ms | `+++30000+++` | -|eureka.server.disable-delta | `+++false+++` | -|eureka.server.disable-delta-for-remote-regions | `+++false+++` | -|eureka.server.disable-transparent-fallback-to-other-region | `+++false+++` | -|eureka.server.e-i-p-bind-rebind-retries | `+++3+++` | -|eureka.server.e-i-p-binding-retry-interval-ms | `+++300000+++` | -|eureka.server.e-i-p-binding-retry-interval-ms-when-unbound | `+++60000+++` | -|eureka.server.enable-replicated-request-compression | `+++false+++` | -|eureka.server.enable-self-preservation | `+++true+++` | -|eureka.server.eviction-interval-timer-in-ms | `+++0+++` | -|eureka.server.expected-client-renewal-interval-seconds | `+++30+++` | -|eureka.server.g-zip-content-from-remote-region | `+++true+++` | -|eureka.server.initial-capacity-of-response-cache | `+++1000+++` | -|eureka.server.json-codec-name | | -|eureka.server.list-auto-scaling-groups-role-name | `+++ListAutoScalingGroups+++` | -|eureka.server.log-identity-headers | `+++true+++` | -|eureka.server.max-elements-in-peer-replication-pool | `+++10000+++` | -|eureka.server.max-elements-in-status-replication-pool | `+++10000+++` | -|eureka.server.max-idle-thread-age-in-minutes-for-peer-replication | `+++15+++` | -|eureka.server.max-idle-thread-in-minutes-age-for-status-replication | `+++10+++` | -|eureka.server.max-threads-for-peer-replication | `+++20+++` | -|eureka.server.max-threads-for-status-replication | `+++1+++` | -|eureka.server.max-time-for-replication | `+++30000+++` | +|eureka.server.a-s-g-cache-expiry-timeout-ms | `+++600000+++` | +|eureka.server.a-s-g-query-timeout-ms | `+++300+++` | +|eureka.server.a-s-g-update-interval-ms | `+++300000+++` | +|eureka.server.a-w-s-access-id | | +|eureka.server.a-w-s-secret-key | | +|eureka.server.batch-replication | `+++false+++` | +|eureka.server.binding-strategy | `+++eip+++` | +|eureka.server.delta-retention-timer-interval-in-ms | `+++30000+++` | +|eureka.server.disable-delta | `+++false+++` | +|eureka.server.disable-delta-for-remote-regions | `+++false+++` | +|eureka.server.disable-transparent-fallback-to-other-region | `+++false+++` | +|eureka.server.e-i-p-bind-rebind-retries | `+++3+++` | +|eureka.server.e-i-p-binding-retry-interval-ms | `+++300000+++` | +|eureka.server.e-i-p-binding-retry-interval-ms-when-unbound | `+++60000+++` | +|eureka.server.enable-replicated-request-compression | `+++false+++` | +|eureka.server.enable-self-preservation | `+++true+++` | +|eureka.server.eviction-interval-timer-in-ms | `+++0+++` | +|eureka.server.expected-client-renewal-interval-seconds | `+++30+++` | +|eureka.server.g-zip-content-from-remote-region | `+++true+++` | +|eureka.server.initial-capacity-of-response-cache | `+++1000+++` | +|eureka.server.json-codec-name | | +|eureka.server.list-auto-scaling-groups-role-name | `+++ListAutoScalingGroups+++` | +|eureka.server.log-identity-headers | `+++true+++` | +|eureka.server.max-elements-in-peer-replication-pool | `+++10000+++` | +|eureka.server.max-elements-in-status-replication-pool | `+++10000+++` | +|eureka.server.max-idle-thread-age-in-minutes-for-peer-replication | `+++15+++` | +|eureka.server.max-idle-thread-in-minutes-age-for-status-replication | `+++10+++` | +|eureka.server.max-threads-for-peer-replication | `+++20+++` | +|eureka.server.max-threads-for-status-replication | `+++1+++` | +|eureka.server.max-time-for-replication | `+++30000+++` | |eureka.server.metrics.enabled | `+++false+++` | Indicates whether the metrics should be enabled for eureka instances. -|eureka.server.min-available-instances-for-peer-replication | `+++-1+++` | -|eureka.server.min-threads-for-peer-replication | `+++5+++` | -|eureka.server.min-threads-for-status-replication | `+++1+++` | -|eureka.server.my-url | | -|eureka.server.number-of-replication-retries | `+++5+++` | -|eureka.server.peer-eureka-nodes-update-interval-ms | `+++600000+++` | -|eureka.server.peer-eureka-status-refresh-time-interval-ms | `+++0+++` | -|eureka.server.peer-node-connect-timeout-ms | `+++200+++` | -|eureka.server.peer-node-connection-idle-timeout-seconds | `+++30+++` | -|eureka.server.peer-node-read-timeout-ms | `+++200+++` | -|eureka.server.peer-node-total-connections | `+++1000+++` | -|eureka.server.peer-node-total-connections-per-host | `+++500+++` | -|eureka.server.prime-aws-replica-connections | `+++true+++` | -|eureka.server.property-resolver | | -|eureka.server.rate-limiter-burst-size | `+++10+++` | -|eureka.server.rate-limiter-enabled | `+++false+++` | -|eureka.server.rate-limiter-full-fetch-average-rate | `+++100+++` | -|eureka.server.rate-limiter-privileged-clients | | -|eureka.server.rate-limiter-registry-fetch-average-rate | `+++500+++` | -|eureka.server.rate-limiter-throttle-standard-clients | `+++false+++` | -|eureka.server.registry-sync-retries | `+++0+++` | -|eureka.server.registry-sync-retry-wait-ms | `+++0+++` | -|eureka.server.remote-region-app-whitelist | | -|eureka.server.remote-region-connect-timeout-ms | `+++1000+++` | -|eureka.server.remote-region-connection-idle-timeout-seconds | `+++30+++` | -|eureka.server.remote-region-fetch-thread-pool-size | `+++20+++` | -|eureka.server.remote-region-read-timeout-ms | `+++1000+++` | -|eureka.server.remote-region-registry-fetch-interval | `+++30+++` | -|eureka.server.remote-region-total-connections | `+++1000+++` | -|eureka.server.remote-region-total-connections-per-host | `+++500+++` | -|eureka.server.remote-region-trust-store | | -|eureka.server.remote-region-trust-store-password | `+++changeit+++` | -|eureka.server.remote-region-urls | | -|eureka.server.remote-region-urls-with-name | | -|eureka.server.renewal-percent-threshold | `+++0.85+++` | -|eureka.server.renewal-threshold-update-interval-ms | `+++900000+++` | -|eureka.server.response-cache-auto-expiration-in-seconds | `+++180+++` | -|eureka.server.response-cache-update-interval-ms | `+++30000+++` | -|eureka.server.retention-time-in-m-s-in-delta-queue | `+++180000+++` | -|eureka.server.route53-bind-rebind-retries | `+++3+++` | -|eureka.server.route53-binding-retry-interval-ms | `+++300000+++` | -|eureka.server.route53-domain-t-t-l | `+++30+++` | -|eureka.server.sync-when-timestamp-differs | `+++true+++` | -|eureka.server.use-read-only-response-cache | `+++true+++` | -|eureka.server.wait-time-in-ms-when-sync-empty | `+++300000+++` | -|eureka.server.xml-codec-name | | +|eureka.server.min-available-instances-for-peer-replication | `+++-1+++` | +|eureka.server.min-threads-for-peer-replication | `+++5+++` | +|eureka.server.min-threads-for-status-replication | `+++1+++` | +|eureka.server.my-url | | +|eureka.server.number-of-replication-retries | `+++5+++` | +|eureka.server.peer-eureka-nodes-update-interval-ms | `+++600000+++` | +|eureka.server.peer-eureka-status-refresh-time-interval-ms | `+++0+++` | +|eureka.server.peer-node-connect-timeout-ms | `+++200+++` | +|eureka.server.peer-node-connection-idle-timeout-seconds | `+++30+++` | +|eureka.server.peer-node-read-timeout-ms | `+++200+++` | +|eureka.server.peer-node-total-connections | `+++1000+++` | +|eureka.server.peer-node-total-connections-per-host | `+++500+++` | +|eureka.server.prime-aws-replica-connections | `+++true+++` | +|eureka.server.property-resolver | | +|eureka.server.rate-limiter-burst-size | `+++10+++` | +|eureka.server.rate-limiter-enabled | `+++false+++` | +|eureka.server.rate-limiter-full-fetch-average-rate | `+++100+++` | +|eureka.server.rate-limiter-privileged-clients | | +|eureka.server.rate-limiter-registry-fetch-average-rate | `+++500+++` | +|eureka.server.rate-limiter-throttle-standard-clients | `+++false+++` | +|eureka.server.registry-sync-retries | `+++0+++` | +|eureka.server.registry-sync-retry-wait-ms | `+++0+++` | +|eureka.server.remote-region-app-whitelist | | +|eureka.server.remote-region-connect-timeout-ms | `+++1000+++` | +|eureka.server.remote-region-connection-idle-timeout-seconds | `+++30+++` | +|eureka.server.remote-region-fetch-thread-pool-size | `+++20+++` | +|eureka.server.remote-region-read-timeout-ms | `+++1000+++` | +|eureka.server.remote-region-registry-fetch-interval | `+++30+++` | +|eureka.server.remote-region-total-connections | `+++1000+++` | +|eureka.server.remote-region-total-connections-per-host | `+++500+++` | +|eureka.server.remote-region-trust-store | | +|eureka.server.remote-region-trust-store-password | `+++changeit+++` | +|eureka.server.remote-region-urls | | +|eureka.server.remote-region-urls-with-name | | +|eureka.server.renewal-percent-threshold | `+++0.85+++` | +|eureka.server.renewal-threshold-update-interval-ms | `+++900000+++` | +|eureka.server.response-cache-auto-expiration-in-seconds | `+++180+++` | +|eureka.server.response-cache-update-interval-ms | `+++30000+++` | +|eureka.server.retention-time-in-m-s-in-delta-queue | `+++180000+++` | +|eureka.server.route53-bind-rebind-retries | `+++3+++` | +|eureka.server.route53-binding-retry-interval-ms | `+++300000+++` | +|eureka.server.route53-domain-t-t-l | `+++30+++` | +|eureka.server.sync-when-timestamp-differs | `+++true+++` | +|eureka.server.use-read-only-response-cache | `+++true+++` | +|eureka.server.wait-time-in-ms-when-sync-empty | `+++300000+++` | +|eureka.server.xml-codec-name | | |spring.cloud.compatibility-verifier.compatible-boot-versions | `+++3.4.x+++` | Default accepted versions for the Spring Boot dependency. You can set {@code x} for the patch version if you don't want to specify a concrete value. Example: {@code 3.4.x} |spring.cloud.compatibility-verifier.enabled | `+++false+++` | Enables creation of Spring Cloud compatibility verification. |spring.cloud.config.allow-override | `+++true+++` | Flag to indicate that {@link #isOverrideSystemProperties() systemPropertiesOverride} can be used. Set to false to prevent users from changing the default accidentally. Default true. @@ -185,24 +188,24 @@ |spring.cloud.config.override-system-properties | `+++true+++` | Flag to indicate that the external properties should override system properties. Default true. |spring.cloud.decrypt-environment-post-processor.enabled | `+++true+++` | Enable the DecryptEnvironmentPostProcessor. |spring.cloud.discovery.client.composite-indicator.enabled | `+++true+++` | Enables discovery client composite health indicator. -|spring.cloud.discovery.client.health-indicator.enabled | `+++true+++` | -|spring.cloud.discovery.client.health-indicator.include-description | `+++false+++` | +|spring.cloud.discovery.client.health-indicator.enabled | `+++true+++` | +|spring.cloud.discovery.client.health-indicator.include-description | `+++false+++` | |spring.cloud.discovery.client.health-indicator.use-services-query | `+++true+++` | Whether or not the indicator should use {@link DiscoveryClient#getServices} to check its health. When set to {@code false} the indicator instead uses the lighter {@link DiscoveryClient#probe()}. This can be helpful in large deployments where the number of services returned makes the operation unnecessarily heavy. -|spring.cloud.discovery.client.simple.instances | | -|spring.cloud.discovery.client.simple.local.host | | -|spring.cloud.discovery.client.simple.local.instance-id | | -|spring.cloud.discovery.client.simple.local.metadata | | -|spring.cloud.discovery.client.simple.local.port | `+++0+++` | -|spring.cloud.discovery.client.simple.local.secure | `+++false+++` | -|spring.cloud.discovery.client.simple.local.service-id | | -|spring.cloud.discovery.client.simple.local.uri | | -|spring.cloud.discovery.client.simple.order | | +|spring.cloud.discovery.client.simple.instances | | +|spring.cloud.discovery.client.simple.local.host | | +|spring.cloud.discovery.client.simple.local.instance-id | | +|spring.cloud.discovery.client.simple.local.metadata | | +|spring.cloud.discovery.client.simple.local.port | `+++0+++` | +|spring.cloud.discovery.client.simple.local.secure | `+++false+++` | +|spring.cloud.discovery.client.simple.local.service-id | | +|spring.cloud.discovery.client.simple.local.uri | | +|spring.cloud.discovery.client.simple.order | | |spring.cloud.discovery.enabled | `+++true+++` | Enables discovery client health indicators. |spring.cloud.features.enabled | `+++true+++` | Enables the features endpoint. |spring.cloud.httpclientfactories.apache.enabled | `+++true+++` | Enables creation of Apache Http Client factory beans. |spring.cloud.httpclientfactories.ok.enabled | `+++true+++` | Enables creation of OK Http Client factory beans. -|spring.cloud.hypermedia.refresh.fixed-delay | `+++5000+++` | -|spring.cloud.hypermedia.refresh.initial-delay | `+++10000+++` | +|spring.cloud.hypermedia.refresh.fixed-delay | `+++5000+++` | +|spring.cloud.hypermedia.refresh.initial-delay | `+++10000+++` | |spring.cloud.inetutils.default-hostname | `+++localhost+++` | The default hostname. Used in case of errors. |spring.cloud.inetutils.default-ip-address | `+++127.0.0.1+++` | The default IP address. Used in case of errors. |spring.cloud.inetutils.ignored-interfaces | | List of Java regular expressions for network interfaces that will be ignored. @@ -214,7 +217,7 @@ |spring.cloud.loadbalancer.cache.enabled | `+++true+++` | Enables Spring Cloud LoadBalancer caching mechanism. |spring.cloud.loadbalancer.cache.ttl | `+++35s+++` | Time To Live - time counted from writing of the record, after which cache entries are expired, expressed as a {@link Duration}. The property {@link String} has to be in keeping with the appropriate syntax as specified in Spring Boot StringToDurationConverter. @see StringToDurationConverter.java |spring.cloud.loadbalancer.call-get-with-request-on-delegates | `+++true+++` | If this flag is set to {@code true}, {@code ServiceInstanceListSupplier#get(Request request)} method will be implemented to call {@code delegate.get(request)} in classes assignable from {@code DelegatingServiceInstanceListSupplier} that don't already implement that method, with the exclusion of {@code CachingServiceInstanceListSupplier} and {@code HealthCheckServiceInstanceListSupplier}, which should be placed in the instance supplier hierarchy directly after the supplier performing instance retrieval over the network, before any request-based filtering is done, {@code true} by default. -|spring.cloud.loadbalancer.clients | | +|spring.cloud.loadbalancer.clients | | |spring.cloud.loadbalancer.configurations | `+++default+++` | Enables a predefined LoadBalancer configuration. |spring.cloud.loadbalancer.eager-load.clients | | Names of the clients. |spring.cloud.loadbalancer.enabled | `+++true+++` | Enables Spring Cloud LoadBalancer. diff --git a/spring-cloud-netflix-eureka-client-tls-tests/src/test/java/org/springframework/cloud/netflix/eureka/EurekaClientTests.java b/spring-cloud-netflix-eureka-client-tls-tests/src/test/java/org/springframework/cloud/netflix/eureka/EurekaClientTests.java index 732edac4d..48ba2da0c 100644 --- a/spring-cloud-netflix-eureka-client-tls-tests/src/test/java/org/springframework/cloud/netflix/eureka/EurekaClientTests.java +++ b/spring-cloud-netflix-eureka-client-tls-tests/src/test/java/org/springframework/cloud/netflix/eureka/EurekaClientTests.java @@ -22,7 +22,6 @@ import org.junit.jupiter.api.BeforeAll; import org.springframework.boot.SpringBootConfiguration; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.cloud.netflix.eureka.config.DiscoveryClientOptionalArgsConfiguration; import org.springframework.cloud.netflix.eureka.http.DefaultEurekaClientHttpRequestFactorySupplier; import org.springframework.cloud.netflix.eureka.http.RestTemplateDiscoveryClientOptionalArgs; import org.springframework.cloud.netflix.eureka.http.RestTemplateTransportClientFactories; @@ -33,7 +32,7 @@ import static org.assertj.core.api.Assertions.assertThat; public class EurekaClientTests extends BaseCertTests { - private static final Log log = LogFactory.getLog(EurekaClientTests.class); + private static final Log LOG = LogFactory.getLog(EurekaClientTests.class); static EurekaServerRunner server; @@ -44,7 +43,7 @@ public class EurekaClientTests extends BaseCertTests { server = startEurekaServer(EurekaClientTests.TestEurekaServer.class); service = startService(server, EurekaClientTests.TestApp.class); assertThat(service.discoveryClientOptionalArgs()).isInstanceOf(RestTemplateDiscoveryClientOptionalArgs.class); - log.info("Successfully asserted that Jersey will be used"); + LOG.info("Successfully asserted that Jersey will be used"); waitForRegistration(() -> new EurekaClientTests().createEurekaClient()); } @@ -59,9 +58,8 @@ public class EurekaClientTests extends BaseCertTests { @Bean public RestTemplateTransportClientFactories forceRestTemplateTransportClientFactories( - DiscoveryClientOptionalArgsConfiguration configuration, RestTemplateDiscoveryClientOptionalArgs discoveryClientOptionalArgs) { - return configuration.restTemplateTransportClientFactories(discoveryClientOptionalArgs); + return new RestTemplateTransportClientFactories(discoveryClientOptionalArgs); } @Bean diff --git a/spring-cloud-netflix-eureka-client-tls-tests/src/test/java/org/springframework/cloud/netflix/eureka/RestClientEurekaClientTests.java b/spring-cloud-netflix-eureka-client-tls-tests/src/test/java/org/springframework/cloud/netflix/eureka/RestClientEurekaClientTests.java new file mode 100644 index 000000000..7ad407d81 --- /dev/null +++ b/spring-cloud-netflix-eureka-client-tls-tests/src/test/java/org/springframework/cloud/netflix/eureka/RestClientEurekaClientTests.java @@ -0,0 +1,106 @@ +/* + * Copyright 2018-2024 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. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.cloud.netflix.eureka; + +import java.io.IOException; +import java.security.GeneralSecurityException; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; + +import org.springframework.boot.SpringBootConfiguration; +import org.springframework.boot.autoconfigure.EnableAutoConfiguration; +import org.springframework.cloud.configuration.TlsProperties; +import org.springframework.cloud.netflix.eureka.http.EurekaClientHttpRequestFactorySupplier; +import org.springframework.cloud.netflix.eureka.http.RestClientDiscoveryClientOptionalArgs; +import org.springframework.cloud.netflix.eureka.http.RestClientTransportClientFactories; +import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer; +import org.springframework.context.annotation.Bean; +import org.springframework.web.client.RestClient; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.springframework.cloud.netflix.eureka.config.DiscoveryClientOptionalArgsConfiguration.setupTLS; + +/** + * Tests for verifying TLS setup with {@link RestClientTransportClientFactories}. + * + * @author Olga Maciaszek-Sharma + */ +public class RestClientEurekaClientTests extends BaseCertTests { + + private static final Log LOG = LogFactory.getLog(RestClientEurekaClientTests.class); + + private static EurekaServerRunner server; + + private static EurekaClientRunner service; + + @BeforeAll + public static void setupAll() { + server = startEurekaServer(TestEurekaServer.class); + service = startService(server, TestApp.class); + // Will use RestClient + assertThat(service.discoveryClientOptionalArgs()).isInstanceOf(RestClientDiscoveryClientOptionalArgs.class); + LOG.info("Successfully asserted that RestClient will be used"); + waitForRegistration(() -> new RestClientEurekaClientTests().createEurekaClient()); + } + + @AfterAll + public static void tearDownAll() { + stopService(service); + stopEurekaServer(server); + } + + @Override + EurekaClientRunner createEurekaClient() { + return new EurekaClientRunner(TestApp.class, server); + } + + @SpringBootConfiguration + @EnableAutoConfiguration + public static class TestApp { + + // Want to force reusing exactly the same bean as on production without excluding + // jersey from the classpath + @Bean + public RestClientDiscoveryClientOptionalArgs forceRestClientDiscoveryClientOptionalArgs( + TlsProperties tlsProperties, + EurekaClientHttpRequestFactorySupplier eurekaClientHttpRequestFactorySupplier) + throws GeneralSecurityException, IOException { + RestClientDiscoveryClientOptionalArgs result = new RestClientDiscoveryClientOptionalArgs( + eurekaClientHttpRequestFactorySupplier, RestClient::builder); + setupTLS(result, tlsProperties); + return result; + } + + @Bean + public RestClientTransportClientFactories forceRestClientTransportClientFactories( + RestClientDiscoveryClientOptionalArgs discoveryClientOptionalArgs) { + return new RestClientTransportClientFactories(discoveryClientOptionalArgs); + } + + } + + @SpringBootConfiguration + @EnableAutoConfiguration + @EnableEurekaServer + public static class TestEurekaServer { + + } + +} diff --git a/spring-cloud-netflix-eureka-client-tls-tests/src/test/java/org/springframework/cloud/netflix/eureka/RestTemplateEurekaClientTests.java b/spring-cloud-netflix-eureka-client-tls-tests/src/test/java/org/springframework/cloud/netflix/eureka/RestTemplateEurekaClientTests.java index 8ea1d803b..294ee8b1e 100644 --- a/spring-cloud-netflix-eureka-client-tls-tests/src/test/java/org/springframework/cloud/netflix/eureka/RestTemplateEurekaClientTests.java +++ b/spring-cloud-netflix-eureka-client-tls-tests/src/test/java/org/springframework/cloud/netflix/eureka/RestTemplateEurekaClientTests.java @@ -24,13 +24,11 @@ import org.apache.commons.logging.LogFactory; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; -import org.springframework.beans.BeansException; -import org.springframework.beans.factory.ObjectProvider; import org.springframework.boot.SpringBootConfiguration; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.web.client.RestTemplateBuilder; import org.springframework.cloud.configuration.TlsProperties; -import org.springframework.cloud.netflix.eureka.config.DiscoveryClientOptionalArgsConfiguration; +import org.springframework.cloud.netflix.eureka.http.DefaultEurekaClientHttpRequestFactorySupplier; import org.springframework.cloud.netflix.eureka.http.EurekaClientHttpRequestFactorySupplier; import org.springframework.cloud.netflix.eureka.http.RestTemplateDiscoveryClientOptionalArgs; import org.springframework.cloud.netflix.eureka.http.RestTemplateTransportClientFactories; @@ -38,6 +36,7 @@ import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer; import org.springframework.context.annotation.Bean; import static org.assertj.core.api.Assertions.assertThat; +import static org.springframework.cloud.netflix.eureka.config.DiscoveryClientOptionalArgsConfiguration.setupTLS; public class RestTemplateEurekaClientTests extends BaseCertTests { @@ -49,7 +48,7 @@ public class RestTemplateEurekaClientTests extends BaseCertTests { @BeforeAll public static void setupAll() { - server = startEurekaServer(RestTemplateEurekaClientTests.RestTemplateTestEurekaServer.class); + server = startEurekaServer(TestEurekaServer.class); service = startService(server, RestTemplateEurekaClientTests.RestTemplateTestApp.class); // Will use RestTemplate assertThat(service.discoveryClientOptionalArgs()).isInstanceOf(RestTemplateDiscoveryClientOptionalArgs.class); @@ -72,24 +71,27 @@ public class RestTemplateEurekaClientTests extends BaseCertTests { @EnableAutoConfiguration public static class RestTemplateTestApp { - // Want to force reusing exactly the same bean as on production without excluding - // jersey from the classpath @Bean public RestTemplateDiscoveryClientOptionalArgs forceRestTemplateDiscoveryClientOptionalArgs( - TlsProperties tlsProperties, DiscoveryClientOptionalArgsConfiguration configuration, + TlsProperties tlsProperties, EurekaClientHttpRequestFactorySupplier eurekaClientHttpRequestFactorySupplier) throws GeneralSecurityException, IOException { - return configuration.restTemplateDiscoveryClientOptionalArgs(tlsProperties, - eurekaClientHttpRequestFactorySupplier, new RestTemplateBuilderObjectProvider()); + RestTemplateDiscoveryClientOptionalArgs result = new RestTemplateDiscoveryClientOptionalArgs( + eurekaClientHttpRequestFactorySupplier, RestTemplateBuilder::new); + setupTLS(result, tlsProperties); + return result; } - // Want to force reusing exactly the same bean as on production without excluding - // jersey from the classpath @Bean public RestTemplateTransportClientFactories forceRestTemplateTransportClientFactories( - DiscoveryClientOptionalArgsConfiguration configuration, RestTemplateDiscoveryClientOptionalArgs discoveryClientOptionalArgs) { - return configuration.restTemplateTransportClientFactories(discoveryClientOptionalArgs); + return new RestTemplateTransportClientFactories(discoveryClientOptionalArgs); + } + + @Bean + EurekaClientHttpRequestFactorySupplier defaultEurekaClientHttpRequestFactorySupplier( + RestTemplateTimeoutProperties restTemplateTimeoutProperties) { + return new DefaultEurekaClientHttpRequestFactorySupplier(restTemplateTimeoutProperties); } } @@ -97,33 +99,7 @@ public class RestTemplateEurekaClientTests extends BaseCertTests { @SpringBootConfiguration @EnableAutoConfiguration @EnableEurekaServer - public static class RestTemplateTestEurekaServer { - - } - - private static class RestTemplateBuilderObjectProvider implements ObjectProvider { - - private final RestTemplateBuilder builder = new RestTemplateBuilder(); - - @Override - public RestTemplateBuilder getObject(Object... args) throws BeansException { - return builder; - } - - @Override - public RestTemplateBuilder getIfAvailable() throws BeansException { - return builder; - } - - @Override - public RestTemplateBuilder getIfUnique() throws BeansException { - return builder; - } - - @Override - public RestTemplateBuilder getObject() throws BeansException { - return builder; - } + public static class TestEurekaServer { } diff --git a/spring-cloud-netflix-eureka-client/src/main/java/org/springframework/cloud/netflix/eureka/RestClientTimeoutProperties.java b/spring-cloud-netflix-eureka-client/src/main/java/org/springframework/cloud/netflix/eureka/RestClientTimeoutProperties.java new file mode 100644 index 000000000..dc60ec8f1 --- /dev/null +++ b/spring-cloud-netflix-eureka-client/src/main/java/org/springframework/cloud/netflix/eureka/RestClientTimeoutProperties.java @@ -0,0 +1,37 @@ +/* + * Copyright 2013-2024 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. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.cloud.netflix.eureka; + +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.web.client.RestClient; + +/** + * A {@link RestClient}-specific {@link TimeoutProperties} implementation. + * + * @author Olga Maciaszek-Sharma + * @since 4.2.0 + */ +@ConfigurationProperties("eureka.client.restclient.timeout") +public class RestClientTimeoutProperties extends TimeoutProperties { + + @Override + public String toString() { + return "RestClientTimeoutProperties{" + ", connectTimeout=" + connectTimeout + ", connectRequestTimeout=" + + connectRequestTimeout + ", socketTimeout=" + socketTimeout + '}'; + } + +} diff --git a/spring-cloud-netflix-eureka-client/src/main/java/org/springframework/cloud/netflix/eureka/RestTemplateTimeoutProperties.java b/spring-cloud-netflix-eureka-client/src/main/java/org/springframework/cloud/netflix/eureka/RestTemplateTimeoutProperties.java index 15bddb3ba..95f47102c 100644 --- a/spring-cloud-netflix-eureka-client/src/main/java/org/springframework/cloud/netflix/eureka/RestTemplateTimeoutProperties.java +++ b/spring-cloud-netflix-eureka-client/src/main/java/org/springframework/cloud/netflix/eureka/RestTemplateTimeoutProperties.java @@ -16,79 +16,23 @@ package org.springframework.cloud.netflix.eureka; -import java.util.Objects; - -import org.apache.hc.client5.http.config.RequestConfig; -import org.apache.hc.core5.http.io.SocketConfig; - import org.springframework.boot.context.properties.ConfigurationProperties; -import org.springframework.cloud.netflix.eureka.http.RestTemplateEurekaHttpClient; +import org.springframework.web.client.RestClient; import org.springframework.web.client.RestTemplate; /** - * Properties for configuring timeouts used in {@link RestTemplate} required by - * {@link RestTemplateEurekaHttpClient}. + * A {@link RestTemplate}-specific {@link TimeoutProperties} implementation. * * @author Jiwon Jeon * @author Mooyong Lee + * @author Olga Maciaszek-Sharma * @since 3.1.6 + * @deprecated {@link RestTemplate}-based implementation to be removed in favour of + * {@link RestClient}-based implementation. */ +@Deprecated(forRemoval = true) @ConfigurationProperties("eureka.client.rest-template-timeout") -public class RestTemplateTimeoutProperties { - - /** - * Default values are set to 180000, in keeping with {@link RequestConfig} and - * {@link SocketConfig} defaults. - */ - private int connectTimeout = 180000; // 3 * MINUTES - - private int connectRequestTimeout = 180000; // 3 * MINUTES - - private int socketTimeout = 180000; // 3 * MINUTES - - public int getConnectTimeout() { - return connectTimeout; - } - - public int getConnectRequestTimeout() { - return connectRequestTimeout; - } - - public int getSocketTimeout() { - return socketTimeout; - } - - public void setConnectTimeout(int connectTimeout) { - this.connectTimeout = connectTimeout; - } - - public void setConnectRequestTimeout(int connectRequestTimeout) { - this.connectRequestTimeout = connectRequestTimeout; - } - - public void setSocketTimeout(int socketTimeout) { - this.socketTimeout = socketTimeout; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - - RestTemplateTimeoutProperties that = (RestTemplateTimeoutProperties) o; - - return connectTimeout == that.connectTimeout && connectRequestTimeout == that.connectRequestTimeout - && socketTimeout == that.socketTimeout; - } - - @Override - public int hashCode() { - return Objects.hash(connectTimeout, connectRequestTimeout, socketTimeout); - } +public class RestTemplateTimeoutProperties extends TimeoutProperties { @Override public String toString() { diff --git a/spring-cloud-netflix-eureka-client/src/main/java/org/springframework/cloud/netflix/eureka/TimeoutProperties.java b/spring-cloud-netflix-eureka-client/src/main/java/org/springframework/cloud/netflix/eureka/TimeoutProperties.java new file mode 100644 index 000000000..ecfa40f54 --- /dev/null +++ b/spring-cloud-netflix-eureka-client/src/main/java/org/springframework/cloud/netflix/eureka/TimeoutProperties.java @@ -0,0 +1,92 @@ +/* + * Copyright 2013-2024 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. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.cloud.netflix.eureka; + +import java.util.Objects; + +import com.netflix.discovery.shared.transport.EurekaHttpClient; +import org.apache.hc.client5.http.config.RequestConfig; +import org.apache.hc.core5.http.io.SocketConfig; + +import org.springframework.web.client.RestTemplate; + +/** + * Properties for configuring timeouts used in {@link RestTemplate} required by + * {@link EurekaHttpClient}. + * + * @author Jiwon Jeon + * @author Mooyong Lee + * @author Olga Maciaszek-Sharma + * @since 4.2.0 + */ +public abstract class TimeoutProperties { + + /** + * Default values are set to 180000, in keeping with {@link RequestConfig} and + * {@link SocketConfig} defaults. + */ + protected int connectTimeout = 180000; // 3 * MINUTES + + protected int connectRequestTimeout = 180000; // 3 * MINUTES + + protected int socketTimeout = 180000; // 3 * MINUTES + + public int getConnectTimeout() { + return connectTimeout; + } + + public int getConnectRequestTimeout() { + return connectRequestTimeout; + } + + public int getSocketTimeout() { + return socketTimeout; + } + + public void setConnectTimeout(int connectTimeout) { + this.connectTimeout = connectTimeout; + } + + public void setConnectRequestTimeout(int connectRequestTimeout) { + this.connectRequestTimeout = connectRequestTimeout; + } + + public void setSocketTimeout(int socketTimeout) { + this.socketTimeout = socketTimeout; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + + RestTemplateTimeoutProperties that = (RestTemplateTimeoutProperties) o; + + return connectTimeout == that.connectTimeout && connectRequestTimeout == that.connectRequestTimeout + && socketTimeout == that.socketTimeout; + } + + @Override + public int hashCode() { + return Objects.hash(connectTimeout, connectRequestTimeout, socketTimeout); + } + +} diff --git a/spring-cloud-netflix-eureka-client/src/main/java/org/springframework/cloud/netflix/eureka/config/DiscoveryClientOptionalArgsConfiguration.java b/spring-cloud-netflix-eureka-client/src/main/java/org/springframework/cloud/netflix/eureka/config/DiscoveryClientOptionalArgsConfiguration.java index f08ced31d..6e02068cd 100644 --- a/spring-cloud-netflix-eureka-client/src/main/java/org/springframework/cloud/netflix/eureka/config/DiscoveryClientOptionalArgsConfiguration.java +++ b/spring-cloud-netflix-eureka-client/src/main/java/org/springframework/cloud/netflix/eureka/config/DiscoveryClientOptionalArgsConfiguration.java @@ -38,6 +38,7 @@ import org.springframework.boot.context.properties.EnableConfigurationProperties import org.springframework.boot.web.client.RestTemplateBuilder; import org.springframework.cloud.configuration.SSLContextFactory; import org.springframework.cloud.configuration.TlsProperties; +import org.springframework.cloud.netflix.eureka.RestClientTimeoutProperties; import org.springframework.cloud.netflix.eureka.RestTemplateTimeoutProperties; import org.springframework.cloud.netflix.eureka.http.DefaultEurekaClientHttpRequestFactorySupplier; import org.springframework.cloud.netflix.eureka.http.EurekaClientHttpRequestFactorySupplier; @@ -51,6 +52,7 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Conditional; import org.springframework.context.annotation.Configuration; import org.springframework.web.client.RestClient; +import org.springframework.web.client.RestTemplate; import org.springframework.web.reactive.function.client.WebClient; /** @@ -60,7 +62,7 @@ import org.springframework.web.reactive.function.client.WebClient; * @author Wonchul Heo */ @Configuration(proxyBeanMethods = false) -@EnableConfigurationProperties(RestTemplateTimeoutProperties.class) +@EnableConfigurationProperties({ RestTemplateTimeoutProperties.class, RestClientTimeoutProperties.class }) public class DiscoveryClientOptionalArgsConfiguration { protected static final Log logger = LogFactory.getLog(DiscoveryClientOptionalArgsConfiguration.class); @@ -71,40 +73,8 @@ public class DiscoveryClientOptionalArgsConfiguration { return new TlsProperties(); } - @Bean - @ConditionalOnClass(name = "org.springframework.web.client.RestTemplate") - @Conditional(RestTemplateEnabledCondition.class) - @ConditionalOnMissingBean(value = { AbstractDiscoveryClientOptionalArgs.class }, search = SearchStrategy.CURRENT) - public RestTemplateDiscoveryClientOptionalArgs restTemplateDiscoveryClientOptionalArgs(TlsProperties tlsProperties, - EurekaClientHttpRequestFactorySupplier eurekaClientHttpRequestFactorySupplier, - ObjectProvider restTemplateBuilders) throws GeneralSecurityException, IOException { - if (logger.isInfoEnabled()) { - logger.info("Eureka HTTP Client uses RestTemplate."); - } - RestTemplateDiscoveryClientOptionalArgs result = new RestTemplateDiscoveryClientOptionalArgs( - eurekaClientHttpRequestFactorySupplier, restTemplateBuilders::getIfAvailable); - setupTLS(result, tlsProperties); - return result; - } - - @Bean - @ConditionalOnClass(name = "org.springframework.web.client.RestTemplate") - @Conditional(RestTemplateEnabledCondition.class) - @ConditionalOnMissingBean(value = { TransportClientFactories.class }, search = SearchStrategy.CURRENT) - public RestTemplateTransportClientFactories restTemplateTransportClientFactories( - RestTemplateDiscoveryClientOptionalArgs optionalArgs) { - return new RestTemplateTransportClientFactories(optionalArgs); - } - - @Bean - @ConditionalOnMissingBean - @ConditionalOnClass(name = "org.springframework.web.client.RestTemplate") - EurekaClientHttpRequestFactorySupplier defaultEurekaClientHttpRequestFactorySupplier( - RestTemplateTimeoutProperties restTemplateTimeoutProperties) { - return new DefaultEurekaClientHttpRequestFactorySupplier(restTemplateTimeoutProperties); - } - - private static void setupTLS(AbstractDiscoveryClientOptionalArgs args, TlsProperties properties) + // Visible for tests + public static void setupTLS(AbstractDiscoveryClientOptionalArgs args, TlsProperties properties) throws GeneralSecurityException, IOException { if (properties.isEnabled()) { SSLContextFactory factory = new SSLContextFactory(properties); @@ -112,8 +82,49 @@ public class DiscoveryClientOptionalArgsConfiguration { } } + /** + * @deprecated {@link RestTemplate}-based implementation to be removed in favour of + * {@link RestClient}-based implementation. + */ @Configuration(proxyBeanMethods = false) - @Conditional(JerseyClientPresentAndEnabledCondition.class) + @Conditional(OnRestTemplatePresentAndEnabledCondition.class) + @Deprecated + static class RestTemplateConfiguration { + + @Bean + @ConditionalOnMissingBean + EurekaClientHttpRequestFactorySupplier defaultEurekaClientHttpRequestFactorySupplier( + RestTemplateTimeoutProperties restTemplateTimeoutProperties) { + return new DefaultEurekaClientHttpRequestFactorySupplier(restTemplateTimeoutProperties); + } + + @Bean + @ConditionalOnMissingBean(value = { AbstractDiscoveryClientOptionalArgs.class }, + search = SearchStrategy.CURRENT) + public RestTemplateDiscoveryClientOptionalArgs restTemplateDiscoveryClientOptionalArgs( + TlsProperties tlsProperties, + EurekaClientHttpRequestFactorySupplier eurekaClientHttpRequestFactorySupplier, + ObjectProvider restTemplateBuilders) throws GeneralSecurityException, IOException { + if (logger.isInfoEnabled()) { + logger.info("Eureka HTTP Client uses RestTemplate."); + } + RestTemplateDiscoveryClientOptionalArgs result = new RestTemplateDiscoveryClientOptionalArgs( + eurekaClientHttpRequestFactorySupplier, restTemplateBuilders::getIfAvailable); + setupTLS(result, tlsProperties); + return result; + } + + @Bean + @ConditionalOnMissingBean(value = { TransportClientFactories.class }, search = SearchStrategy.CURRENT) + public RestTemplateTransportClientFactories restTemplateTransportClientFactories( + RestTemplateDiscoveryClientOptionalArgs optionalArgs) { + return new RestTemplateTransportClientFactories(optionalArgs); + } + + } + + @Configuration(proxyBeanMethods = false) + @Conditional(OnJerseyClientPresentAndEnabledCondition.class) @ConditionalOnBean(value = AbstractDiscoveryClientOptionalArgs.class, search = SearchStrategy.CURRENT) static class DiscoveryClientOptionalArgsTlsConfiguration { @@ -127,7 +138,8 @@ public class DiscoveryClientOptionalArgsConfiguration { } - @Conditional(JerseyClientNotPresentOrNotEnabledCondition.class) + @Configuration(proxyBeanMethods = false) + @Conditional(OnJerseyClientNotPresentOrNotEnabledCondition.class) @ConditionalOnClass(name = "org.springframework.web.reactive.function.client.WebClient") @ConditionalOnProperty(prefix = "eureka.client", name = "webclient.enabled", havingValue = "true") protected static class WebClientConfiguration { @@ -156,8 +168,8 @@ public class DiscoveryClientOptionalArgsConfiguration { } - @Configuration - @Conditional(JerseyClientNotPresentOrNotEnabledCondition.class) + @Configuration(proxyBeanMethods = false) + @Conditional(OnJerseyClientNotPresentOrNotEnabledCondition.class) @ConditionalOnMissingClass("org.springframework.web.reactive.function.client.WebClient") @ConditionalOnProperty(prefix = "eureka.client", name = "webclient.enabled", havingValue = "true") protected static class WebClientNotFoundConfiguration { @@ -170,20 +182,30 @@ public class DiscoveryClientOptionalArgsConfiguration { } - @ConditionalOnClass(name = "org.springframework.web.client.RestClient") - @Conditional(RestClientEnabledCondition.class) + @Configuration(proxyBeanMethods = false) + @Conditional(OnRestClientPresentAndEnabledCondition.class) protected static class RestClientConfiguration { + @Bean + @ConditionalOnMissingBean + EurekaClientHttpRequestFactorySupplier defaultEurekaClientHttpRequestFactorySupplier( + RestClientTimeoutProperties restClientTimeoutProperties) { + return new DefaultEurekaClientHttpRequestFactorySupplier(restClientTimeoutProperties); + } + @Bean @ConditionalOnMissingBean(value = { AbstractDiscoveryClientOptionalArgs.class }, search = SearchStrategy.CURRENT) public RestClientDiscoveryClientOptionalArgs restClientDiscoveryClientOptionalArgs(TlsProperties tlsProperties, - ObjectProvider builder) throws GeneralSecurityException, IOException { + EurekaClientHttpRequestFactorySupplier eurekaClientHttpRequestFactorySupplier, + ObjectProvider restClientBuilderProvider) + throws GeneralSecurityException, IOException { if (logger.isInfoEnabled()) { logger.info("Eureka HTTP Client uses RestClient."); } RestClientDiscoveryClientOptionalArgs result = new RestClientDiscoveryClientOptionalArgs( - builder::getIfAvailable); + eurekaClientHttpRequestFactorySupplier, + () -> restClientBuilderProvider.getIfAvailable(RestClient::builder)); setupTLS(result, tlsProperties); return result; } @@ -191,15 +213,15 @@ public class DiscoveryClientOptionalArgsConfiguration { @Bean @ConditionalOnMissingBean(value = TransportClientFactories.class, search = SearchStrategy.CURRENT) public RestClientTransportClientFactories restClientTransportClientFactories( - ObjectProvider builder) { - return new RestClientTransportClientFactories(builder::getIfAvailable); + RestClientDiscoveryClientOptionalArgs args) { + return new RestClientTransportClientFactories(args); } } - static class JerseyClientPresentAndEnabledCondition extends AllNestedConditions { + static class OnJerseyClientPresentAndEnabledCondition extends AllNestedConditions { - JerseyClientPresentAndEnabledCondition() { + OnJerseyClientPresentAndEnabledCondition() { super(ConfigurationPhase.REGISTER_BEAN); } @@ -215,9 +237,9 @@ public class DiscoveryClientOptionalArgsConfiguration { } - static class JerseyClientNotPresentOrNotEnabledCondition extends AnyNestedCondition { + static class OnJerseyClientNotPresentOrNotEnabledCondition extends AnyNestedCondition { - JerseyClientNotPresentOrNotEnabledCondition() { + OnJerseyClientNotPresentOrNotEnabledCondition() { super(ConfigurationPhase.REGISTER_BEAN); } @@ -233,13 +255,23 @@ public class DiscoveryClientOptionalArgsConfiguration { } - static class RestTemplateEnabledCondition extends AllNestedConditions { + /** + * @deprecated {@link RestTemplate}-based implementation to be removed in favour of + * {@link RestClient}-based implementation. + */ + @Deprecated(forRemoval = true) + static class OnRestTemplatePresentAndEnabledCondition extends AllNestedConditions { - RestTemplateEnabledCondition() { + OnRestTemplatePresentAndEnabledCondition() { super(ConfigurationPhase.REGISTER_BEAN); } - @Conditional(JerseyClientNotPresentOrNotEnabledCondition.class) + @ConditionalOnClass(name = "org.springframework.web.client.RestTemplate") + static class OnRestTemplatePresent { + + } + + @Conditional(OnJerseyClientNotPresentOrNotEnabledCondition.class) static class OnJerseyClientNotPresentOrNotEnabled { } @@ -257,13 +289,18 @@ public class DiscoveryClientOptionalArgsConfiguration { } - static class RestClientEnabledCondition extends AllNestedConditions { + static class OnRestClientPresentAndEnabledCondition extends AllNestedConditions { - RestClientEnabledCondition() { + OnRestClientPresentAndEnabledCondition() { super(ConfigurationPhase.REGISTER_BEAN); } - @Conditional(JerseyClientNotPresentOrNotEnabledCondition.class) + @ConditionalOnClass(name = "org.springframework.web.client.RestClient") + static class OnRestClientPresent { + + } + + @Conditional(OnJerseyClientNotPresentOrNotEnabledCondition.class) static class OnJerseyClientNotPresentOrNotEnabled { } diff --git a/spring-cloud-netflix-eureka-client/src/main/java/org/springframework/cloud/netflix/eureka/config/EurekaConfigServerBootstrapConfiguration.java b/spring-cloud-netflix-eureka-client/src/main/java/org/springframework/cloud/netflix/eureka/config/EurekaConfigServerBootstrapConfiguration.java index b1048a508..13cbb8cae 100644 --- a/spring-cloud-netflix-eureka-client/src/main/java/org/springframework/cloud/netflix/eureka/config/EurekaConfigServerBootstrapConfiguration.java +++ b/spring-cloud-netflix-eureka-client/src/main/java/org/springframework/cloud/netflix/eureka/config/EurekaConfigServerBootstrapConfiguration.java @@ -27,7 +27,6 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.autoconfigure.condition.SearchStrategy; import org.springframework.boot.autoconfigure.http.codec.CodecsAutoConfiguration; -import org.springframework.boot.autoconfigure.web.client.RestClientAutoConfiguration; import org.springframework.boot.autoconfigure.web.reactive.function.client.WebClientAutoConfiguration; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.boot.web.client.RestTemplateBuilder; @@ -35,6 +34,7 @@ import org.springframework.cloud.config.client.ConfigServerInstanceProvider; import org.springframework.cloud.config.client.ConfigServicePropertySourceLocator; import org.springframework.cloud.configuration.TlsProperties; import org.springframework.cloud.netflix.eureka.EurekaClientConfigBean; +import org.springframework.cloud.netflix.eureka.RestClientTimeoutProperties; import org.springframework.cloud.netflix.eureka.RestTemplateTimeoutProperties; import org.springframework.cloud.netflix.eureka.http.DefaultEurekaClientHttpRequestFactorySupplier; import org.springframework.cloud.netflix.eureka.http.EurekaClientHttpRequestFactorySupplier; @@ -50,6 +50,7 @@ import org.springframework.context.annotation.Configuration; import org.springframework.core.env.Environment; import org.springframework.lang.Nullable; import org.springframework.web.client.RestClient; +import org.springframework.web.client.RestTemplate; import org.springframework.web.reactive.function.client.WebClient; /** @@ -59,11 +60,12 @@ import org.springframework.web.reactive.function.client.WebClient; * @author Dave Syer * @author Armin Krezovic * @author Wonchul Heo + * @author Olga Maciaszek-Sharma */ @ConditionalOnClass(ConfigServicePropertySourceLocator.class) @Conditional(EurekaConfigServerBootstrapConfiguration.EurekaConfigServerBootstrapCondition.class) @Configuration(proxyBeanMethods = false) -@EnableConfigurationProperties(RestTemplateTimeoutProperties.class) +@EnableConfigurationProperties({ RestTemplateTimeoutProperties.class, RestClientTimeoutProperties.class }) public class EurekaConfigServerBootstrapConfiguration { @Bean @@ -72,31 +74,70 @@ public class EurekaConfigServerBootstrapConfiguration { return new EurekaClientConfigBean(); } - @Bean - @ConditionalOnMissingBean(EurekaHttpClient.class) - @Conditional(RestTemplateEnabledCondition.class) - public RestTemplateEurekaHttpClient configDiscoveryRestTemplateEurekaHttpClient(EurekaClientConfigBean config, - Environment env, @Nullable TlsProperties properties, - EurekaClientHttpRequestFactorySupplier eurekaClientHttpRequestFactorySupplier, - ObjectProvider restTemplateBuilders) { - return (RestTemplateEurekaHttpClient) new RestTemplateTransportClientFactory(properties, - eurekaClientHttpRequestFactorySupplier, restTemplateBuilders::getIfAvailable) - .newClient(HostnameBasedUrlRandomizer.randomEndpoint(config, env)); - } - - @Bean - @ConditionalOnMissingBean - EurekaClientHttpRequestFactorySupplier defaultEurekaClientHttpRequestFactorySupplier( - RestTemplateTimeoutProperties restTemplateTimeoutProperties) { - return new DefaultEurekaClientHttpRequestFactorySupplier(restTemplateTimeoutProperties); - } - @Bean public ConfigServerInstanceProvider.Function eurekaConfigServerInstanceProvider(EurekaHttpClient client, EurekaClientConfig config) { return new EurekaConfigServerInstanceProvider(client, config)::getInstances; } + /** + * @deprecated {@link RestTemplate}-based implementation to be removed in favour of + * {@link RestClient}-based implementation. + */ + @Configuration(proxyBeanMethods = false) + @Conditional(RestTemplateConfiguration.OnRestTemplatePresentAndEnabledCondition.class) + @Deprecated + static class RestTemplateConfiguration { + + @Bean + @ConditionalOnMissingBean(EurekaHttpClient.class) + public RestTemplateEurekaHttpClient configDiscoveryRestTemplateEurekaHttpClient(EurekaClientConfigBean config, + Environment env, @Nullable TlsProperties properties, + EurekaClientHttpRequestFactorySupplier eurekaClientHttpRequestFactorySupplier, + ObjectProvider restTemplateBuilders) { + return (RestTemplateEurekaHttpClient) new RestTemplateTransportClientFactory(properties, + eurekaClientHttpRequestFactorySupplier, restTemplateBuilders::getIfAvailable) + .newClient(HostnameBasedUrlRandomizer.randomEndpoint(config, env)); + } + + @Bean + @ConditionalOnMissingBean + EurekaClientHttpRequestFactorySupplier defaultEurekaClientHttpRequestFactorySupplier( + RestTemplateTimeoutProperties restTemplateTimeoutProperties) { + return new DefaultEurekaClientHttpRequestFactorySupplier(restTemplateTimeoutProperties); + } + + /** + * @deprecated {@link RestTemplate}-based implementation to be removed in favour + * of {@link RestClient}-based implementation. + */ + @Deprecated(forRemoval = true) + static class OnRestTemplatePresentAndEnabledCondition extends AllNestedConditions { + + OnRestTemplatePresentAndEnabledCondition() { + super(ConfigurationPhase.REGISTER_BEAN); + } + + @ConditionalOnClass(name = "org.springframework.web.client.RestTemplate") + static class OnRestTemplatePresent { + + } + + @ConditionalOnProperty(prefix = "eureka.client", name = "webclient.enabled", matchIfMissing = true, + havingValue = "false") + static class OnWebClientDisabled { + + } + + @ConditionalOnProperty(prefix = "eureka.client", name = "restclient.enabled", havingValue = "false") + static class OnRestClientDisabled { + + } + + } + + } + @Configuration(proxyBeanMethods = false) @ConditionalOnClass(name = "org.springframework.web.reactive.function.client.WebClient") @ConditionalOnProperty(prefix = "eureka.client", name = "webclient.enabled", havingValue = "true") @@ -114,55 +155,50 @@ public class EurekaConfigServerBootstrapConfiguration { } @Configuration(proxyBeanMethods = false) - @ConditionalOnClass(name = "org.springframework.web.client.RestClient") - @Conditional(RestClientEnabledCondition.class) - @ImportAutoConfiguration(RestClientAutoConfiguration.class) - protected static class RestClientConfiguration { + @Conditional(RestClientConfiguration.OnRestClientPresentAndEnabledCondition.class) + static class RestClientConfiguration { @Bean @ConditionalOnMissingBean(EurekaHttpClient.class) public RestClientEurekaHttpClient configDiscoveryRestClientEurekaHttpClient(EurekaClientConfigBean config, - ObjectProvider builder, Environment env) { - return (RestClientEurekaHttpClient) new RestClientTransportClientFactory(builder::getIfAvailable) + @Nullable TlsProperties properties, + EurekaClientHttpRequestFactorySupplier eurekaClientHttpRequestFactorySupplier, + ObjectProvider restClientBuilderProvider, Environment env) { + return (RestClientEurekaHttpClient) new RestClientTransportClientFactory(properties, + eurekaClientHttpRequestFactorySupplier, + () -> restClientBuilderProvider.getIfAvailable(RestClient::builder)) .newClient(HostnameBasedUrlRandomizer.randomEndpoint(config, env)); } - } - - static class RestTemplateEnabledCondition extends AllNestedConditions { - - RestTemplateEnabledCondition() { - super(ConfigurationPhase.REGISTER_BEAN); + @Bean + @ConditionalOnMissingBean + EurekaClientHttpRequestFactorySupplier defaultEurekaClientHttpRequestFactorySupplier( + RestClientTimeoutProperties restClientTimeoutProperties) { + return new DefaultEurekaClientHttpRequestFactorySupplier(restClientTimeoutProperties); } - @ConditionalOnProperty(prefix = "eureka.client", name = "webclient.enabled", matchIfMissing = true, - havingValue = "false") - static class OnWebClientDisabled { + static class OnRestClientPresentAndEnabledCondition extends AllNestedConditions { - } + OnRestClientPresentAndEnabledCondition() { + super(ConfigurationPhase.REGISTER_BEAN); + } - @ConditionalOnProperty(prefix = "eureka.client", name = "restclient.enabled", havingValue = "false") - static class OnRestClientDisabled { + @ConditionalOnClass(name = "org.springframework.web.client.RestClient") + static class OnRestClientPresentCondition { - } + } - } + @ConditionalOnProperty(prefix = "eureka.client", name = "webclient.enabled", matchIfMissing = true, + havingValue = "false") + static class OnWebClientDisabled { - static class RestClientEnabledCondition extends AllNestedConditions { + } - RestClientEnabledCondition() { - super(ConfigurationPhase.REGISTER_BEAN); - } + @ConditionalOnProperty(prefix = "eureka.client", name = "restclient.enabled", matchIfMissing = true, + havingValue = "true") + static class OnRestClientEnabled { - @ConditionalOnProperty(prefix = "eureka.client", name = "webclient.enabled", matchIfMissing = true, - havingValue = "false") - static class OnWebClientDisabled { - - } - - @ConditionalOnProperty(prefix = "eureka.client", name = "restclient.enabled", matchIfMissing = true, - havingValue = "true") - static class OnRestClientEnabled { + } } diff --git a/spring-cloud-netflix-eureka-client/src/main/java/org/springframework/cloud/netflix/eureka/config/EurekaConfigServerBootstrapper.java b/spring-cloud-netflix-eureka-client/src/main/java/org/springframework/cloud/netflix/eureka/config/EurekaConfigServerBootstrapper.java index fdde151f9..7892754ca 100644 --- a/spring-cloud-netflix-eureka-client/src/main/java/org/springframework/cloud/netflix/eureka/config/EurekaConfigServerBootstrapper.java +++ b/spring-cloud-netflix-eureka-client/src/main/java/org/springframework/cloud/netflix/eureka/config/EurekaConfigServerBootstrapper.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2022 the original author or authors. + * Copyright 2013-2024 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. @@ -30,9 +30,10 @@ import org.springframework.cloud.config.client.ConfigServerConfigDataLocationRes import org.springframework.cloud.config.client.ConfigServerInstanceProvider; import org.springframework.cloud.configuration.TlsProperties; import org.springframework.cloud.netflix.eureka.EurekaClientConfigBean; +import org.springframework.cloud.netflix.eureka.RestClientTimeoutProperties; import org.springframework.cloud.netflix.eureka.http.DefaultEurekaClientHttpRequestFactorySupplier; import org.springframework.cloud.netflix.eureka.http.EurekaClientHttpRequestFactorySupplier; -import org.springframework.cloud.netflix.eureka.http.RestTemplateTransportClientFactory; +import org.springframework.cloud.netflix.eureka.http.RestClientTransportClientFactory; import org.springframework.util.ClassUtils; public class EurekaConfigServerBootstrapper implements BootstrapRegistryInitializer { @@ -57,10 +58,10 @@ public class EurekaConfigServerBootstrapper implements BootstrapRegistryInitiali return (id) -> Collections.emptyList(); } EurekaClientConfigBean config = context.get(EurekaClientConfigBean.class); - EurekaHttpClient httpClient = new RestTemplateTransportClientFactory( + EurekaHttpClient httpClient = new RestClientTransportClientFactory( context.getOrElse(TlsProperties.class, null), context.getOrElse(EurekaClientHttpRequestFactorySupplier.class, - new DefaultEurekaClientHttpRequestFactorySupplier())) + new DefaultEurekaClientHttpRequestFactorySupplier(new RestClientTimeoutProperties()))) .newClient(HostnameBasedUrlRandomizer.randomEndpoint(config, getPropertyResolver(context))); return new EurekaConfigServerInstanceProvider(httpClient, config)::getInstances; }); diff --git a/spring-cloud-netflix-eureka-client/src/main/java/org/springframework/cloud/netflix/eureka/http/DefaultEurekaClientHttpRequestFactorySupplier.java b/spring-cloud-netflix-eureka-client/src/main/java/org/springframework/cloud/netflix/eureka/http/DefaultEurekaClientHttpRequestFactorySupplier.java index bc6b092d1..ab368a522 100644 --- a/spring-cloud-netflix-eureka-client/src/main/java/org/springframework/cloud/netflix/eureka/http/DefaultEurekaClientHttpRequestFactorySupplier.java +++ b/spring-cloud-netflix-eureka-client/src/main/java/org/springframework/cloud/netflix/eureka/http/DefaultEurekaClientHttpRequestFactorySupplier.java @@ -32,6 +32,7 @@ import org.apache.hc.core5.http.io.SocketConfig; import org.apache.hc.core5.util.Timeout; import org.springframework.cloud.netflix.eureka.RestTemplateTimeoutProperties; +import org.springframework.cloud.netflix.eureka.TimeoutProperties; import org.springframework.http.client.ClientHttpRequestFactory; import org.springframework.http.client.HttpComponentsClientHttpRequestFactory; import org.springframework.lang.Nullable; @@ -47,29 +48,38 @@ import org.springframework.lang.Nullable; */ public class DefaultEurekaClientHttpRequestFactorySupplier implements EurekaClientHttpRequestFactorySupplier { - private final RestTemplateTimeoutProperties restTemplateTimeoutProperties; + private final TimeoutProperties timeoutProperties; /** * @deprecated in favour of - * {@link DefaultEurekaClientHttpRequestFactorySupplier#DefaultEurekaClientHttpRequestFactorySupplier(RestTemplateTimeoutProperties)} + * {@link DefaultEurekaClientHttpRequestFactorySupplier#DefaultEurekaClientHttpRequestFactorySupplier(TimeoutProperties)} */ @Deprecated(forRemoval = true) public DefaultEurekaClientHttpRequestFactorySupplier() { - this.restTemplateTimeoutProperties = new RestTemplateTimeoutProperties(); + this.timeoutProperties = new RestTemplateTimeoutProperties(); } - public DefaultEurekaClientHttpRequestFactorySupplier(RestTemplateTimeoutProperties restTemplateTimeoutProperties) { - this.restTemplateTimeoutProperties = restTemplateTimeoutProperties; + /** + * @deprecated in favour of + * {@link DefaultEurekaClientHttpRequestFactorySupplier#DefaultEurekaClientHttpRequestFactorySupplier(TimeoutProperties)} + */ + @Deprecated(forRemoval = true) + public DefaultEurekaClientHttpRequestFactorySupplier(RestTemplateTimeoutProperties timeoutProperties) { + this.timeoutProperties = timeoutProperties; + } + + public DefaultEurekaClientHttpRequestFactorySupplier(TimeoutProperties timeoutProperties) { + this.timeoutProperties = timeoutProperties; } @Override public ClientHttpRequestFactory get(SSLContext sslContext, @Nullable HostnameVerifier hostnameVerifier) { HttpClientBuilder httpClientBuilder = HttpClientBuilder.create(); - if (sslContext != null || hostnameVerifier != null || restTemplateTimeoutProperties != null) { - httpClientBuilder.setConnectionManager( - buildConnectionManager(sslContext, hostnameVerifier, restTemplateTimeoutProperties)); + if (sslContext != null || hostnameVerifier != null || timeoutProperties != null) { + httpClientBuilder + .setConnectionManager(buildConnectionManager(sslContext, hostnameVerifier, timeoutProperties)); } - if (restTemplateTimeoutProperties != null) { + if (timeoutProperties != null) { httpClientBuilder.setDefaultRequestConfig(buildRequestConfig()); } @@ -80,7 +90,7 @@ public class DefaultEurekaClientHttpRequestFactorySupplier implements EurekaClie } private HttpClientConnectionManager buildConnectionManager(SSLContext sslContext, HostnameVerifier hostnameVerifier, - RestTemplateTimeoutProperties restTemplateTimeoutProperties) { + TimeoutProperties restTemplateTimeoutProperties) { PoolingHttpClientConnectionManagerBuilder connectionManagerBuilder = PoolingHttpClientConnectionManagerBuilder .create(); SSLConnectionSocketFactoryBuilder sslConnectionSocketFactoryBuilder = SSLConnectionSocketFactoryBuilder @@ -102,9 +112,9 @@ public class DefaultEurekaClientHttpRequestFactorySupplier implements EurekaClie private RequestConfig buildRequestConfig() { return RequestConfig.custom() - .setConnectTimeout(Timeout.of(restTemplateTimeoutProperties.getConnectTimeout(), TimeUnit.MILLISECONDS)) + .setConnectTimeout(Timeout.of(timeoutProperties.getConnectTimeout(), TimeUnit.MILLISECONDS)) .setConnectionRequestTimeout( - Timeout.of(restTemplateTimeoutProperties.getConnectRequestTimeout(), TimeUnit.MILLISECONDS)) + Timeout.of(timeoutProperties.getConnectRequestTimeout(), TimeUnit.MILLISECONDS)) .build(); } diff --git a/spring-cloud-netflix-eureka-client/src/main/java/org/springframework/cloud/netflix/eureka/http/EurekaHttpClientUtils.java b/spring-cloud-netflix-eureka-client/src/main/java/org/springframework/cloud/netflix/eureka/http/EurekaHttpClientUtils.java index a45213c30..47ea010f8 100644 --- a/spring-cloud-netflix-eureka-client/src/main/java/org/springframework/cloud/netflix/eureka/http/EurekaHttpClientUtils.java +++ b/spring-cloud-netflix-eureka-client/src/main/java/org/springframework/cloud/netflix/eureka/http/EurekaHttpClientUtils.java @@ -18,6 +18,9 @@ package org.springframework.cloud.netflix.eureka.http; import java.net.URI; import java.net.URISyntaxException; +import java.util.Optional; + +import javax.net.ssl.SSLContext; import com.fasterxml.jackson.databind.BeanDescription; import com.fasterxml.jackson.databind.DeserializationFeature; @@ -36,6 +39,8 @@ import com.netflix.discovery.converters.jackson.serializer.InstanceInfoJsonBeanS import com.netflix.discovery.shared.Applications; import com.netflix.discovery.shared.transport.EurekaHttpClient; +import org.springframework.cloud.configuration.SSLContextFactory; +import org.springframework.cloud.configuration.TlsProperties; import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; import org.springframework.lang.Nullable; @@ -44,6 +49,7 @@ import org.springframework.lang.Nullable; * * @author Daniel Lavoie * @author Wonchul Heo + * @author Olga Maciaszek-Sharma * @since 4.2.0 */ final class EurekaHttpClientUtils { @@ -123,6 +129,18 @@ final class EurekaHttpClientUtils { return null; } + static Optional context(TlsProperties properties) { + if (properties == null || !properties.isEnabled()) { + return Optional.empty(); + } + try { + return Optional.of(new SSLContextFactory(properties).createSSLContext()); + } + catch (Exception e) { + throw new IllegalStateException(e); + } + } + record UserInfo(String username, String password) { } diff --git a/spring-cloud-netflix-eureka-client/src/main/java/org/springframework/cloud/netflix/eureka/http/RestClientDiscoveryClientOptionalArgs.java b/spring-cloud-netflix-eureka-client/src/main/java/org/springframework/cloud/netflix/eureka/http/RestClientDiscoveryClientOptionalArgs.java index 93f94a18d..238e71d6f 100644 --- a/spring-cloud-netflix-eureka-client/src/main/java/org/springframework/cloud/netflix/eureka/http/RestClientDiscoveryClientOptionalArgs.java +++ b/spring-cloud-netflix-eureka-client/src/main/java/org/springframework/cloud/netflix/eureka/http/RestClientDiscoveryClientOptionalArgs.java @@ -28,11 +28,28 @@ import org.springframework.web.client.RestClient; * supplying {@link ClientRequestFilter}. * * @author Wonchul Heo + * @author Olga Maciaszek-Sharma * @since 4.2.0 */ public class RestClientDiscoveryClientOptionalArgs extends AbstractDiscoveryClientOptionalArgs { - public RestClientDiscoveryClientOptionalArgs(Supplier builder) { + private final EurekaClientHttpRequestFactorySupplier eurekaClientHttpRequestFactorySupplier; + + private final Supplier restClientBuilderSupplier; + + public RestClientDiscoveryClientOptionalArgs( + EurekaClientHttpRequestFactorySupplier eurekaClientHttpRequestFactorySupplier, + Supplier restClientBuilderSupplier) { + this.eurekaClientHttpRequestFactorySupplier = eurekaClientHttpRequestFactorySupplier; + this.restClientBuilderSupplier = restClientBuilderSupplier; + } + + EurekaClientHttpRequestFactorySupplier getEurekaClientHttpRequestFactorySupplier() { + return eurekaClientHttpRequestFactorySupplier; + } + + Supplier getRestClientBuilderSupplier() { + return restClientBuilderSupplier; } } diff --git a/spring-cloud-netflix-eureka-client/src/main/java/org/springframework/cloud/netflix/eureka/http/RestClientTransportClientFactories.java b/spring-cloud-netflix-eureka-client/src/main/java/org/springframework/cloud/netflix/eureka/http/RestClientTransportClientFactories.java index d1596bf25..cdcbfe5b9 100644 --- a/spring-cloud-netflix-eureka-client/src/main/java/org/springframework/cloud/netflix/eureka/http/RestClientTransportClientFactories.java +++ b/spring-cloud-netflix-eureka-client/src/main/java/org/springframework/cloud/netflix/eureka/http/RestClientTransportClientFactories.java @@ -18,7 +18,6 @@ package org.springframework.cloud.netflix.eureka.http; import java.util.Collection; import java.util.Optional; -import java.util.function.Supplier; import javax.net.ssl.HostnameVerifier; import javax.net.ssl.SSLContext; @@ -28,31 +27,32 @@ import com.netflix.discovery.EurekaClientConfig; import com.netflix.discovery.shared.transport.TransportClientFactory; import com.netflix.discovery.shared.transport.jersey.TransportClientFactories; -import org.springframework.web.client.RestClient; - /** * @author Wonchul Heo + * @author Olga Maciaszek-Sharma * @since 4.2.0 */ public class RestClientTransportClientFactories implements TransportClientFactories { - private final Supplier builder; + private final RestClientDiscoveryClientOptionalArgs args; - public RestClientTransportClientFactories(Supplier builder) { - this.builder = builder; + public RestClientTransportClientFactories(RestClientDiscoveryClientOptionalArgs args) { + this.args = args; } @Override public TransportClientFactory newTransportClientFactory(EurekaClientConfig clientConfig, Collection additionalFilters, InstanceInfo myInstanceInfo) { - return new RestClientTransportClientFactory(builder); + return new RestClientTransportClientFactory(args.getSSLContext(), args.getHostnameVerifier(), + args.getEurekaClientHttpRequestFactorySupplier(), args.getRestClientBuilderSupplier()); } @Override public TransportClientFactory newTransportClientFactory(final EurekaClientConfig clientConfig, final Collection additionalFilters, final InstanceInfo myInstanceInfo, final Optional sslContext, final Optional hostnameVerifier) { - return new RestClientTransportClientFactory(builder); + return new RestClientTransportClientFactory(args.getSSLContext(), args.getHostnameVerifier(), + args.getEurekaClientHttpRequestFactorySupplier(), args.getRestClientBuilderSupplier()); } } diff --git a/spring-cloud-netflix-eureka-client/src/main/java/org/springframework/cloud/netflix/eureka/http/RestClientTransportClientFactory.java b/spring-cloud-netflix-eureka-client/src/main/java/org/springframework/cloud/netflix/eureka/http/RestClientTransportClientFactory.java index 9fac73a11..8de8dea51 100644 --- a/spring-cloud-netflix-eureka-client/src/main/java/org/springframework/cloud/netflix/eureka/http/RestClientTransportClientFactory.java +++ b/spring-cloud-netflix-eureka-client/src/main/java/org/springframework/cloud/netflix/eureka/http/RestClientTransportClientFactory.java @@ -16,19 +16,26 @@ package org.springframework.cloud.netflix.eureka.http; +import java.util.Optional; import java.util.function.Supplier; +import javax.net.ssl.HostnameVerifier; +import javax.net.ssl.SSLContext; + import com.netflix.discovery.shared.resolver.EurekaEndpoint; import com.netflix.discovery.shared.transport.EurekaHttpClient; import com.netflix.discovery.shared.transport.TransportClientFactory; +import org.springframework.cloud.configuration.TlsProperties; import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatusCode; +import org.springframework.http.client.ClientHttpRequestFactory; import org.springframework.http.client.ClientHttpResponse; import org.springframework.http.client.support.BasicAuthenticationInterceptor; import org.springframework.web.client.RestClient; import org.springframework.web.util.UriComponentsBuilder; +import static org.springframework.cloud.netflix.eureka.http.EurekaHttpClientUtils.context; import static org.springframework.cloud.netflix.eureka.http.EurekaHttpClientUtils.extractUserInfo; import static org.springframework.cloud.netflix.eureka.http.EurekaHttpClientUtils.mappingJacksonHttpMessageConverter; @@ -38,20 +45,49 @@ import static org.springframework.cloud.netflix.eureka.http.EurekaHttpClientUtil * deserialization. * * @author Wonchul Heo + * @author Olga Maciaszek-Sharma * @since 4.2.0 */ public class RestClientTransportClientFactory implements TransportClientFactory { + private final Optional sslContext; + + private final Optional hostnameVerifier; + + private final EurekaClientHttpRequestFactorySupplier eurekaClientHttpRequestFactorySupplier; + private final Supplier builderSupplier; - public RestClientTransportClientFactory(Supplier builderSupplier) { + public RestClientTransportClientFactory(Optional sslContext, + Optional hostnameVerifier, + EurekaClientHttpRequestFactorySupplier eurekaClientHttpRequestFactorySupplier, + Supplier builderSupplier) { + this.sslContext = sslContext; + this.hostnameVerifier = hostnameVerifier; + this.eurekaClientHttpRequestFactorySupplier = eurekaClientHttpRequestFactorySupplier; this.builderSupplier = builderSupplier; } + public RestClientTransportClientFactory(TlsProperties tlsProperties, + EurekaClientHttpRequestFactorySupplier eurekaClientHttpRequestFactorySupplier, + Supplier builderSupplier) { + this(context(tlsProperties), Optional.empty(), eurekaClientHttpRequestFactorySupplier, builderSupplier); + } + + public RestClientTransportClientFactory(TlsProperties tlsProperties, + EurekaClientHttpRequestFactorySupplier eurekaClientHttpRequestFactorySupplier) { + this(tlsProperties, eurekaClientHttpRequestFactorySupplier, RestClient::builder); + } + @Override public EurekaHttpClient newClient(EurekaEndpoint endpoint) { // we want a copy to modify. Don't change the original final RestClient.Builder builder = builderSupplier.get().clone(); + + ClientHttpRequestFactory requestFactory = this.eurekaClientHttpRequestFactorySupplier + .get(this.sslContext.orElse(null), this.hostnameVerifier.orElse(null)); + + builder.requestFactory(requestFactory); setUrl(builder, endpoint.getServiceUrl()); builder.messageConverters(converters -> converters.add(0, mappingJacksonHttpMessageConverter())); @@ -69,6 +105,10 @@ public class RestClientTransportClientFactory implements TransportClientFactory return new RestClientEurekaHttpClient(builder.build()); } + @Override + public void shutdown() { + } + private static void setUrl(RestClient.Builder builder, String serviceUrl) { final String url = UriComponentsBuilder.fromUriString(serviceUrl).userInfo(null).toUriString(); @@ -79,8 +119,4 @@ public class RestClientTransportClientFactory implements TransportClientFactory builder.baseUrl(url); } - @Override - public void shutdown() { - } - } diff --git a/spring-cloud-netflix-eureka-client/src/main/java/org/springframework/cloud/netflix/eureka/http/RestTemplateDiscoveryClientOptionalArgs.java b/spring-cloud-netflix-eureka-client/src/main/java/org/springframework/cloud/netflix/eureka/http/RestTemplateDiscoveryClientOptionalArgs.java index 663afb6ae..13b253f92 100644 --- a/spring-cloud-netflix-eureka-client/src/main/java/org/springframework/cloud/netflix/eureka/http/RestTemplateDiscoveryClientOptionalArgs.java +++ b/spring-cloud-netflix-eureka-client/src/main/java/org/springframework/cloud/netflix/eureka/http/RestTemplateDiscoveryClientOptionalArgs.java @@ -21,11 +21,16 @@ import java.util.function.Supplier; import com.netflix.discovery.AbstractDiscoveryClientOptionalArgs; import org.springframework.boot.web.client.RestTemplateBuilder; +import org.springframework.web.client.RestClient; +import org.springframework.web.client.RestTemplate; /** * @author Daniel Lavoie * @author Armin Krezovic + * @deprecated {@link RestTemplate}-based implementation to be removed in favour of + * {@link RestClient}-based implementation. */ +@Deprecated public class RestTemplateDiscoveryClientOptionalArgs extends AbstractDiscoveryClientOptionalArgs { protected final EurekaClientHttpRequestFactorySupplier eurekaClientHttpRequestFactorySupplier; diff --git a/spring-cloud-netflix-eureka-client/src/main/java/org/springframework/cloud/netflix/eureka/http/RestTemplateEurekaHttpClient.java b/spring-cloud-netflix-eureka-client/src/main/java/org/springframework/cloud/netflix/eureka/http/RestTemplateEurekaHttpClient.java index 7677f079d..81f730205 100644 --- a/spring-cloud-netflix-eureka-client/src/main/java/org/springframework/cloud/netflix/eureka/http/RestTemplateEurekaHttpClient.java +++ b/spring-cloud-netflix-eureka-client/src/main/java/org/springframework/cloud/netflix/eureka/http/RestTemplateEurekaHttpClient.java @@ -38,6 +38,7 @@ import org.springframework.http.HttpMethod; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; +import org.springframework.web.client.RestClient; import org.springframework.web.client.RestTemplate; import org.springframework.web.util.UriComponentsBuilder; @@ -46,7 +47,10 @@ import static com.netflix.discovery.shared.transport.EurekaHttpResponse.anEureka /** * @author Daniel Lavoie * @author Václav Plic + * @deprecated {@link RestTemplate}-based implementation to be removed in favour of + * {@link RestClient}-based implementation. */ +@Deprecated(forRemoval = true) public class RestTemplateEurekaHttpClient implements EurekaHttpClient { private final RestTemplate restTemplate; diff --git a/spring-cloud-netflix-eureka-client/src/main/java/org/springframework/cloud/netflix/eureka/http/RestTemplateTransportClientFactories.java b/spring-cloud-netflix-eureka-client/src/main/java/org/springframework/cloud/netflix/eureka/http/RestTemplateTransportClientFactories.java index 09f4c1c0a..b3167752f 100644 --- a/spring-cloud-netflix-eureka-client/src/main/java/org/springframework/cloud/netflix/eureka/http/RestTemplateTransportClientFactories.java +++ b/spring-cloud-netflix-eureka-client/src/main/java/org/springframework/cloud/netflix/eureka/http/RestTemplateTransportClientFactories.java @@ -27,10 +27,16 @@ import com.netflix.discovery.EurekaClientConfig; import com.netflix.discovery.shared.transport.TransportClientFactory; import com.netflix.discovery.shared.transport.jersey.TransportClientFactories; +import org.springframework.web.client.RestClient; +import org.springframework.web.client.RestTemplate; + /** * @author Daniel Lavoie * @author Armin Krezovic + * @deprecated {@link RestTemplate}-based implementation to be removed in favour of + * {@link RestClient}-based implementation. */ +@Deprecated(forRemoval = true) public class RestTemplateTransportClientFactories implements TransportClientFactories { private final RestTemplateDiscoveryClientOptionalArgs args; @@ -42,16 +48,16 @@ public class RestTemplateTransportClientFactories implements TransportClientFact @Override public TransportClientFactory newTransportClientFactory(EurekaClientConfig clientConfig, Collection additionalFilters, InstanceInfo myInstanceInfo) { - return new RestTemplateTransportClientFactory(this.args.getSSLContext(), this.args.getHostnameVerifier(), - this.args.eurekaClientHttpRequestFactorySupplier, this.args.restTemplateBuilderSupplier); + return new RestTemplateTransportClientFactory(args.getSSLContext(), args.getHostnameVerifier(), + args.eurekaClientHttpRequestFactorySupplier, args.restTemplateBuilderSupplier); } @Override public TransportClientFactory newTransportClientFactory(final EurekaClientConfig clientConfig, final Collection additionalFilters, final InstanceInfo myInstanceInfo, final Optional sslContext, final Optional hostnameVerifier) { - return new RestTemplateTransportClientFactory(this.args.getSSLContext(), this.args.getHostnameVerifier(), - this.args.eurekaClientHttpRequestFactorySupplier, this.args.restTemplateBuilderSupplier); + return new RestTemplateTransportClientFactory(args.getSSLContext(), args.getHostnameVerifier(), + args.eurekaClientHttpRequestFactorySupplier, args.restTemplateBuilderSupplier); } } diff --git a/spring-cloud-netflix-eureka-client/src/main/java/org/springframework/cloud/netflix/eureka/http/RestTemplateTransportClientFactory.java b/spring-cloud-netflix-eureka-client/src/main/java/org/springframework/cloud/netflix/eureka/http/RestTemplateTransportClientFactory.java index f554781e1..9c15ecfe7 100644 --- a/spring-cloud-netflix-eureka-client/src/main/java/org/springframework/cloud/netflix/eureka/http/RestTemplateTransportClientFactory.java +++ b/spring-cloud-netflix-eureka-client/src/main/java/org/springframework/cloud/netflix/eureka/http/RestTemplateTransportClientFactory.java @@ -27,7 +27,6 @@ import com.netflix.discovery.shared.transport.EurekaHttpClient; import com.netflix.discovery.shared.transport.TransportClientFactory; import org.springframework.boot.web.client.RestTemplateBuilder; -import org.springframework.cloud.configuration.SSLContextFactory; import org.springframework.cloud.configuration.TlsProperties; import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatusCode; @@ -35,9 +34,11 @@ import org.springframework.http.client.ClientHttpRequestFactory; import org.springframework.http.client.ClientHttpResponse; import org.springframework.http.client.support.BasicAuthenticationInterceptor; import org.springframework.web.client.DefaultResponseErrorHandler; +import org.springframework.web.client.RestClient; import org.springframework.web.client.RestTemplate; import org.springframework.web.util.UriComponentsBuilder; +import static org.springframework.cloud.netflix.eureka.http.EurekaHttpClientUtils.context; import static org.springframework.cloud.netflix.eureka.http.EurekaHttpClientUtils.extractUserInfo; import static org.springframework.cloud.netflix.eureka.http.EurekaHttpClientUtils.mappingJacksonHttpMessageConverter; @@ -49,7 +50,11 @@ import static org.springframework.cloud.netflix.eureka.http.EurekaHttpClientUtil * @author Daniel Lavoie * @author Armin Krezovic * @author Wonchul Heo + * @author Olga Maciaszek-Sharma + * @deprecated {@link RestTemplate}-based implementation to be removed in favour of + * {@link RestClient}-based implementation. */ +@Deprecated(forRemoval = true) public class RestTemplateTransportClientFactory implements TransportClientFactory { private final Optional sslContext; @@ -60,32 +65,6 @@ public class RestTemplateTransportClientFactory implements TransportClientFactor private final Supplier restTemplateBuilderSupplier; - public RestTemplateTransportClientFactory(TlsProperties tlsProperties, - EurekaClientHttpRequestFactorySupplier eurekaClientHttpRequestFactorySupplier, - Supplier restTemplateBuilderSupplier) { - this.sslContext = context(tlsProperties); - this.hostnameVerifier = Optional.empty(); - this.eurekaClientHttpRequestFactorySupplier = eurekaClientHttpRequestFactorySupplier; - this.restTemplateBuilderSupplier = restTemplateBuilderSupplier; - } - - public RestTemplateTransportClientFactory(TlsProperties tlsProperties, - EurekaClientHttpRequestFactorySupplier eurekaClientHttpRequestFactorySupplier) { - this(tlsProperties, eurekaClientHttpRequestFactorySupplier, RestTemplateBuilder::new); - } - - private Optional context(TlsProperties properties) { - if (properties == null || !properties.isEnabled()) { - return Optional.empty(); - } - try { - return Optional.of(new SSLContextFactory(properties).createSSLContext()); - } - catch (Exception e) { - throw new IllegalStateException(e); - } - } - public RestTemplateTransportClientFactory(Optional sslContext, Optional hostnameVerifier, EurekaClientHttpRequestFactorySupplier eurekaClientHttpRequestFactorySupplier, @@ -96,6 +75,18 @@ public class RestTemplateTransportClientFactory implements TransportClientFactor this.restTemplateBuilderSupplier = restTemplateBuilderSupplier; } + public RestTemplateTransportClientFactory(TlsProperties tlsProperties, + EurekaClientHttpRequestFactorySupplier eurekaClientHttpRequestFactorySupplier, + Supplier restTemplateBuilderSupplier) { + this(context(tlsProperties), Optional.empty(), eurekaClientHttpRequestFactorySupplier, + restTemplateBuilderSupplier); + } + + public RestTemplateTransportClientFactory(TlsProperties tlsProperties, + EurekaClientHttpRequestFactorySupplier eurekaClientHttpRequestFactorySupplier) { + this(tlsProperties, eurekaClientHttpRequestFactorySupplier, RestTemplateBuilder::new); + } + public RestTemplateTransportClientFactory(Optional sslContext, Optional hostnameVerifier, EurekaClientHttpRequestFactorySupplier eurekaClientHttpRequestFactorySupplier) { @@ -103,6 +94,11 @@ public class RestTemplateTransportClientFactory implements TransportClientFactor this(sslContext, hostnameVerifier, eurekaClientHttpRequestFactorySupplier, RestTemplateBuilder::new); } + // Visible for testing + /** + * @deprecated pass the default values while initialising object in test classes. + */ + @Deprecated(forRemoval = true) public RestTemplateTransportClientFactory() { this(Optional.empty(), Optional.empty(), new DefaultEurekaClientHttpRequestFactorySupplier()); } diff --git a/spring-cloud-netflix-eureka-client/src/test/java/org/springframework/cloud/netflix/eureka/http/RestClientEurekaHttpClientTests.java b/spring-cloud-netflix-eureka-client/src/test/java/org/springframework/cloud/netflix/eureka/http/RestClientEurekaHttpClientTests.java index dfac061ed..a9fafc0cc 100644 --- a/spring-cloud-netflix-eureka-client/src/test/java/org/springframework/cloud/netflix/eureka/http/RestClientEurekaHttpClientTests.java +++ b/spring-cloud-netflix-eureka-client/src/test/java/org/springframework/cloud/netflix/eureka/http/RestClientEurekaHttpClientTests.java @@ -16,6 +16,8 @@ package org.springframework.cloud.netflix.eureka.http; +import java.util.Optional; + import com.netflix.appinfo.providers.EurekaConfigBasedInstanceInfoProvider; import com.netflix.discovery.shared.resolver.DefaultEndpoint; import org.junit.jupiter.api.BeforeEach; @@ -26,11 +28,15 @@ import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; import org.springframework.cloud.commons.util.InetUtils; import org.springframework.cloud.netflix.eureka.EurekaInstanceConfigBean; +import org.springframework.cloud.netflix.eureka.RestClientTimeoutProperties; import org.springframework.test.annotation.DirtiesContext; import org.springframework.web.client.RestClient; /** + * Tests for {@link RestClientEurekaHttpClient}. + * * @author Wonchul Heo + * @author Olga Maciaszek-Sharma */ @SpringBootTest(classes = EurekaServerMockApplication.class, properties = { "debug=true", "security.basic.enabled=true", "eureka.client.fetch-registry=false", @@ -47,7 +53,9 @@ class RestClientEurekaHttpClientTests extends AbstractEurekaHttpClientTests { @BeforeEach void setup() { - eurekaHttpClient = new RestClientTransportClientFactory(RestClient::builder) + eurekaHttpClient = new RestClientTransportClientFactory(Optional.empty(), Optional.empty(), + new DefaultEurekaClientHttpRequestFactorySupplier(new RestClientTimeoutProperties()), + RestClient::builder) .newClient(new DefaultEndpoint(serviceUrl)); EurekaInstanceConfigBean config = new EurekaInstanceConfigBean(inetUtils); diff --git a/spring-cloud-netflix-eureka-client/src/test/java/org/springframework/cloud/netflix/eureka/http/RestClientTransportClientFactoryTests.java b/spring-cloud-netflix-eureka-client/src/test/java/org/springframework/cloud/netflix/eureka/http/RestClientTransportClientFactoryTests.java index 0c4269475..067b272c0 100644 --- a/spring-cloud-netflix-eureka-client/src/test/java/org/springframework/cloud/netflix/eureka/http/RestClientTransportClientFactoryTests.java +++ b/spring-cloud-netflix-eureka-client/src/test/java/org/springframework/cloud/netflix/eureka/http/RestClientTransportClientFactoryTests.java @@ -16,18 +16,24 @@ package org.springframework.cloud.netflix.eureka.http; +import java.util.Optional; + import com.netflix.discovery.shared.resolver.DefaultEndpoint; import com.netflix.discovery.shared.transport.EurekaHttpClient; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import org.springframework.cloud.netflix.eureka.RestClientTimeoutProperties; import org.springframework.web.client.RestClient; import static org.assertj.core.api.Assertions.assertThat; /** + * Tests for {@link RestClientTransportClientFactory}. + * * @author Wonchul Heo + * @author Olga Maciaszek-Sharma */ class RestClientTransportClientFactoryTests { @@ -35,7 +41,9 @@ class RestClientTransportClientFactoryTests { @BeforeEach void setup() { - transportClientFactory = new RestClientTransportClientFactory(RestClient::builder); + transportClientFactory = new RestClientTransportClientFactory(Optional.empty(), Optional.empty(), + new DefaultEurekaClientHttpRequestFactorySupplier(new RestClientTimeoutProperties()), + RestClient::builder); } @Test From 6c146ffb50d857de141f3d22a24b22c0d3525b63 Mon Sep 17 00:00:00 2001 From: spring-builds Date: Fri, 8 Nov 2024 02:28:36 +0000 Subject: [PATCH 2/7] Update SNAPSHOT to 4.2.0-RC1 --- docs/modules/ROOT/partials/_configprops.adoc | 212 +++++++++--------- docs/pom.xml | 2 +- pom.xml | 8 +- spring-cloud-netflix-dependencies/pom.xml | 4 +- .../pom.xml | 2 +- spring-cloud-netflix-eureka-client/pom.xml | 2 +- spring-cloud-netflix-eureka-server/pom.xml | 2 +- .../pom.xml | 2 +- .../pom.xml | 2 +- 9 files changed, 118 insertions(+), 118 deletions(-) diff --git a/docs/modules/ROOT/partials/_configprops.adoc b/docs/modules/ROOT/partials/_configprops.adoc index aa4ea8916..72cc4751f 100644 --- a/docs/modules/ROOT/partials/_configprops.adoc +++ b/docs/modules/ROOT/partials/_configprops.adoc @@ -36,7 +36,7 @@ |eureka.client.on-demand-update-status-change | `+++true+++` | If set to true, local status updates via ApplicationInfoManager will trigger on-demand (but rate limited) register/updates to remote eureka servers. |eureka.client.order | `+++0+++` | Order of the discovery client used by `CompositeDiscoveryClient` for sorting available clients. |eureka.client.prefer-same-zone-eureka | `+++true+++` | Indicates whether or not this instance should try to use the eureka server in the same zone for latency and/or other reason. Ideally eureka clients are configured to talk to servers in the same zone The changes are effective at runtime at the next registry fetch cycle as specified by registryFetchIntervalSeconds -|eureka.client.property-resolver | | +|eureka.client.property-resolver | | |eureka.client.proxy-host | | Gets the proxy host to eureka server if any. |eureka.client.proxy-password | | Gets the proxy password if any. |eureka.client.proxy-port | | Gets the proxy port to eureka server if any. @@ -46,24 +46,24 @@ |eureka.client.register-with-eureka | `+++true+++` | Indicates whether or not this instance should register its information with eureka server for discovery by others. In some cases, you do not want your instances to be discovered whereas you just want do discover other instances. |eureka.client.registry-fetch-interval-seconds | `+++30+++` | Indicates how often(in seconds) to fetch the registry information from the eureka server. |eureka.client.registry-refresh-single-vip-address | | Indicates whether the client is only interested in the registry information for a single VIP. -|eureka.client.rest-template-timeout.connect-request-timeout | `+++180000+++` | +|eureka.client.rest-template-timeout.connect-request-timeout | `+++180000+++` | |eureka.client.rest-template-timeout.connect-timeout | `+++180000+++` | Default values are set to 180000, in keeping with {@link RequestConfig} and {@link SocketConfig} defaults. -|eureka.client.rest-template-timeout.socket-timeout | `+++180000+++` | +|eureka.client.rest-template-timeout.socket-timeout | `+++180000+++` | |eureka.client.restclient.enabled | `+++false+++` | Enables the use of RestClient for Eureka HTTP Client. -|eureka.client.restclient.timeout.connect-request-timeout | `+++180000+++` | +|eureka.client.restclient.timeout.connect-request-timeout | `+++180000+++` | |eureka.client.restclient.timeout.connect-timeout | `+++180000+++` | Default values are set to 180000, in keeping with {@link RequestConfig} and {@link SocketConfig} defaults. -|eureka.client.restclient.timeout.socket-timeout | `+++180000+++` | +|eureka.client.restclient.timeout.socket-timeout | `+++180000+++` | |eureka.client.service-url | | Map of availability zone to list of fully qualified URLs to communicate with eureka server. Each value can be a single URL or a comma separated list of alternative locations. Typically the eureka server URLs carry protocol,host,port,context and version information if any. Example: https://ec2-256-156-243-129.compute-1.amazonaws.com:7001/eureka/ The changes are effective at runtime at the next service url refresh cycle as specified by eurekaServiceUrlPollIntervalSeconds. |eureka.client.should-enforce-registration-at-init | `+++false+++` | Indicates whether the client should enforce registration during initialization. Defaults to false. |eureka.client.should-unregister-on-shutdown | `+++true+++` | Indicates whether the client should explicitly unregister itself from the remote server on client shutdown. -|eureka.client.tls.enabled | | -|eureka.client.tls.key-password | | -|eureka.client.tls.key-store | | -|eureka.client.tls.key-store-password | | -|eureka.client.tls.key-store-type | | -|eureka.client.tls.trust-store | | -|eureka.client.tls.trust-store-password | | -|eureka.client.tls.trust-store-type | | +|eureka.client.tls.enabled | | +|eureka.client.tls.key-password | | +|eureka.client.tls.key-store | | +|eureka.client.tls.key-store-password | | +|eureka.client.tls.key-store-type | | +|eureka.client.tls.trust-store | | +|eureka.client.tls.trust-store-password | | +|eureka.client.tls.trust-store-type | | |eureka.client.use-dns-for-fetching-service-urls | `+++false+++` | Indicates whether the eureka client should use the DNS mechanism to fetch a list of eureka servers to talk to. When the DNS name is updated to have additional servers, that information is used immediately after the eureka client polls for that information as specified in eurekaServiceUrlPollIntervalSeconds. Alternatively, the service urls can be returned serviceUrls, but the users should implement their own mechanism to return the updated list in case of changes. The changes are effective at runtime. |eureka.client.webclient.enabled | `+++false+++` | Enables the use of WebClient for Eureka HTTP Client. |eureka.dashboard.enabled | `+++true+++` | Flag to enable the Eureka dashboard. Default true. @@ -75,8 +75,8 @@ |eureka.instance.appname | `+++unknown+++` | Get the name of the application to be registered with eureka. |eureka.instance.async-client-initialization | `+++false+++` | If true the EurekaClient will be initialized asynchronously when the InstanceRegistry bean is created. |eureka.instance.data-center-info | | Returns the data center this instance is deployed. This information is used to get some AWS specific instance information if the instance is deployed in AWS. -|eureka.instance.default-address-resolution-order | `+++[]+++` | -|eureka.instance.environment | | +|eureka.instance.default-address-resolution-order | `+++[]+++` | +|eureka.instance.environment | | |eureka.instance.health-check-url | | Gets the absolute health check page URL for this instance. The users can provide the healthCheckUrlPath if the health check page resides in the same instance talking to eureka, else in the cases where the instance is a proxy for some other server, users can provide the full URL. If the full URL is provided it takes precedence.

It is normally used for making educated decisions based on the health of the instance - for example, it can be used to determine whether to proceed deployments to an entire farm or stop the deployments without causing further damage. The full URL should follow the format http://${eureka.hostname}:7001/ where the value ${eureka.hostname} is replaced at runtime. |eureka.instance.health-check-url-path | | Gets the relative health check URL path for this instance. The health check page URL is then constructed out of the hostname and the type of communication - secure or unsecure as specified in securePort and nonSecurePort. It is normally used for making educated decisions based on the health of the instance - for example, it can be used to determine whether to proceed deployments to an entire farm or stop the deployments without causing further damage. |eureka.instance.home-page-url | | Gets the absolute home page URL for this instance. The users can provide the homePageUrlPath if the home page resides in the same instance talking to eureka, else in the cases where the instance is a proxy for some other server, users can provide the full URL. If the full URL is provided it takes precedence. It is normally used for informational purposes for other services to use it as a landing page. The full URL should follow the format http://${eureka.hostname}:7001/ where the value ${eureka.hostname} is replaced at runtime. @@ -95,7 +95,7 @@ |eureka.instance.non-secure-port-enabled | `+++true+++` | Indicates whether the non-secure port should be enabled for traffic or not. |eureka.instance.prefer-ip-address | `+++false+++` | Flag to say that, when guessing a hostname, the IP address of the server should be used in preference to the hostname reported by the OS. |eureka.instance.registry.default-open-for-traffic-count | `+++1+++` | Value used in determining when leases are cancelled, default to 1 for standalone. Should be set to 0 for peer replicated eurekas -|eureka.instance.registry.expected-number-of-clients-sending-renews | `+++1+++` | +|eureka.instance.registry.expected-number-of-clients-sending-renews | `+++1+++` | |eureka.instance.secure-health-check-url | | Gets the absolute secure health check page URL for this instance. The users can provide the secureHealthCheckUrl if the health check page resides in the same instance talking to eureka, else in the cases where the instance is a proxy for some other server, users can provide the full URL. If the full URL is provided it takes precedence.

It is normally used for making educated decisions based on the health of the instance - for example, it can be used to determine whether to proceed deployments to an entire farm or stop the deployments without causing further damage. The full URL should follow the format http://${eureka.hostname}:7001/ where the value ${eureka.hostname} is replaced at runtime. |eureka.instance.secure-port | `+++443+++` | Get the Secure port on which the instance should receive traffic. |eureka.instance.secure-port-enabled | `+++false+++` | Indicates whether the secure port should be enabled for traffic or not. @@ -103,83 +103,83 @@ |eureka.instance.status-page-url | | Gets the absolute status page URL path for this instance. The users can provide the statusPageUrlPath if the status page resides in the same instance talking to eureka, else in the cases where the instance is a proxy for some other server, users can provide the full URL. If the full URL is provided it takes precedence. It is normally used for informational purposes for other services to find about the status of this instance. Users can provide a simple HTML indicating what is the current status of the instance. |eureka.instance.status-page-url-path | | Gets the relative status page URL path for this instance. The status page URL is then constructed out of the hostName and the type of communication - secure or unsecure as specified in securePort and nonSecurePort. It is normally used for informational purposes for other services to find about the status of this instance. Users can provide a simple HTML indicating what is the current status of the instance. |eureka.instance.virtual-host-name | `+++unknown+++` | Gets the virtual host name defined for this instance. This is typically the way other instance would find this instance by using the virtual host name.Think of this as similar to the fully qualified domain name, that the users of your services will need to find this instance. -|eureka.server.a-s-g-cache-expiry-timeout-ms | `+++600000+++` | -|eureka.server.a-s-g-query-timeout-ms | `+++300+++` | -|eureka.server.a-s-g-update-interval-ms | `+++300000+++` | -|eureka.server.a-w-s-access-id | | -|eureka.server.a-w-s-secret-key | | -|eureka.server.batch-replication | `+++false+++` | -|eureka.server.binding-strategy | `+++eip+++` | -|eureka.server.delta-retention-timer-interval-in-ms | `+++30000+++` | -|eureka.server.disable-delta | `+++false+++` | -|eureka.server.disable-delta-for-remote-regions | `+++false+++` | -|eureka.server.disable-transparent-fallback-to-other-region | `+++false+++` | -|eureka.server.e-i-p-bind-rebind-retries | `+++3+++` | -|eureka.server.e-i-p-binding-retry-interval-ms | `+++300000+++` | -|eureka.server.e-i-p-binding-retry-interval-ms-when-unbound | `+++60000+++` | -|eureka.server.enable-replicated-request-compression | `+++false+++` | -|eureka.server.enable-self-preservation | `+++true+++` | -|eureka.server.eviction-interval-timer-in-ms | `+++0+++` | -|eureka.server.expected-client-renewal-interval-seconds | `+++30+++` | -|eureka.server.g-zip-content-from-remote-region | `+++true+++` | -|eureka.server.initial-capacity-of-response-cache | `+++1000+++` | -|eureka.server.json-codec-name | | -|eureka.server.list-auto-scaling-groups-role-name | `+++ListAutoScalingGroups+++` | -|eureka.server.log-identity-headers | `+++true+++` | -|eureka.server.max-elements-in-peer-replication-pool | `+++10000+++` | -|eureka.server.max-elements-in-status-replication-pool | `+++10000+++` | -|eureka.server.max-idle-thread-age-in-minutes-for-peer-replication | `+++15+++` | -|eureka.server.max-idle-thread-in-minutes-age-for-status-replication | `+++10+++` | -|eureka.server.max-threads-for-peer-replication | `+++20+++` | -|eureka.server.max-threads-for-status-replication | `+++1+++` | -|eureka.server.max-time-for-replication | `+++30000+++` | +|eureka.server.a-s-g-cache-expiry-timeout-ms | `+++600000+++` | +|eureka.server.a-s-g-query-timeout-ms | `+++300+++` | +|eureka.server.a-s-g-update-interval-ms | `+++300000+++` | +|eureka.server.a-w-s-access-id | | +|eureka.server.a-w-s-secret-key | | +|eureka.server.batch-replication | `+++false+++` | +|eureka.server.binding-strategy | `+++eip+++` | +|eureka.server.delta-retention-timer-interval-in-ms | `+++30000+++` | +|eureka.server.disable-delta | `+++false+++` | +|eureka.server.disable-delta-for-remote-regions | `+++false+++` | +|eureka.server.disable-transparent-fallback-to-other-region | `+++false+++` | +|eureka.server.e-i-p-bind-rebind-retries | `+++3+++` | +|eureka.server.e-i-p-binding-retry-interval-ms | `+++300000+++` | +|eureka.server.e-i-p-binding-retry-interval-ms-when-unbound | `+++60000+++` | +|eureka.server.enable-replicated-request-compression | `+++false+++` | +|eureka.server.enable-self-preservation | `+++true+++` | +|eureka.server.eviction-interval-timer-in-ms | `+++0+++` | +|eureka.server.expected-client-renewal-interval-seconds | `+++30+++` | +|eureka.server.g-zip-content-from-remote-region | `+++true+++` | +|eureka.server.initial-capacity-of-response-cache | `+++1000+++` | +|eureka.server.json-codec-name | | +|eureka.server.list-auto-scaling-groups-role-name | `+++ListAutoScalingGroups+++` | +|eureka.server.log-identity-headers | `+++true+++` | +|eureka.server.max-elements-in-peer-replication-pool | `+++10000+++` | +|eureka.server.max-elements-in-status-replication-pool | `+++10000+++` | +|eureka.server.max-idle-thread-age-in-minutes-for-peer-replication | `+++15+++` | +|eureka.server.max-idle-thread-in-minutes-age-for-status-replication | `+++10+++` | +|eureka.server.max-threads-for-peer-replication | `+++20+++` | +|eureka.server.max-threads-for-status-replication | `+++1+++` | +|eureka.server.max-time-for-replication | `+++30000+++` | |eureka.server.metrics.enabled | `+++false+++` | Indicates whether the metrics should be enabled for eureka instances. -|eureka.server.min-available-instances-for-peer-replication | `+++-1+++` | -|eureka.server.min-threads-for-peer-replication | `+++5+++` | -|eureka.server.min-threads-for-status-replication | `+++1+++` | -|eureka.server.my-url | | -|eureka.server.number-of-replication-retries | `+++5+++` | -|eureka.server.peer-eureka-nodes-update-interval-ms | `+++600000+++` | -|eureka.server.peer-eureka-status-refresh-time-interval-ms | `+++0+++` | -|eureka.server.peer-node-connect-timeout-ms | `+++200+++` | -|eureka.server.peer-node-connection-idle-timeout-seconds | `+++30+++` | -|eureka.server.peer-node-read-timeout-ms | `+++200+++` | -|eureka.server.peer-node-total-connections | `+++1000+++` | -|eureka.server.peer-node-total-connections-per-host | `+++500+++` | -|eureka.server.prime-aws-replica-connections | `+++true+++` | -|eureka.server.property-resolver | | -|eureka.server.rate-limiter-burst-size | `+++10+++` | -|eureka.server.rate-limiter-enabled | `+++false+++` | -|eureka.server.rate-limiter-full-fetch-average-rate | `+++100+++` | -|eureka.server.rate-limiter-privileged-clients | | -|eureka.server.rate-limiter-registry-fetch-average-rate | `+++500+++` | -|eureka.server.rate-limiter-throttle-standard-clients | `+++false+++` | -|eureka.server.registry-sync-retries | `+++0+++` | -|eureka.server.registry-sync-retry-wait-ms | `+++0+++` | -|eureka.server.remote-region-app-whitelist | | -|eureka.server.remote-region-connect-timeout-ms | `+++1000+++` | -|eureka.server.remote-region-connection-idle-timeout-seconds | `+++30+++` | -|eureka.server.remote-region-fetch-thread-pool-size | `+++20+++` | -|eureka.server.remote-region-read-timeout-ms | `+++1000+++` | -|eureka.server.remote-region-registry-fetch-interval | `+++30+++` | -|eureka.server.remote-region-total-connections | `+++1000+++` | -|eureka.server.remote-region-total-connections-per-host | `+++500+++` | -|eureka.server.remote-region-trust-store | | -|eureka.server.remote-region-trust-store-password | `+++changeit+++` | -|eureka.server.remote-region-urls | | -|eureka.server.remote-region-urls-with-name | | -|eureka.server.renewal-percent-threshold | `+++0.85+++` | -|eureka.server.renewal-threshold-update-interval-ms | `+++900000+++` | -|eureka.server.response-cache-auto-expiration-in-seconds | `+++180+++` | -|eureka.server.response-cache-update-interval-ms | `+++30000+++` | -|eureka.server.retention-time-in-m-s-in-delta-queue | `+++180000+++` | -|eureka.server.route53-bind-rebind-retries | `+++3+++` | -|eureka.server.route53-binding-retry-interval-ms | `+++300000+++` | -|eureka.server.route53-domain-t-t-l | `+++30+++` | -|eureka.server.sync-when-timestamp-differs | `+++true+++` | -|eureka.server.use-read-only-response-cache | `+++true+++` | -|eureka.server.wait-time-in-ms-when-sync-empty | `+++300000+++` | -|eureka.server.xml-codec-name | | +|eureka.server.min-available-instances-for-peer-replication | `+++-1+++` | +|eureka.server.min-threads-for-peer-replication | `+++5+++` | +|eureka.server.min-threads-for-status-replication | `+++1+++` | +|eureka.server.my-url | | +|eureka.server.number-of-replication-retries | `+++5+++` | +|eureka.server.peer-eureka-nodes-update-interval-ms | `+++600000+++` | +|eureka.server.peer-eureka-status-refresh-time-interval-ms | `+++0+++` | +|eureka.server.peer-node-connect-timeout-ms | `+++200+++` | +|eureka.server.peer-node-connection-idle-timeout-seconds | `+++30+++` | +|eureka.server.peer-node-read-timeout-ms | `+++200+++` | +|eureka.server.peer-node-total-connections | `+++1000+++` | +|eureka.server.peer-node-total-connections-per-host | `+++500+++` | +|eureka.server.prime-aws-replica-connections | `+++true+++` | +|eureka.server.property-resolver | | +|eureka.server.rate-limiter-burst-size | `+++10+++` | +|eureka.server.rate-limiter-enabled | `+++false+++` | +|eureka.server.rate-limiter-full-fetch-average-rate | `+++100+++` | +|eureka.server.rate-limiter-privileged-clients | | +|eureka.server.rate-limiter-registry-fetch-average-rate | `+++500+++` | +|eureka.server.rate-limiter-throttle-standard-clients | `+++false+++` | +|eureka.server.registry-sync-retries | `+++0+++` | +|eureka.server.registry-sync-retry-wait-ms | `+++0+++` | +|eureka.server.remote-region-app-whitelist | | +|eureka.server.remote-region-connect-timeout-ms | `+++1000+++` | +|eureka.server.remote-region-connection-idle-timeout-seconds | `+++30+++` | +|eureka.server.remote-region-fetch-thread-pool-size | `+++20+++` | +|eureka.server.remote-region-read-timeout-ms | `+++1000+++` | +|eureka.server.remote-region-registry-fetch-interval | `+++30+++` | +|eureka.server.remote-region-total-connections | `+++1000+++` | +|eureka.server.remote-region-total-connections-per-host | `+++500+++` | +|eureka.server.remote-region-trust-store | | +|eureka.server.remote-region-trust-store-password | `+++changeit+++` | +|eureka.server.remote-region-urls | | +|eureka.server.remote-region-urls-with-name | | +|eureka.server.renewal-percent-threshold | `+++0.85+++` | +|eureka.server.renewal-threshold-update-interval-ms | `+++900000+++` | +|eureka.server.response-cache-auto-expiration-in-seconds | `+++180+++` | +|eureka.server.response-cache-update-interval-ms | `+++30000+++` | +|eureka.server.retention-time-in-m-s-in-delta-queue | `+++180000+++` | +|eureka.server.route53-bind-rebind-retries | `+++3+++` | +|eureka.server.route53-binding-retry-interval-ms | `+++300000+++` | +|eureka.server.route53-domain-t-t-l | `+++30+++` | +|eureka.server.sync-when-timestamp-differs | `+++true+++` | +|eureka.server.use-read-only-response-cache | `+++true+++` | +|eureka.server.wait-time-in-ms-when-sync-empty | `+++300000+++` | +|eureka.server.xml-codec-name | | |spring.cloud.compatibility-verifier.compatible-boot-versions | `+++3.4.x+++` | Default accepted versions for the Spring Boot dependency. You can set {@code x} for the patch version if you don't want to specify a concrete value. Example: {@code 3.4.x} |spring.cloud.compatibility-verifier.enabled | `+++false+++` | Enables creation of Spring Cloud compatibility verification. |spring.cloud.config.allow-override | `+++true+++` | Flag to indicate that {@link #isOverrideSystemProperties() systemPropertiesOverride} can be used. Set to false to prevent users from changing the default accidentally. Default true. @@ -188,24 +188,24 @@ |spring.cloud.config.override-system-properties | `+++true+++` | Flag to indicate that the external properties should override system properties. Default true. |spring.cloud.decrypt-environment-post-processor.enabled | `+++true+++` | Enable the DecryptEnvironmentPostProcessor. |spring.cloud.discovery.client.composite-indicator.enabled | `+++true+++` | Enables discovery client composite health indicator. -|spring.cloud.discovery.client.health-indicator.enabled | `+++true+++` | -|spring.cloud.discovery.client.health-indicator.include-description | `+++false+++` | +|spring.cloud.discovery.client.health-indicator.enabled | `+++true+++` | +|spring.cloud.discovery.client.health-indicator.include-description | `+++false+++` | |spring.cloud.discovery.client.health-indicator.use-services-query | `+++true+++` | Whether or not the indicator should use {@link DiscoveryClient#getServices} to check its health. When set to {@code false} the indicator instead uses the lighter {@link DiscoveryClient#probe()}. This can be helpful in large deployments where the number of services returned makes the operation unnecessarily heavy. -|spring.cloud.discovery.client.simple.instances | | -|spring.cloud.discovery.client.simple.local.host | | -|spring.cloud.discovery.client.simple.local.instance-id | | -|spring.cloud.discovery.client.simple.local.metadata | | -|spring.cloud.discovery.client.simple.local.port | `+++0+++` | -|spring.cloud.discovery.client.simple.local.secure | `+++false+++` | -|spring.cloud.discovery.client.simple.local.service-id | | -|spring.cloud.discovery.client.simple.local.uri | | -|spring.cloud.discovery.client.simple.order | | +|spring.cloud.discovery.client.simple.instances | | +|spring.cloud.discovery.client.simple.local.host | | +|spring.cloud.discovery.client.simple.local.instance-id | | +|spring.cloud.discovery.client.simple.local.metadata | | +|spring.cloud.discovery.client.simple.local.port | `+++0+++` | +|spring.cloud.discovery.client.simple.local.secure | `+++false+++` | +|spring.cloud.discovery.client.simple.local.service-id | | +|spring.cloud.discovery.client.simple.local.uri | | +|spring.cloud.discovery.client.simple.order | | |spring.cloud.discovery.enabled | `+++true+++` | Enables discovery client health indicators. |spring.cloud.features.enabled | `+++true+++` | Enables the features endpoint. |spring.cloud.httpclientfactories.apache.enabled | `+++true+++` | Enables creation of Apache Http Client factory beans. |spring.cloud.httpclientfactories.ok.enabled | `+++true+++` | Enables creation of OK Http Client factory beans. -|spring.cloud.hypermedia.refresh.fixed-delay | `+++5000+++` | -|spring.cloud.hypermedia.refresh.initial-delay | `+++10000+++` | +|spring.cloud.hypermedia.refresh.fixed-delay | `+++5000+++` | +|spring.cloud.hypermedia.refresh.initial-delay | `+++10000+++` | |spring.cloud.inetutils.default-hostname | `+++localhost+++` | The default hostname. Used in case of errors. |spring.cloud.inetutils.default-ip-address | `+++127.0.0.1+++` | The default IP address. Used in case of errors. |spring.cloud.inetutils.ignored-interfaces | | List of Java regular expressions for network interfaces that will be ignored. @@ -217,7 +217,7 @@ |spring.cloud.loadbalancer.cache.enabled | `+++true+++` | Enables Spring Cloud LoadBalancer caching mechanism. |spring.cloud.loadbalancer.cache.ttl | `+++35s+++` | Time To Live - time counted from writing of the record, after which cache entries are expired, expressed as a {@link Duration}. The property {@link String} has to be in keeping with the appropriate syntax as specified in Spring Boot StringToDurationConverter. @see StringToDurationConverter.java |spring.cloud.loadbalancer.call-get-with-request-on-delegates | `+++true+++` | If this flag is set to {@code true}, {@code ServiceInstanceListSupplier#get(Request request)} method will be implemented to call {@code delegate.get(request)} in classes assignable from {@code DelegatingServiceInstanceListSupplier} that don't already implement that method, with the exclusion of {@code CachingServiceInstanceListSupplier} and {@code HealthCheckServiceInstanceListSupplier}, which should be placed in the instance supplier hierarchy directly after the supplier performing instance retrieval over the network, before any request-based filtering is done, {@code true} by default. -|spring.cloud.loadbalancer.clients | | +|spring.cloud.loadbalancer.clients | | |spring.cloud.loadbalancer.configurations | `+++default+++` | Enables a predefined LoadBalancer configuration. |spring.cloud.loadbalancer.eager-load.clients | | Names of the clients. |spring.cloud.loadbalancer.enabled | `+++true+++` | Enables Spring Cloud LoadBalancer. diff --git a/docs/pom.xml b/docs/pom.xml index 4bd35ea60..4ef37f87c 100644 --- a/docs/pom.xml +++ b/docs/pom.xml @@ -8,7 +8,7 @@ org.springframework.cloud spring-cloud-netflix - 4.2.0-SNAPSHOT + 4.2.0-RC1 .. jar diff --git a/pom.xml b/pom.xml index aac243ab5..2812b5471 100644 --- a/pom.xml +++ b/pom.xml @@ -3,14 +3,14 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 spring-cloud-netflix - 4.2.0-SNAPSHOT + 4.2.0-RC1 pom Spring Cloud Netflix Spring Cloud Netflix org.springframework.cloud spring-cloud-build - 4.2.0-SNAPSHOT + 4.2.0-RC1 @@ -21,8 +21,8 @@ netflix - 4.2.0-SNAPSHOT - 4.2.0-SNAPSHOT + 4.2.0-RC1 + 4.2.0-RC1 1.20.3 5.15.0 diff --git a/spring-cloud-netflix-dependencies/pom.xml b/spring-cloud-netflix-dependencies/pom.xml index 3f5185af6..c6567ac9d 100644 --- a/spring-cloud-netflix-dependencies/pom.xml +++ b/spring-cloud-netflix-dependencies/pom.xml @@ -5,11 +5,11 @@ spring-cloud-dependencies-parent org.springframework.cloud - 4.2.0-SNAPSHOT + 4.2.0-RC1 spring-cloud-netflix-dependencies - 4.2.0-SNAPSHOT + 4.2.0-RC1 pom spring-cloud-netflix-dependencies Spring Cloud Netflix Dependencies diff --git a/spring-cloud-netflix-eureka-client-tls-tests/pom.xml b/spring-cloud-netflix-eureka-client-tls-tests/pom.xml index 49caa3440..20b000aac 100644 --- a/spring-cloud-netflix-eureka-client-tls-tests/pom.xml +++ b/spring-cloud-netflix-eureka-client-tls-tests/pom.xml @@ -5,7 +5,7 @@ org.springframework.cloud spring-cloud-netflix - 4.2.0-SNAPSHOT + 4.2.0-RC1 .. spring-cloud-netflix-eureka-client-tls-tests diff --git a/spring-cloud-netflix-eureka-client/pom.xml b/spring-cloud-netflix-eureka-client/pom.xml index 97c799d2d..53204692e 100644 --- a/spring-cloud-netflix-eureka-client/pom.xml +++ b/spring-cloud-netflix-eureka-client/pom.xml @@ -6,7 +6,7 @@ org.springframework.cloud spring-cloud-netflix - 4.2.0-SNAPSHOT + 4.2.0-RC1 .. spring-cloud-netflix-eureka-client diff --git a/spring-cloud-netflix-eureka-server/pom.xml b/spring-cloud-netflix-eureka-server/pom.xml index d6b1efb37..7deb9e372 100644 --- a/spring-cloud-netflix-eureka-server/pom.xml +++ b/spring-cloud-netflix-eureka-server/pom.xml @@ -5,7 +5,7 @@ org.springframework.cloud spring-cloud-netflix - 4.2.0-SNAPSHOT + 4.2.0-RC1 .. spring-cloud-netflix-eureka-server diff --git a/spring-cloud-starter-netflix-eureka-client/pom.xml b/spring-cloud-starter-netflix-eureka-client/pom.xml index c1d1273bb..6ee734caa 100644 --- a/spring-cloud-starter-netflix-eureka-client/pom.xml +++ b/spring-cloud-starter-netflix-eureka-client/pom.xml @@ -4,7 +4,7 @@ org.springframework.cloud spring-cloud-netflix - 4.2.0-SNAPSHOT + 4.2.0-RC1 spring-cloud-starter-netflix-eureka-client Spring Cloud Starter Netflix Eureka Client diff --git a/spring-cloud-starter-netflix-eureka-server/pom.xml b/spring-cloud-starter-netflix-eureka-server/pom.xml index 8682a904f..38e77bb83 100644 --- a/spring-cloud-starter-netflix-eureka-server/pom.xml +++ b/spring-cloud-starter-netflix-eureka-server/pom.xml @@ -3,7 +3,7 @@ org.springframework.cloud spring-cloud-netflix - 4.2.0-SNAPSHOT + 4.2.0-RC1 spring-cloud-starter-netflix-eureka-server Spring Cloud Starter Netflix Eureka Server From 3eb9d1b17d3b02d894ee877e84b152b6c7c03731 Mon Sep 17 00:00:00 2001 From: spring-builds Date: Fri, 8 Nov 2024 02:29:12 +0000 Subject: [PATCH 3/7] Going back to snapshots --- docs/modules/ROOT/partials/_configprops.adoc | 212 +++++++++--------- docs/pom.xml | 2 +- pom.xml | 8 +- spring-cloud-netflix-dependencies/pom.xml | 4 +- .../pom.xml | 2 +- spring-cloud-netflix-eureka-client/pom.xml | 2 +- spring-cloud-netflix-eureka-server/pom.xml | 2 +- .../pom.xml | 2 +- .../pom.xml | 2 +- 9 files changed, 118 insertions(+), 118 deletions(-) diff --git a/docs/modules/ROOT/partials/_configprops.adoc b/docs/modules/ROOT/partials/_configprops.adoc index 72cc4751f..aa4ea8916 100644 --- a/docs/modules/ROOT/partials/_configprops.adoc +++ b/docs/modules/ROOT/partials/_configprops.adoc @@ -36,7 +36,7 @@ |eureka.client.on-demand-update-status-change | `+++true+++` | If set to true, local status updates via ApplicationInfoManager will trigger on-demand (but rate limited) register/updates to remote eureka servers. |eureka.client.order | `+++0+++` | Order of the discovery client used by `CompositeDiscoveryClient` for sorting available clients. |eureka.client.prefer-same-zone-eureka | `+++true+++` | Indicates whether or not this instance should try to use the eureka server in the same zone for latency and/or other reason. Ideally eureka clients are configured to talk to servers in the same zone The changes are effective at runtime at the next registry fetch cycle as specified by registryFetchIntervalSeconds -|eureka.client.property-resolver | | +|eureka.client.property-resolver | | |eureka.client.proxy-host | | Gets the proxy host to eureka server if any. |eureka.client.proxy-password | | Gets the proxy password if any. |eureka.client.proxy-port | | Gets the proxy port to eureka server if any. @@ -46,24 +46,24 @@ |eureka.client.register-with-eureka | `+++true+++` | Indicates whether or not this instance should register its information with eureka server for discovery by others. In some cases, you do not want your instances to be discovered whereas you just want do discover other instances. |eureka.client.registry-fetch-interval-seconds | `+++30+++` | Indicates how often(in seconds) to fetch the registry information from the eureka server. |eureka.client.registry-refresh-single-vip-address | | Indicates whether the client is only interested in the registry information for a single VIP. -|eureka.client.rest-template-timeout.connect-request-timeout | `+++180000+++` | +|eureka.client.rest-template-timeout.connect-request-timeout | `+++180000+++` | |eureka.client.rest-template-timeout.connect-timeout | `+++180000+++` | Default values are set to 180000, in keeping with {@link RequestConfig} and {@link SocketConfig} defaults. -|eureka.client.rest-template-timeout.socket-timeout | `+++180000+++` | +|eureka.client.rest-template-timeout.socket-timeout | `+++180000+++` | |eureka.client.restclient.enabled | `+++false+++` | Enables the use of RestClient for Eureka HTTP Client. -|eureka.client.restclient.timeout.connect-request-timeout | `+++180000+++` | +|eureka.client.restclient.timeout.connect-request-timeout | `+++180000+++` | |eureka.client.restclient.timeout.connect-timeout | `+++180000+++` | Default values are set to 180000, in keeping with {@link RequestConfig} and {@link SocketConfig} defaults. -|eureka.client.restclient.timeout.socket-timeout | `+++180000+++` | +|eureka.client.restclient.timeout.socket-timeout | `+++180000+++` | |eureka.client.service-url | | Map of availability zone to list of fully qualified URLs to communicate with eureka server. Each value can be a single URL or a comma separated list of alternative locations. Typically the eureka server URLs carry protocol,host,port,context and version information if any. Example: https://ec2-256-156-243-129.compute-1.amazonaws.com:7001/eureka/ The changes are effective at runtime at the next service url refresh cycle as specified by eurekaServiceUrlPollIntervalSeconds. |eureka.client.should-enforce-registration-at-init | `+++false+++` | Indicates whether the client should enforce registration during initialization. Defaults to false. |eureka.client.should-unregister-on-shutdown | `+++true+++` | Indicates whether the client should explicitly unregister itself from the remote server on client shutdown. -|eureka.client.tls.enabled | | -|eureka.client.tls.key-password | | -|eureka.client.tls.key-store | | -|eureka.client.tls.key-store-password | | -|eureka.client.tls.key-store-type | | -|eureka.client.tls.trust-store | | -|eureka.client.tls.trust-store-password | | -|eureka.client.tls.trust-store-type | | +|eureka.client.tls.enabled | | +|eureka.client.tls.key-password | | +|eureka.client.tls.key-store | | +|eureka.client.tls.key-store-password | | +|eureka.client.tls.key-store-type | | +|eureka.client.tls.trust-store | | +|eureka.client.tls.trust-store-password | | +|eureka.client.tls.trust-store-type | | |eureka.client.use-dns-for-fetching-service-urls | `+++false+++` | Indicates whether the eureka client should use the DNS mechanism to fetch a list of eureka servers to talk to. When the DNS name is updated to have additional servers, that information is used immediately after the eureka client polls for that information as specified in eurekaServiceUrlPollIntervalSeconds. Alternatively, the service urls can be returned serviceUrls, but the users should implement their own mechanism to return the updated list in case of changes. The changes are effective at runtime. |eureka.client.webclient.enabled | `+++false+++` | Enables the use of WebClient for Eureka HTTP Client. |eureka.dashboard.enabled | `+++true+++` | Flag to enable the Eureka dashboard. Default true. @@ -75,8 +75,8 @@ |eureka.instance.appname | `+++unknown+++` | Get the name of the application to be registered with eureka. |eureka.instance.async-client-initialization | `+++false+++` | If true the EurekaClient will be initialized asynchronously when the InstanceRegistry bean is created. |eureka.instance.data-center-info | | Returns the data center this instance is deployed. This information is used to get some AWS specific instance information if the instance is deployed in AWS. -|eureka.instance.default-address-resolution-order | `+++[]+++` | -|eureka.instance.environment | | +|eureka.instance.default-address-resolution-order | `+++[]+++` | +|eureka.instance.environment | | |eureka.instance.health-check-url | | Gets the absolute health check page URL for this instance. The users can provide the healthCheckUrlPath if the health check page resides in the same instance talking to eureka, else in the cases where the instance is a proxy for some other server, users can provide the full URL. If the full URL is provided it takes precedence.

It is normally used for making educated decisions based on the health of the instance - for example, it can be used to determine whether to proceed deployments to an entire farm or stop the deployments without causing further damage. The full URL should follow the format http://${eureka.hostname}:7001/ where the value ${eureka.hostname} is replaced at runtime. |eureka.instance.health-check-url-path | | Gets the relative health check URL path for this instance. The health check page URL is then constructed out of the hostname and the type of communication - secure or unsecure as specified in securePort and nonSecurePort. It is normally used for making educated decisions based on the health of the instance - for example, it can be used to determine whether to proceed deployments to an entire farm or stop the deployments without causing further damage. |eureka.instance.home-page-url | | Gets the absolute home page URL for this instance. The users can provide the homePageUrlPath if the home page resides in the same instance talking to eureka, else in the cases where the instance is a proxy for some other server, users can provide the full URL. If the full URL is provided it takes precedence. It is normally used for informational purposes for other services to use it as a landing page. The full URL should follow the format http://${eureka.hostname}:7001/ where the value ${eureka.hostname} is replaced at runtime. @@ -95,7 +95,7 @@ |eureka.instance.non-secure-port-enabled | `+++true+++` | Indicates whether the non-secure port should be enabled for traffic or not. |eureka.instance.prefer-ip-address | `+++false+++` | Flag to say that, when guessing a hostname, the IP address of the server should be used in preference to the hostname reported by the OS. |eureka.instance.registry.default-open-for-traffic-count | `+++1+++` | Value used in determining when leases are cancelled, default to 1 for standalone. Should be set to 0 for peer replicated eurekas -|eureka.instance.registry.expected-number-of-clients-sending-renews | `+++1+++` | +|eureka.instance.registry.expected-number-of-clients-sending-renews | `+++1+++` | |eureka.instance.secure-health-check-url | | Gets the absolute secure health check page URL for this instance. The users can provide the secureHealthCheckUrl if the health check page resides in the same instance talking to eureka, else in the cases where the instance is a proxy for some other server, users can provide the full URL. If the full URL is provided it takes precedence.

It is normally used for making educated decisions based on the health of the instance - for example, it can be used to determine whether to proceed deployments to an entire farm or stop the deployments without causing further damage. The full URL should follow the format http://${eureka.hostname}:7001/ where the value ${eureka.hostname} is replaced at runtime. |eureka.instance.secure-port | `+++443+++` | Get the Secure port on which the instance should receive traffic. |eureka.instance.secure-port-enabled | `+++false+++` | Indicates whether the secure port should be enabled for traffic or not. @@ -103,83 +103,83 @@ |eureka.instance.status-page-url | | Gets the absolute status page URL path for this instance. The users can provide the statusPageUrlPath if the status page resides in the same instance talking to eureka, else in the cases where the instance is a proxy for some other server, users can provide the full URL. If the full URL is provided it takes precedence. It is normally used for informational purposes for other services to find about the status of this instance. Users can provide a simple HTML indicating what is the current status of the instance. |eureka.instance.status-page-url-path | | Gets the relative status page URL path for this instance. The status page URL is then constructed out of the hostName and the type of communication - secure or unsecure as specified in securePort and nonSecurePort. It is normally used for informational purposes for other services to find about the status of this instance. Users can provide a simple HTML indicating what is the current status of the instance. |eureka.instance.virtual-host-name | `+++unknown+++` | Gets the virtual host name defined for this instance. This is typically the way other instance would find this instance by using the virtual host name.Think of this as similar to the fully qualified domain name, that the users of your services will need to find this instance. -|eureka.server.a-s-g-cache-expiry-timeout-ms | `+++600000+++` | -|eureka.server.a-s-g-query-timeout-ms | `+++300+++` | -|eureka.server.a-s-g-update-interval-ms | `+++300000+++` | -|eureka.server.a-w-s-access-id | | -|eureka.server.a-w-s-secret-key | | -|eureka.server.batch-replication | `+++false+++` | -|eureka.server.binding-strategy | `+++eip+++` | -|eureka.server.delta-retention-timer-interval-in-ms | `+++30000+++` | -|eureka.server.disable-delta | `+++false+++` | -|eureka.server.disable-delta-for-remote-regions | `+++false+++` | -|eureka.server.disable-transparent-fallback-to-other-region | `+++false+++` | -|eureka.server.e-i-p-bind-rebind-retries | `+++3+++` | -|eureka.server.e-i-p-binding-retry-interval-ms | `+++300000+++` | -|eureka.server.e-i-p-binding-retry-interval-ms-when-unbound | `+++60000+++` | -|eureka.server.enable-replicated-request-compression | `+++false+++` | -|eureka.server.enable-self-preservation | `+++true+++` | -|eureka.server.eviction-interval-timer-in-ms | `+++0+++` | -|eureka.server.expected-client-renewal-interval-seconds | `+++30+++` | -|eureka.server.g-zip-content-from-remote-region | `+++true+++` | -|eureka.server.initial-capacity-of-response-cache | `+++1000+++` | -|eureka.server.json-codec-name | | -|eureka.server.list-auto-scaling-groups-role-name | `+++ListAutoScalingGroups+++` | -|eureka.server.log-identity-headers | `+++true+++` | -|eureka.server.max-elements-in-peer-replication-pool | `+++10000+++` | -|eureka.server.max-elements-in-status-replication-pool | `+++10000+++` | -|eureka.server.max-idle-thread-age-in-minutes-for-peer-replication | `+++15+++` | -|eureka.server.max-idle-thread-in-minutes-age-for-status-replication | `+++10+++` | -|eureka.server.max-threads-for-peer-replication | `+++20+++` | -|eureka.server.max-threads-for-status-replication | `+++1+++` | -|eureka.server.max-time-for-replication | `+++30000+++` | +|eureka.server.a-s-g-cache-expiry-timeout-ms | `+++600000+++` | +|eureka.server.a-s-g-query-timeout-ms | `+++300+++` | +|eureka.server.a-s-g-update-interval-ms | `+++300000+++` | +|eureka.server.a-w-s-access-id | | +|eureka.server.a-w-s-secret-key | | +|eureka.server.batch-replication | `+++false+++` | +|eureka.server.binding-strategy | `+++eip+++` | +|eureka.server.delta-retention-timer-interval-in-ms | `+++30000+++` | +|eureka.server.disable-delta | `+++false+++` | +|eureka.server.disable-delta-for-remote-regions | `+++false+++` | +|eureka.server.disable-transparent-fallback-to-other-region | `+++false+++` | +|eureka.server.e-i-p-bind-rebind-retries | `+++3+++` | +|eureka.server.e-i-p-binding-retry-interval-ms | `+++300000+++` | +|eureka.server.e-i-p-binding-retry-interval-ms-when-unbound | `+++60000+++` | +|eureka.server.enable-replicated-request-compression | `+++false+++` | +|eureka.server.enable-self-preservation | `+++true+++` | +|eureka.server.eviction-interval-timer-in-ms | `+++0+++` | +|eureka.server.expected-client-renewal-interval-seconds | `+++30+++` | +|eureka.server.g-zip-content-from-remote-region | `+++true+++` | +|eureka.server.initial-capacity-of-response-cache | `+++1000+++` | +|eureka.server.json-codec-name | | +|eureka.server.list-auto-scaling-groups-role-name | `+++ListAutoScalingGroups+++` | +|eureka.server.log-identity-headers | `+++true+++` | +|eureka.server.max-elements-in-peer-replication-pool | `+++10000+++` | +|eureka.server.max-elements-in-status-replication-pool | `+++10000+++` | +|eureka.server.max-idle-thread-age-in-minutes-for-peer-replication | `+++15+++` | +|eureka.server.max-idle-thread-in-minutes-age-for-status-replication | `+++10+++` | +|eureka.server.max-threads-for-peer-replication | `+++20+++` | +|eureka.server.max-threads-for-status-replication | `+++1+++` | +|eureka.server.max-time-for-replication | `+++30000+++` | |eureka.server.metrics.enabled | `+++false+++` | Indicates whether the metrics should be enabled for eureka instances. -|eureka.server.min-available-instances-for-peer-replication | `+++-1+++` | -|eureka.server.min-threads-for-peer-replication | `+++5+++` | -|eureka.server.min-threads-for-status-replication | `+++1+++` | -|eureka.server.my-url | | -|eureka.server.number-of-replication-retries | `+++5+++` | -|eureka.server.peer-eureka-nodes-update-interval-ms | `+++600000+++` | -|eureka.server.peer-eureka-status-refresh-time-interval-ms | `+++0+++` | -|eureka.server.peer-node-connect-timeout-ms | `+++200+++` | -|eureka.server.peer-node-connection-idle-timeout-seconds | `+++30+++` | -|eureka.server.peer-node-read-timeout-ms | `+++200+++` | -|eureka.server.peer-node-total-connections | `+++1000+++` | -|eureka.server.peer-node-total-connections-per-host | `+++500+++` | -|eureka.server.prime-aws-replica-connections | `+++true+++` | -|eureka.server.property-resolver | | -|eureka.server.rate-limiter-burst-size | `+++10+++` | -|eureka.server.rate-limiter-enabled | `+++false+++` | -|eureka.server.rate-limiter-full-fetch-average-rate | `+++100+++` | -|eureka.server.rate-limiter-privileged-clients | | -|eureka.server.rate-limiter-registry-fetch-average-rate | `+++500+++` | -|eureka.server.rate-limiter-throttle-standard-clients | `+++false+++` | -|eureka.server.registry-sync-retries | `+++0+++` | -|eureka.server.registry-sync-retry-wait-ms | `+++0+++` | -|eureka.server.remote-region-app-whitelist | | -|eureka.server.remote-region-connect-timeout-ms | `+++1000+++` | -|eureka.server.remote-region-connection-idle-timeout-seconds | `+++30+++` | -|eureka.server.remote-region-fetch-thread-pool-size | `+++20+++` | -|eureka.server.remote-region-read-timeout-ms | `+++1000+++` | -|eureka.server.remote-region-registry-fetch-interval | `+++30+++` | -|eureka.server.remote-region-total-connections | `+++1000+++` | -|eureka.server.remote-region-total-connections-per-host | `+++500+++` | -|eureka.server.remote-region-trust-store | | -|eureka.server.remote-region-trust-store-password | `+++changeit+++` | -|eureka.server.remote-region-urls | | -|eureka.server.remote-region-urls-with-name | | -|eureka.server.renewal-percent-threshold | `+++0.85+++` | -|eureka.server.renewal-threshold-update-interval-ms | `+++900000+++` | -|eureka.server.response-cache-auto-expiration-in-seconds | `+++180+++` | -|eureka.server.response-cache-update-interval-ms | `+++30000+++` | -|eureka.server.retention-time-in-m-s-in-delta-queue | `+++180000+++` | -|eureka.server.route53-bind-rebind-retries | `+++3+++` | -|eureka.server.route53-binding-retry-interval-ms | `+++300000+++` | -|eureka.server.route53-domain-t-t-l | `+++30+++` | -|eureka.server.sync-when-timestamp-differs | `+++true+++` | -|eureka.server.use-read-only-response-cache | `+++true+++` | -|eureka.server.wait-time-in-ms-when-sync-empty | `+++300000+++` | -|eureka.server.xml-codec-name | | +|eureka.server.min-available-instances-for-peer-replication | `+++-1+++` | +|eureka.server.min-threads-for-peer-replication | `+++5+++` | +|eureka.server.min-threads-for-status-replication | `+++1+++` | +|eureka.server.my-url | | +|eureka.server.number-of-replication-retries | `+++5+++` | +|eureka.server.peer-eureka-nodes-update-interval-ms | `+++600000+++` | +|eureka.server.peer-eureka-status-refresh-time-interval-ms | `+++0+++` | +|eureka.server.peer-node-connect-timeout-ms | `+++200+++` | +|eureka.server.peer-node-connection-idle-timeout-seconds | `+++30+++` | +|eureka.server.peer-node-read-timeout-ms | `+++200+++` | +|eureka.server.peer-node-total-connections | `+++1000+++` | +|eureka.server.peer-node-total-connections-per-host | `+++500+++` | +|eureka.server.prime-aws-replica-connections | `+++true+++` | +|eureka.server.property-resolver | | +|eureka.server.rate-limiter-burst-size | `+++10+++` | +|eureka.server.rate-limiter-enabled | `+++false+++` | +|eureka.server.rate-limiter-full-fetch-average-rate | `+++100+++` | +|eureka.server.rate-limiter-privileged-clients | | +|eureka.server.rate-limiter-registry-fetch-average-rate | `+++500+++` | +|eureka.server.rate-limiter-throttle-standard-clients | `+++false+++` | +|eureka.server.registry-sync-retries | `+++0+++` | +|eureka.server.registry-sync-retry-wait-ms | `+++0+++` | +|eureka.server.remote-region-app-whitelist | | +|eureka.server.remote-region-connect-timeout-ms | `+++1000+++` | +|eureka.server.remote-region-connection-idle-timeout-seconds | `+++30+++` | +|eureka.server.remote-region-fetch-thread-pool-size | `+++20+++` | +|eureka.server.remote-region-read-timeout-ms | `+++1000+++` | +|eureka.server.remote-region-registry-fetch-interval | `+++30+++` | +|eureka.server.remote-region-total-connections | `+++1000+++` | +|eureka.server.remote-region-total-connections-per-host | `+++500+++` | +|eureka.server.remote-region-trust-store | | +|eureka.server.remote-region-trust-store-password | `+++changeit+++` | +|eureka.server.remote-region-urls | | +|eureka.server.remote-region-urls-with-name | | +|eureka.server.renewal-percent-threshold | `+++0.85+++` | +|eureka.server.renewal-threshold-update-interval-ms | `+++900000+++` | +|eureka.server.response-cache-auto-expiration-in-seconds | `+++180+++` | +|eureka.server.response-cache-update-interval-ms | `+++30000+++` | +|eureka.server.retention-time-in-m-s-in-delta-queue | `+++180000+++` | +|eureka.server.route53-bind-rebind-retries | `+++3+++` | +|eureka.server.route53-binding-retry-interval-ms | `+++300000+++` | +|eureka.server.route53-domain-t-t-l | `+++30+++` | +|eureka.server.sync-when-timestamp-differs | `+++true+++` | +|eureka.server.use-read-only-response-cache | `+++true+++` | +|eureka.server.wait-time-in-ms-when-sync-empty | `+++300000+++` | +|eureka.server.xml-codec-name | | |spring.cloud.compatibility-verifier.compatible-boot-versions | `+++3.4.x+++` | Default accepted versions for the Spring Boot dependency. You can set {@code x} for the patch version if you don't want to specify a concrete value. Example: {@code 3.4.x} |spring.cloud.compatibility-verifier.enabled | `+++false+++` | Enables creation of Spring Cloud compatibility verification. |spring.cloud.config.allow-override | `+++true+++` | Flag to indicate that {@link #isOverrideSystemProperties() systemPropertiesOverride} can be used. Set to false to prevent users from changing the default accidentally. Default true. @@ -188,24 +188,24 @@ |spring.cloud.config.override-system-properties | `+++true+++` | Flag to indicate that the external properties should override system properties. Default true. |spring.cloud.decrypt-environment-post-processor.enabled | `+++true+++` | Enable the DecryptEnvironmentPostProcessor. |spring.cloud.discovery.client.composite-indicator.enabled | `+++true+++` | Enables discovery client composite health indicator. -|spring.cloud.discovery.client.health-indicator.enabled | `+++true+++` | -|spring.cloud.discovery.client.health-indicator.include-description | `+++false+++` | +|spring.cloud.discovery.client.health-indicator.enabled | `+++true+++` | +|spring.cloud.discovery.client.health-indicator.include-description | `+++false+++` | |spring.cloud.discovery.client.health-indicator.use-services-query | `+++true+++` | Whether or not the indicator should use {@link DiscoveryClient#getServices} to check its health. When set to {@code false} the indicator instead uses the lighter {@link DiscoveryClient#probe()}. This can be helpful in large deployments where the number of services returned makes the operation unnecessarily heavy. -|spring.cloud.discovery.client.simple.instances | | -|spring.cloud.discovery.client.simple.local.host | | -|spring.cloud.discovery.client.simple.local.instance-id | | -|spring.cloud.discovery.client.simple.local.metadata | | -|spring.cloud.discovery.client.simple.local.port | `+++0+++` | -|spring.cloud.discovery.client.simple.local.secure | `+++false+++` | -|spring.cloud.discovery.client.simple.local.service-id | | -|spring.cloud.discovery.client.simple.local.uri | | -|spring.cloud.discovery.client.simple.order | | +|spring.cloud.discovery.client.simple.instances | | +|spring.cloud.discovery.client.simple.local.host | | +|spring.cloud.discovery.client.simple.local.instance-id | | +|spring.cloud.discovery.client.simple.local.metadata | | +|spring.cloud.discovery.client.simple.local.port | `+++0+++` | +|spring.cloud.discovery.client.simple.local.secure | `+++false+++` | +|spring.cloud.discovery.client.simple.local.service-id | | +|spring.cloud.discovery.client.simple.local.uri | | +|spring.cloud.discovery.client.simple.order | | |spring.cloud.discovery.enabled | `+++true+++` | Enables discovery client health indicators. |spring.cloud.features.enabled | `+++true+++` | Enables the features endpoint. |spring.cloud.httpclientfactories.apache.enabled | `+++true+++` | Enables creation of Apache Http Client factory beans. |spring.cloud.httpclientfactories.ok.enabled | `+++true+++` | Enables creation of OK Http Client factory beans. -|spring.cloud.hypermedia.refresh.fixed-delay | `+++5000+++` | -|spring.cloud.hypermedia.refresh.initial-delay | `+++10000+++` | +|spring.cloud.hypermedia.refresh.fixed-delay | `+++5000+++` | +|spring.cloud.hypermedia.refresh.initial-delay | `+++10000+++` | |spring.cloud.inetutils.default-hostname | `+++localhost+++` | The default hostname. Used in case of errors. |spring.cloud.inetutils.default-ip-address | `+++127.0.0.1+++` | The default IP address. Used in case of errors. |spring.cloud.inetutils.ignored-interfaces | | List of Java regular expressions for network interfaces that will be ignored. @@ -217,7 +217,7 @@ |spring.cloud.loadbalancer.cache.enabled | `+++true+++` | Enables Spring Cloud LoadBalancer caching mechanism. |spring.cloud.loadbalancer.cache.ttl | `+++35s+++` | Time To Live - time counted from writing of the record, after which cache entries are expired, expressed as a {@link Duration}. The property {@link String} has to be in keeping with the appropriate syntax as specified in Spring Boot StringToDurationConverter. @see StringToDurationConverter.java |spring.cloud.loadbalancer.call-get-with-request-on-delegates | `+++true+++` | If this flag is set to {@code true}, {@code ServiceInstanceListSupplier#get(Request request)} method will be implemented to call {@code delegate.get(request)} in classes assignable from {@code DelegatingServiceInstanceListSupplier} that don't already implement that method, with the exclusion of {@code CachingServiceInstanceListSupplier} and {@code HealthCheckServiceInstanceListSupplier}, which should be placed in the instance supplier hierarchy directly after the supplier performing instance retrieval over the network, before any request-based filtering is done, {@code true} by default. -|spring.cloud.loadbalancer.clients | | +|spring.cloud.loadbalancer.clients | | |spring.cloud.loadbalancer.configurations | `+++default+++` | Enables a predefined LoadBalancer configuration. |spring.cloud.loadbalancer.eager-load.clients | | Names of the clients. |spring.cloud.loadbalancer.enabled | `+++true+++` | Enables Spring Cloud LoadBalancer. diff --git a/docs/pom.xml b/docs/pom.xml index 4ef37f87c..4bd35ea60 100644 --- a/docs/pom.xml +++ b/docs/pom.xml @@ -8,7 +8,7 @@ org.springframework.cloud spring-cloud-netflix - 4.2.0-RC1 + 4.2.0-SNAPSHOT .. jar diff --git a/pom.xml b/pom.xml index 2812b5471..aac243ab5 100644 --- a/pom.xml +++ b/pom.xml @@ -3,14 +3,14 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 spring-cloud-netflix - 4.2.0-RC1 + 4.2.0-SNAPSHOT pom Spring Cloud Netflix Spring Cloud Netflix org.springframework.cloud spring-cloud-build - 4.2.0-RC1 + 4.2.0-SNAPSHOT @@ -21,8 +21,8 @@ netflix - 4.2.0-RC1 - 4.2.0-RC1 + 4.2.0-SNAPSHOT + 4.2.0-SNAPSHOT 1.20.3 5.15.0 diff --git a/spring-cloud-netflix-dependencies/pom.xml b/spring-cloud-netflix-dependencies/pom.xml index c6567ac9d..3f5185af6 100644 --- a/spring-cloud-netflix-dependencies/pom.xml +++ b/spring-cloud-netflix-dependencies/pom.xml @@ -5,11 +5,11 @@ spring-cloud-dependencies-parent org.springframework.cloud - 4.2.0-RC1 + 4.2.0-SNAPSHOT spring-cloud-netflix-dependencies - 4.2.0-RC1 + 4.2.0-SNAPSHOT pom spring-cloud-netflix-dependencies Spring Cloud Netflix Dependencies diff --git a/spring-cloud-netflix-eureka-client-tls-tests/pom.xml b/spring-cloud-netflix-eureka-client-tls-tests/pom.xml index 20b000aac..49caa3440 100644 --- a/spring-cloud-netflix-eureka-client-tls-tests/pom.xml +++ b/spring-cloud-netflix-eureka-client-tls-tests/pom.xml @@ -5,7 +5,7 @@ org.springframework.cloud spring-cloud-netflix - 4.2.0-RC1 + 4.2.0-SNAPSHOT .. spring-cloud-netflix-eureka-client-tls-tests diff --git a/spring-cloud-netflix-eureka-client/pom.xml b/spring-cloud-netflix-eureka-client/pom.xml index 53204692e..97c799d2d 100644 --- a/spring-cloud-netflix-eureka-client/pom.xml +++ b/spring-cloud-netflix-eureka-client/pom.xml @@ -6,7 +6,7 @@ org.springframework.cloud spring-cloud-netflix - 4.2.0-RC1 + 4.2.0-SNAPSHOT .. spring-cloud-netflix-eureka-client diff --git a/spring-cloud-netflix-eureka-server/pom.xml b/spring-cloud-netflix-eureka-server/pom.xml index 7deb9e372..d6b1efb37 100644 --- a/spring-cloud-netflix-eureka-server/pom.xml +++ b/spring-cloud-netflix-eureka-server/pom.xml @@ -5,7 +5,7 @@ org.springframework.cloud spring-cloud-netflix - 4.2.0-RC1 + 4.2.0-SNAPSHOT .. spring-cloud-netflix-eureka-server diff --git a/spring-cloud-starter-netflix-eureka-client/pom.xml b/spring-cloud-starter-netflix-eureka-client/pom.xml index 6ee734caa..c1d1273bb 100644 --- a/spring-cloud-starter-netflix-eureka-client/pom.xml +++ b/spring-cloud-starter-netflix-eureka-client/pom.xml @@ -4,7 +4,7 @@ org.springframework.cloud spring-cloud-netflix - 4.2.0-RC1 + 4.2.0-SNAPSHOT spring-cloud-starter-netflix-eureka-client Spring Cloud Starter Netflix Eureka Client diff --git a/spring-cloud-starter-netflix-eureka-server/pom.xml b/spring-cloud-starter-netflix-eureka-server/pom.xml index 38e77bb83..8682a904f 100644 --- a/spring-cloud-starter-netflix-eureka-server/pom.xml +++ b/spring-cloud-starter-netflix-eureka-server/pom.xml @@ -3,7 +3,7 @@ org.springframework.cloud spring-cloud-netflix - 4.2.0-RC1 + 4.2.0-SNAPSHOT spring-cloud-starter-netflix-eureka-server Spring Cloud Starter Netflix Eureka Server From 9fe5230af5bfb4dedb34c7dd1b273cf01d4c8fd5 Mon Sep 17 00:00:00 2001 From: spring-builds Date: Fri, 8 Nov 2024 05:40:14 +0000 Subject: [PATCH 4/7] Bumping versions --- docs/modules/ROOT/partials/_configprops.adoc | 212 +++++++++---------- 1 file changed, 106 insertions(+), 106 deletions(-) diff --git a/docs/modules/ROOT/partials/_configprops.adoc b/docs/modules/ROOT/partials/_configprops.adoc index aa4ea8916..72cc4751f 100644 --- a/docs/modules/ROOT/partials/_configprops.adoc +++ b/docs/modules/ROOT/partials/_configprops.adoc @@ -36,7 +36,7 @@ |eureka.client.on-demand-update-status-change | `+++true+++` | If set to true, local status updates via ApplicationInfoManager will trigger on-demand (but rate limited) register/updates to remote eureka servers. |eureka.client.order | `+++0+++` | Order of the discovery client used by `CompositeDiscoveryClient` for sorting available clients. |eureka.client.prefer-same-zone-eureka | `+++true+++` | Indicates whether or not this instance should try to use the eureka server in the same zone for latency and/or other reason. Ideally eureka clients are configured to talk to servers in the same zone The changes are effective at runtime at the next registry fetch cycle as specified by registryFetchIntervalSeconds -|eureka.client.property-resolver | | +|eureka.client.property-resolver | | |eureka.client.proxy-host | | Gets the proxy host to eureka server if any. |eureka.client.proxy-password | | Gets the proxy password if any. |eureka.client.proxy-port | | Gets the proxy port to eureka server if any. @@ -46,24 +46,24 @@ |eureka.client.register-with-eureka | `+++true+++` | Indicates whether or not this instance should register its information with eureka server for discovery by others. In some cases, you do not want your instances to be discovered whereas you just want do discover other instances. |eureka.client.registry-fetch-interval-seconds | `+++30+++` | Indicates how often(in seconds) to fetch the registry information from the eureka server. |eureka.client.registry-refresh-single-vip-address | | Indicates whether the client is only interested in the registry information for a single VIP. -|eureka.client.rest-template-timeout.connect-request-timeout | `+++180000+++` | +|eureka.client.rest-template-timeout.connect-request-timeout | `+++180000+++` | |eureka.client.rest-template-timeout.connect-timeout | `+++180000+++` | Default values are set to 180000, in keeping with {@link RequestConfig} and {@link SocketConfig} defaults. -|eureka.client.rest-template-timeout.socket-timeout | `+++180000+++` | +|eureka.client.rest-template-timeout.socket-timeout | `+++180000+++` | |eureka.client.restclient.enabled | `+++false+++` | Enables the use of RestClient for Eureka HTTP Client. -|eureka.client.restclient.timeout.connect-request-timeout | `+++180000+++` | +|eureka.client.restclient.timeout.connect-request-timeout | `+++180000+++` | |eureka.client.restclient.timeout.connect-timeout | `+++180000+++` | Default values are set to 180000, in keeping with {@link RequestConfig} and {@link SocketConfig} defaults. -|eureka.client.restclient.timeout.socket-timeout | `+++180000+++` | +|eureka.client.restclient.timeout.socket-timeout | `+++180000+++` | |eureka.client.service-url | | Map of availability zone to list of fully qualified URLs to communicate with eureka server. Each value can be a single URL or a comma separated list of alternative locations. Typically the eureka server URLs carry protocol,host,port,context and version information if any. Example: https://ec2-256-156-243-129.compute-1.amazonaws.com:7001/eureka/ The changes are effective at runtime at the next service url refresh cycle as specified by eurekaServiceUrlPollIntervalSeconds. |eureka.client.should-enforce-registration-at-init | `+++false+++` | Indicates whether the client should enforce registration during initialization. Defaults to false. |eureka.client.should-unregister-on-shutdown | `+++true+++` | Indicates whether the client should explicitly unregister itself from the remote server on client shutdown. -|eureka.client.tls.enabled | | -|eureka.client.tls.key-password | | -|eureka.client.tls.key-store | | -|eureka.client.tls.key-store-password | | -|eureka.client.tls.key-store-type | | -|eureka.client.tls.trust-store | | -|eureka.client.tls.trust-store-password | | -|eureka.client.tls.trust-store-type | | +|eureka.client.tls.enabled | | +|eureka.client.tls.key-password | | +|eureka.client.tls.key-store | | +|eureka.client.tls.key-store-password | | +|eureka.client.tls.key-store-type | | +|eureka.client.tls.trust-store | | +|eureka.client.tls.trust-store-password | | +|eureka.client.tls.trust-store-type | | |eureka.client.use-dns-for-fetching-service-urls | `+++false+++` | Indicates whether the eureka client should use the DNS mechanism to fetch a list of eureka servers to talk to. When the DNS name is updated to have additional servers, that information is used immediately after the eureka client polls for that information as specified in eurekaServiceUrlPollIntervalSeconds. Alternatively, the service urls can be returned serviceUrls, but the users should implement their own mechanism to return the updated list in case of changes. The changes are effective at runtime. |eureka.client.webclient.enabled | `+++false+++` | Enables the use of WebClient for Eureka HTTP Client. |eureka.dashboard.enabled | `+++true+++` | Flag to enable the Eureka dashboard. Default true. @@ -75,8 +75,8 @@ |eureka.instance.appname | `+++unknown+++` | Get the name of the application to be registered with eureka. |eureka.instance.async-client-initialization | `+++false+++` | If true the EurekaClient will be initialized asynchronously when the InstanceRegistry bean is created. |eureka.instance.data-center-info | | Returns the data center this instance is deployed. This information is used to get some AWS specific instance information if the instance is deployed in AWS. -|eureka.instance.default-address-resolution-order | `+++[]+++` | -|eureka.instance.environment | | +|eureka.instance.default-address-resolution-order | `+++[]+++` | +|eureka.instance.environment | | |eureka.instance.health-check-url | | Gets the absolute health check page URL for this instance. The users can provide the healthCheckUrlPath if the health check page resides in the same instance talking to eureka, else in the cases where the instance is a proxy for some other server, users can provide the full URL. If the full URL is provided it takes precedence.

It is normally used for making educated decisions based on the health of the instance - for example, it can be used to determine whether to proceed deployments to an entire farm or stop the deployments without causing further damage. The full URL should follow the format http://${eureka.hostname}:7001/ where the value ${eureka.hostname} is replaced at runtime. |eureka.instance.health-check-url-path | | Gets the relative health check URL path for this instance. The health check page URL is then constructed out of the hostname and the type of communication - secure or unsecure as specified in securePort and nonSecurePort. It is normally used for making educated decisions based on the health of the instance - for example, it can be used to determine whether to proceed deployments to an entire farm or stop the deployments without causing further damage. |eureka.instance.home-page-url | | Gets the absolute home page URL for this instance. The users can provide the homePageUrlPath if the home page resides in the same instance talking to eureka, else in the cases where the instance is a proxy for some other server, users can provide the full URL. If the full URL is provided it takes precedence. It is normally used for informational purposes for other services to use it as a landing page. The full URL should follow the format http://${eureka.hostname}:7001/ where the value ${eureka.hostname} is replaced at runtime. @@ -95,7 +95,7 @@ |eureka.instance.non-secure-port-enabled | `+++true+++` | Indicates whether the non-secure port should be enabled for traffic or not. |eureka.instance.prefer-ip-address | `+++false+++` | Flag to say that, when guessing a hostname, the IP address of the server should be used in preference to the hostname reported by the OS. |eureka.instance.registry.default-open-for-traffic-count | `+++1+++` | Value used in determining when leases are cancelled, default to 1 for standalone. Should be set to 0 for peer replicated eurekas -|eureka.instance.registry.expected-number-of-clients-sending-renews | `+++1+++` | +|eureka.instance.registry.expected-number-of-clients-sending-renews | `+++1+++` | |eureka.instance.secure-health-check-url | | Gets the absolute secure health check page URL for this instance. The users can provide the secureHealthCheckUrl if the health check page resides in the same instance talking to eureka, else in the cases where the instance is a proxy for some other server, users can provide the full URL. If the full URL is provided it takes precedence.

It is normally used for making educated decisions based on the health of the instance - for example, it can be used to determine whether to proceed deployments to an entire farm or stop the deployments without causing further damage. The full URL should follow the format http://${eureka.hostname}:7001/ where the value ${eureka.hostname} is replaced at runtime. |eureka.instance.secure-port | `+++443+++` | Get the Secure port on which the instance should receive traffic. |eureka.instance.secure-port-enabled | `+++false+++` | Indicates whether the secure port should be enabled for traffic or not. @@ -103,83 +103,83 @@ |eureka.instance.status-page-url | | Gets the absolute status page URL path for this instance. The users can provide the statusPageUrlPath if the status page resides in the same instance talking to eureka, else in the cases where the instance is a proxy for some other server, users can provide the full URL. If the full URL is provided it takes precedence. It is normally used for informational purposes for other services to find about the status of this instance. Users can provide a simple HTML indicating what is the current status of the instance. |eureka.instance.status-page-url-path | | Gets the relative status page URL path for this instance. The status page URL is then constructed out of the hostName and the type of communication - secure or unsecure as specified in securePort and nonSecurePort. It is normally used for informational purposes for other services to find about the status of this instance. Users can provide a simple HTML indicating what is the current status of the instance. |eureka.instance.virtual-host-name | `+++unknown+++` | Gets the virtual host name defined for this instance. This is typically the way other instance would find this instance by using the virtual host name.Think of this as similar to the fully qualified domain name, that the users of your services will need to find this instance. -|eureka.server.a-s-g-cache-expiry-timeout-ms | `+++600000+++` | -|eureka.server.a-s-g-query-timeout-ms | `+++300+++` | -|eureka.server.a-s-g-update-interval-ms | `+++300000+++` | -|eureka.server.a-w-s-access-id | | -|eureka.server.a-w-s-secret-key | | -|eureka.server.batch-replication | `+++false+++` | -|eureka.server.binding-strategy | `+++eip+++` | -|eureka.server.delta-retention-timer-interval-in-ms | `+++30000+++` | -|eureka.server.disable-delta | `+++false+++` | -|eureka.server.disable-delta-for-remote-regions | `+++false+++` | -|eureka.server.disable-transparent-fallback-to-other-region | `+++false+++` | -|eureka.server.e-i-p-bind-rebind-retries | `+++3+++` | -|eureka.server.e-i-p-binding-retry-interval-ms | `+++300000+++` | -|eureka.server.e-i-p-binding-retry-interval-ms-when-unbound | `+++60000+++` | -|eureka.server.enable-replicated-request-compression | `+++false+++` | -|eureka.server.enable-self-preservation | `+++true+++` | -|eureka.server.eviction-interval-timer-in-ms | `+++0+++` | -|eureka.server.expected-client-renewal-interval-seconds | `+++30+++` | -|eureka.server.g-zip-content-from-remote-region | `+++true+++` | -|eureka.server.initial-capacity-of-response-cache | `+++1000+++` | -|eureka.server.json-codec-name | | -|eureka.server.list-auto-scaling-groups-role-name | `+++ListAutoScalingGroups+++` | -|eureka.server.log-identity-headers | `+++true+++` | -|eureka.server.max-elements-in-peer-replication-pool | `+++10000+++` | -|eureka.server.max-elements-in-status-replication-pool | `+++10000+++` | -|eureka.server.max-idle-thread-age-in-minutes-for-peer-replication | `+++15+++` | -|eureka.server.max-idle-thread-in-minutes-age-for-status-replication | `+++10+++` | -|eureka.server.max-threads-for-peer-replication | `+++20+++` | -|eureka.server.max-threads-for-status-replication | `+++1+++` | -|eureka.server.max-time-for-replication | `+++30000+++` | +|eureka.server.a-s-g-cache-expiry-timeout-ms | `+++600000+++` | +|eureka.server.a-s-g-query-timeout-ms | `+++300+++` | +|eureka.server.a-s-g-update-interval-ms | `+++300000+++` | +|eureka.server.a-w-s-access-id | | +|eureka.server.a-w-s-secret-key | | +|eureka.server.batch-replication | `+++false+++` | +|eureka.server.binding-strategy | `+++eip+++` | +|eureka.server.delta-retention-timer-interval-in-ms | `+++30000+++` | +|eureka.server.disable-delta | `+++false+++` | +|eureka.server.disable-delta-for-remote-regions | `+++false+++` | +|eureka.server.disable-transparent-fallback-to-other-region | `+++false+++` | +|eureka.server.e-i-p-bind-rebind-retries | `+++3+++` | +|eureka.server.e-i-p-binding-retry-interval-ms | `+++300000+++` | +|eureka.server.e-i-p-binding-retry-interval-ms-when-unbound | `+++60000+++` | +|eureka.server.enable-replicated-request-compression | `+++false+++` | +|eureka.server.enable-self-preservation | `+++true+++` | +|eureka.server.eviction-interval-timer-in-ms | `+++0+++` | +|eureka.server.expected-client-renewal-interval-seconds | `+++30+++` | +|eureka.server.g-zip-content-from-remote-region | `+++true+++` | +|eureka.server.initial-capacity-of-response-cache | `+++1000+++` | +|eureka.server.json-codec-name | | +|eureka.server.list-auto-scaling-groups-role-name | `+++ListAutoScalingGroups+++` | +|eureka.server.log-identity-headers | `+++true+++` | +|eureka.server.max-elements-in-peer-replication-pool | `+++10000+++` | +|eureka.server.max-elements-in-status-replication-pool | `+++10000+++` | +|eureka.server.max-idle-thread-age-in-minutes-for-peer-replication | `+++15+++` | +|eureka.server.max-idle-thread-in-minutes-age-for-status-replication | `+++10+++` | +|eureka.server.max-threads-for-peer-replication | `+++20+++` | +|eureka.server.max-threads-for-status-replication | `+++1+++` | +|eureka.server.max-time-for-replication | `+++30000+++` | |eureka.server.metrics.enabled | `+++false+++` | Indicates whether the metrics should be enabled for eureka instances. -|eureka.server.min-available-instances-for-peer-replication | `+++-1+++` | -|eureka.server.min-threads-for-peer-replication | `+++5+++` | -|eureka.server.min-threads-for-status-replication | `+++1+++` | -|eureka.server.my-url | | -|eureka.server.number-of-replication-retries | `+++5+++` | -|eureka.server.peer-eureka-nodes-update-interval-ms | `+++600000+++` | -|eureka.server.peer-eureka-status-refresh-time-interval-ms | `+++0+++` | -|eureka.server.peer-node-connect-timeout-ms | `+++200+++` | -|eureka.server.peer-node-connection-idle-timeout-seconds | `+++30+++` | -|eureka.server.peer-node-read-timeout-ms | `+++200+++` | -|eureka.server.peer-node-total-connections | `+++1000+++` | -|eureka.server.peer-node-total-connections-per-host | `+++500+++` | -|eureka.server.prime-aws-replica-connections | `+++true+++` | -|eureka.server.property-resolver | | -|eureka.server.rate-limiter-burst-size | `+++10+++` | -|eureka.server.rate-limiter-enabled | `+++false+++` | -|eureka.server.rate-limiter-full-fetch-average-rate | `+++100+++` | -|eureka.server.rate-limiter-privileged-clients | | -|eureka.server.rate-limiter-registry-fetch-average-rate | `+++500+++` | -|eureka.server.rate-limiter-throttle-standard-clients | `+++false+++` | -|eureka.server.registry-sync-retries | `+++0+++` | -|eureka.server.registry-sync-retry-wait-ms | `+++0+++` | -|eureka.server.remote-region-app-whitelist | | -|eureka.server.remote-region-connect-timeout-ms | `+++1000+++` | -|eureka.server.remote-region-connection-idle-timeout-seconds | `+++30+++` | -|eureka.server.remote-region-fetch-thread-pool-size | `+++20+++` | -|eureka.server.remote-region-read-timeout-ms | `+++1000+++` | -|eureka.server.remote-region-registry-fetch-interval | `+++30+++` | -|eureka.server.remote-region-total-connections | `+++1000+++` | -|eureka.server.remote-region-total-connections-per-host | `+++500+++` | -|eureka.server.remote-region-trust-store | | -|eureka.server.remote-region-trust-store-password | `+++changeit+++` | -|eureka.server.remote-region-urls | | -|eureka.server.remote-region-urls-with-name | | -|eureka.server.renewal-percent-threshold | `+++0.85+++` | -|eureka.server.renewal-threshold-update-interval-ms | `+++900000+++` | -|eureka.server.response-cache-auto-expiration-in-seconds | `+++180+++` | -|eureka.server.response-cache-update-interval-ms | `+++30000+++` | -|eureka.server.retention-time-in-m-s-in-delta-queue | `+++180000+++` | -|eureka.server.route53-bind-rebind-retries | `+++3+++` | -|eureka.server.route53-binding-retry-interval-ms | `+++300000+++` | -|eureka.server.route53-domain-t-t-l | `+++30+++` | -|eureka.server.sync-when-timestamp-differs | `+++true+++` | -|eureka.server.use-read-only-response-cache | `+++true+++` | -|eureka.server.wait-time-in-ms-when-sync-empty | `+++300000+++` | -|eureka.server.xml-codec-name | | +|eureka.server.min-available-instances-for-peer-replication | `+++-1+++` | +|eureka.server.min-threads-for-peer-replication | `+++5+++` | +|eureka.server.min-threads-for-status-replication | `+++1+++` | +|eureka.server.my-url | | +|eureka.server.number-of-replication-retries | `+++5+++` | +|eureka.server.peer-eureka-nodes-update-interval-ms | `+++600000+++` | +|eureka.server.peer-eureka-status-refresh-time-interval-ms | `+++0+++` | +|eureka.server.peer-node-connect-timeout-ms | `+++200+++` | +|eureka.server.peer-node-connection-idle-timeout-seconds | `+++30+++` | +|eureka.server.peer-node-read-timeout-ms | `+++200+++` | +|eureka.server.peer-node-total-connections | `+++1000+++` | +|eureka.server.peer-node-total-connections-per-host | `+++500+++` | +|eureka.server.prime-aws-replica-connections | `+++true+++` | +|eureka.server.property-resolver | | +|eureka.server.rate-limiter-burst-size | `+++10+++` | +|eureka.server.rate-limiter-enabled | `+++false+++` | +|eureka.server.rate-limiter-full-fetch-average-rate | `+++100+++` | +|eureka.server.rate-limiter-privileged-clients | | +|eureka.server.rate-limiter-registry-fetch-average-rate | `+++500+++` | +|eureka.server.rate-limiter-throttle-standard-clients | `+++false+++` | +|eureka.server.registry-sync-retries | `+++0+++` | +|eureka.server.registry-sync-retry-wait-ms | `+++0+++` | +|eureka.server.remote-region-app-whitelist | | +|eureka.server.remote-region-connect-timeout-ms | `+++1000+++` | +|eureka.server.remote-region-connection-idle-timeout-seconds | `+++30+++` | +|eureka.server.remote-region-fetch-thread-pool-size | `+++20+++` | +|eureka.server.remote-region-read-timeout-ms | `+++1000+++` | +|eureka.server.remote-region-registry-fetch-interval | `+++30+++` | +|eureka.server.remote-region-total-connections | `+++1000+++` | +|eureka.server.remote-region-total-connections-per-host | `+++500+++` | +|eureka.server.remote-region-trust-store | | +|eureka.server.remote-region-trust-store-password | `+++changeit+++` | +|eureka.server.remote-region-urls | | +|eureka.server.remote-region-urls-with-name | | +|eureka.server.renewal-percent-threshold | `+++0.85+++` | +|eureka.server.renewal-threshold-update-interval-ms | `+++900000+++` | +|eureka.server.response-cache-auto-expiration-in-seconds | `+++180+++` | +|eureka.server.response-cache-update-interval-ms | `+++30000+++` | +|eureka.server.retention-time-in-m-s-in-delta-queue | `+++180000+++` | +|eureka.server.route53-bind-rebind-retries | `+++3+++` | +|eureka.server.route53-binding-retry-interval-ms | `+++300000+++` | +|eureka.server.route53-domain-t-t-l | `+++30+++` | +|eureka.server.sync-when-timestamp-differs | `+++true+++` | +|eureka.server.use-read-only-response-cache | `+++true+++` | +|eureka.server.wait-time-in-ms-when-sync-empty | `+++300000+++` | +|eureka.server.xml-codec-name | | |spring.cloud.compatibility-verifier.compatible-boot-versions | `+++3.4.x+++` | Default accepted versions for the Spring Boot dependency. You can set {@code x} for the patch version if you don't want to specify a concrete value. Example: {@code 3.4.x} |spring.cloud.compatibility-verifier.enabled | `+++false+++` | Enables creation of Spring Cloud compatibility verification. |spring.cloud.config.allow-override | `+++true+++` | Flag to indicate that {@link #isOverrideSystemProperties() systemPropertiesOverride} can be used. Set to false to prevent users from changing the default accidentally. Default true. @@ -188,24 +188,24 @@ |spring.cloud.config.override-system-properties | `+++true+++` | Flag to indicate that the external properties should override system properties. Default true. |spring.cloud.decrypt-environment-post-processor.enabled | `+++true+++` | Enable the DecryptEnvironmentPostProcessor. |spring.cloud.discovery.client.composite-indicator.enabled | `+++true+++` | Enables discovery client composite health indicator. -|spring.cloud.discovery.client.health-indicator.enabled | `+++true+++` | -|spring.cloud.discovery.client.health-indicator.include-description | `+++false+++` | +|spring.cloud.discovery.client.health-indicator.enabled | `+++true+++` | +|spring.cloud.discovery.client.health-indicator.include-description | `+++false+++` | |spring.cloud.discovery.client.health-indicator.use-services-query | `+++true+++` | Whether or not the indicator should use {@link DiscoveryClient#getServices} to check its health. When set to {@code false} the indicator instead uses the lighter {@link DiscoveryClient#probe()}. This can be helpful in large deployments where the number of services returned makes the operation unnecessarily heavy. -|spring.cloud.discovery.client.simple.instances | | -|spring.cloud.discovery.client.simple.local.host | | -|spring.cloud.discovery.client.simple.local.instance-id | | -|spring.cloud.discovery.client.simple.local.metadata | | -|spring.cloud.discovery.client.simple.local.port | `+++0+++` | -|spring.cloud.discovery.client.simple.local.secure | `+++false+++` | -|spring.cloud.discovery.client.simple.local.service-id | | -|spring.cloud.discovery.client.simple.local.uri | | -|spring.cloud.discovery.client.simple.order | | +|spring.cloud.discovery.client.simple.instances | | +|spring.cloud.discovery.client.simple.local.host | | +|spring.cloud.discovery.client.simple.local.instance-id | | +|spring.cloud.discovery.client.simple.local.metadata | | +|spring.cloud.discovery.client.simple.local.port | `+++0+++` | +|spring.cloud.discovery.client.simple.local.secure | `+++false+++` | +|spring.cloud.discovery.client.simple.local.service-id | | +|spring.cloud.discovery.client.simple.local.uri | | +|spring.cloud.discovery.client.simple.order | | |spring.cloud.discovery.enabled | `+++true+++` | Enables discovery client health indicators. |spring.cloud.features.enabled | `+++true+++` | Enables the features endpoint. |spring.cloud.httpclientfactories.apache.enabled | `+++true+++` | Enables creation of Apache Http Client factory beans. |spring.cloud.httpclientfactories.ok.enabled | `+++true+++` | Enables creation of OK Http Client factory beans. -|spring.cloud.hypermedia.refresh.fixed-delay | `+++5000+++` | -|spring.cloud.hypermedia.refresh.initial-delay | `+++10000+++` | +|spring.cloud.hypermedia.refresh.fixed-delay | `+++5000+++` | +|spring.cloud.hypermedia.refresh.initial-delay | `+++10000+++` | |spring.cloud.inetutils.default-hostname | `+++localhost+++` | The default hostname. Used in case of errors. |spring.cloud.inetutils.default-ip-address | `+++127.0.0.1+++` | The default IP address. Used in case of errors. |spring.cloud.inetutils.ignored-interfaces | | List of Java regular expressions for network interfaces that will be ignored. @@ -217,7 +217,7 @@ |spring.cloud.loadbalancer.cache.enabled | `+++true+++` | Enables Spring Cloud LoadBalancer caching mechanism. |spring.cloud.loadbalancer.cache.ttl | `+++35s+++` | Time To Live - time counted from writing of the record, after which cache entries are expired, expressed as a {@link Duration}. The property {@link String} has to be in keeping with the appropriate syntax as specified in Spring Boot StringToDurationConverter. @see StringToDurationConverter.java |spring.cloud.loadbalancer.call-get-with-request-on-delegates | `+++true+++` | If this flag is set to {@code true}, {@code ServiceInstanceListSupplier#get(Request request)} method will be implemented to call {@code delegate.get(request)} in classes assignable from {@code DelegatingServiceInstanceListSupplier} that don't already implement that method, with the exclusion of {@code CachingServiceInstanceListSupplier} and {@code HealthCheckServiceInstanceListSupplier}, which should be placed in the instance supplier hierarchy directly after the supplier performing instance retrieval over the network, before any request-based filtering is done, {@code true} by default. -|spring.cloud.loadbalancer.clients | | +|spring.cloud.loadbalancer.clients | | |spring.cloud.loadbalancer.configurations | `+++default+++` | Enables a predefined LoadBalancer configuration. |spring.cloud.loadbalancer.eager-load.clients | | Names of the clients. |spring.cloud.loadbalancer.enabled | `+++true+++` | Enables Spring Cloud LoadBalancer. From 9e3007abbfb935c1cdbe1c76cc7cff490d4d7cb0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 19 Nov 2024 14:30:31 +0100 Subject: [PATCH 5/7] Bump @antora/collector-extension in /docs (#4370) --- updated-dependencies: - dependency-name: "@antora/collector-extension" dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- docs/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/package.json b/docs/package.json index cff679751..2054ec1c5 100644 --- a/docs/package.json +++ b/docs/package.json @@ -2,7 +2,7 @@ "dependencies": { "antora": "3.2.0-alpha.6", "@antora/atlas-extension": "1.0.0-alpha.2", - "@antora/collector-extension": "1.0.0-beta.4", + "@antora/collector-extension": "1.0.0-beta.5", "@asciidoctor/tabs": "1.0.0-beta.6", "@springio/antora-extensions": "1.14.2", "@springio/asciidoctor-extensions": "1.0.0-alpha.14" From 8e541f408a10ccc08ff641a112129c6d9d9f8b15 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 19 Nov 2024 14:32:45 +0100 Subject: [PATCH 6/7] Bump codecov/codecov-action from 4 to 5 (#4366) Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 4 to 5. - [Release notes](https://github.com/codecov/codecov-action/releases) - [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/codecov/codecov-action/compare/v4...v5) --- updated-dependencies: - dependency-name: codecov/codecov-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/maven.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index f9c048e4a..7e6f06596 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -28,6 +28,6 @@ jobs: cache: 'maven' - name: Build with Maven run: ./mvnw clean install -B -U -P sonar - - uses: codecov/codecov-action@v4 + - uses: codecov/codecov-action@v5 with: fail_ci_if_error: false From 31cb7c19bca07a32649b91ee49b91ded896421a9 Mon Sep 17 00:00:00 2001 From: Emmanuel Ferdman Date: Tue, 19 Nov 2024 16:29:47 +0200 Subject: [PATCH 7/7] Update code of conduct reference (#4372) Signed-off-by: Emmanuel Ferdman --- .github/CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index b44059e78..8de18274e 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -17,7 +17,7 @@ given the ability to merge pull requests. ## Code of Conduct This project adheres to the Contributor Covenant [code of -conduct](https://github.com/spring-cloud/spring-cloud-build/blob/main/docs/src/main/asciidoc/code-of-conduct.adoc). By participating, you are expected to uphold this code. Please report +conduct](https://github.com/spring-cloud/spring-cloud-build/blob/main/docs/modules/ROOT/partials/code-of-conduct.adoc). By participating, you are expected to uphold this code. Please report unacceptable behavior to spring-code-of-conduct@pivotal.io. ## Code Conventions and Housekeeping