From 395386414d243f6f78c489f61971acb4a5f0c003 Mon Sep 17 00:00:00 2001 From: Olga Maciaszek-Sharma Date: Thu, 24 Mar 2022 16:38:23 +0100 Subject: [PATCH] Add missing LB properties to additiona-spring-configuration-metadata and configprops. Fix typo. Fixes gh-1086. --- docs/src/main/asciidoc/_configprops.adoc | 18 +++ .../loadbalancer/LoadBalancerProperties.java | 2 +- ...itional-spring-configuration-metadata.json | 106 ++++++++++++++++++ 3 files changed, 125 insertions(+), 1 deletion(-) diff --git a/docs/src/main/asciidoc/_configprops.adoc b/docs/src/main/asciidoc/_configprops.adoc index f902f04e..8306f3e8 100644 --- a/docs/src/main/asciidoc/_configprops.adoc +++ b/docs/src/main/asciidoc/_configprops.adoc @@ -33,14 +33,32 @@ |spring.cloud.loadbalancer.configurations | `default` | Enables a predefined LoadBalancer configuration. |spring.cloud.loadbalancer.enabled | `true` | Enables Spring Cloud LoadBalancer. |spring.cloud.loadbalancer.health-check | | Properties for HealthCheckServiceInstanceListSupplier. +|spring.cloud.loadbalancer.health-check.initial-delay | `0` | Initial delay value for the HealthCheck scheduler. +|spring.cloud.loadbalancer.health-check.interval | `25s` | Interval for rerunning the HealthCheck scheduler. +|spring.cloud.loadbalancer.health-check.path | | Path at which the health-check request should be made. Can be set up per `serviceId`. A `default` value can be set up as well. If none is set up, `/actuator/health` will be used. +|spring.cloud.loadbalancer.health-check.port | | Path at which the health-check request should be made. If none is set, the port under which the requested service is available at the service instance. +|spring.cloud.loadbalancer.health-check.refetch-instances | `false` | Indicates whether the instances should be refetched by the `HealthCheckServiceInstanceListSupplier`. This can be used if the instances can be updated and the underlying delegate does not provide an ongoing flux. +|spring.cloud.loadbalancer.health-check.refetch-instances-interval | `25s` | Interval for refetching available service instances. +|spring.cloud.loadbalancer.health-check.repeat-health-check | `true` | Indicates whether health checks should keep repeating. It might be useful to set it to `false` if periodically refetching the instances, as every refetch will also trigger a healthcheck. |spring.cloud.loadbalancer.hint | | Allows setting the value of hint that is passed on to the LoadBalancer request and can subsequently be used in {@link ReactiveLoadBalancer} implementations. |spring.cloud.loadbalancer.hint-header-name | `X-SC-LB-Hint` | Allows setting the name of the header used for passing the hint for hint-based service instance filtering. |spring.cloud.loadbalancer.retry | | Properties for Spring-Retry and Reactor Retry support in Spring Cloud LoadBalancer. |spring.cloud.loadbalancer.retry.avoid-previous-instance | `true` | Enables wrapping ServiceInstanceListSupplier beans with `RetryAwareServiceInstanceListSupplier` if Spring-Retry is in the classpath. +|spring.cloud.loadbalancer.retry.backoff.enabled | `false` | Indicates whether Reactor Retry backoffs should be applied. +|spring.cloud.loadbalancer.retry.backoff.jitter | `0.5` | Used to set `RetryBackoffSpec.jitter`. +|spring.cloud.loadbalancer.retry.backoff.max-backoff | `Long.MAX ms` | Used to set `RetryBackoffSpec.maxBackoff`. +|spring.cloud.loadbalancer.retry.backoff.min-backoff | `5 ms` | Used to set `RetryBackoffSpec#minBackoff`. |spring.cloud.loadbalancer.retry.enabled | | Enables LoadBalancer retries. +|spring.cloud.loadbalancer.retry.max-retries-on-next-service-instance | `1` | Number of retries to be executed on the next `ServiceInstance`. A `ServiceInstance` is chosen before each retry call. +|spring.cloud.loadbalancer.retry.max-retries-on-same-service-instance | `0` | umber of retries to be executed on the same `ServiceInstance`. +|spring.cloud.loadbalancer.retry.retry-on-all-operations | `false` | Indicates retries should be attempted on operations other than `HttpMethod.GET`}. +|spring.cloud.loadbalancer.retry.retryable-status-codes | `{}` | A `Set` of status codes that should trigger a retry. |spring.cloud.loadbalancer.service-discovery.timeout | | String representation of Duration of the timeout for calls to service discovery. |spring.cloud.loadbalancer.sticky-session | | Properties for LoadBalancer sticky-session. +|spring.cloud.loadbalancer.sticky-session.add-service-instance-cookie | `false` | Indicates whether a cookie with the newly selected instance should be added by LoadBalancer. +|spring.cloud.loadbalancer.sticky-session.instance-id-cookie-name | `sc-lb-instance-id` | The name of the cookie holding the preferred instance id. |spring.cloud.loadbalancer.x-forwarded | | Enabling X-Forwarded Host and Proto Headers. +|spring.cloud.loadbalancer.x-forwarded.enabled | `false` | To Enable X-Forwarded Headers. |spring.cloud.loadbalancer.zone | | Spring Cloud LoadBalancer zone. |spring.cloud.refresh.additional-property-sources-to-retain | | Additional property sources to retain during a refresh. Typically only system property sources are retained. This property allows property sources, such as property sources created by EnvironmentPostProcessors to be retained as well. |spring.cloud.refresh.enabled | `true` | Enables autoconfiguration for the refresh scope and associated features. diff --git a/spring-cloud-commons/src/main/java/org/springframework/cloud/client/loadbalancer/LoadBalancerProperties.java b/spring-cloud-commons/src/main/java/org/springframework/cloud/client/loadbalancer/LoadBalancerProperties.java index 388f99b1..8fdc7e06 100644 --- a/spring-cloud-commons/src/main/java/org/springframework/cloud/client/loadbalancer/LoadBalancerProperties.java +++ b/spring-cloud-commons/src/main/java/org/springframework/cloud/client/loadbalancer/LoadBalancerProperties.java @@ -194,7 +194,7 @@ public class LoadBalancerProperties { private Map path = new LinkedCaseInsensitiveMap<>(); /** - * Path at which the health-check request should be made. If none is set, the port + * Port at which the health-check request should be made. If none is set, the port * under which the requested service is available at the service instance. */ private Integer port; diff --git a/spring-cloud-commons/src/main/resources/META-INF/additional-spring-configuration-metadata.json b/spring-cloud-commons/src/main/resources/META-INF/additional-spring-configuration-metadata.json index 3439d82e..6565216b 100644 --- a/spring-cloud-commons/src/main/resources/META-INF/additional-spring-configuration-metadata.json +++ b/spring-cloud-commons/src/main/resources/META-INF/additional-spring-configuration-metadata.json @@ -52,6 +52,112 @@ "name": "spring.cloud.loadbalancer.retry.enabled", "description": "Enables LoadBalancer retries.", "type": "java.lang.Boolean" + }, + { + "name": "spring.cloud.loadbalancer.health-check.initial-delay", + "defaultValue": 0, + "description": "Initial delay value for the HealthCheck scheduler.", + "type": "java.time.Duration" + }, + { + "name": "spring.cloud.loadbalancer.health-check.interval ", + "defaultValue": "25s", + "description": "Interval for rerunning the HealthCheck scheduler.", + "type": "java.time.Duration" + }, + { + "name": "spring.cloud.loadbalancer.health-check.path", + "description": "Path at which the health-check request should be made. Can be set up per `serviceId`. A `default` value can be set up as well. If none is set up, `/actuator/health` will be used.", + "type": "java.util.Map" + }, + { + "name": "spring.cloud.loadbalancer.health-check.port", + "description": "Path at which the health-check request should be made. If none is set, the port under which the requested service is available at the service instance.", + "type": "java.lang.Integer" + }, + { + "name": "spring.cloud.loadbalancer.health-check.refetch-instances", + "defaultValue": false, + "description": "Indicates whether the instances should be refetched by the `HealthCheckServiceInstanceListSupplier`. This can be used if the instances can be updated and the underlying delegate does not provide an ongoing flux.", + "type": "java.lang.Boolean" + }, + { + "name": "spring.cloud.loadbalancer.health-check.refetch-instances-interval", + "defaultValue": "25s", + "description": "Interval for refetching available service instances.", + "type": "java.time.Duration" + }, + { + "name": "spring.cloud.loadbalancer.health-check.repeat-health-check", + "defaultValue": true, + "description": "Indicates whether health checks should keep repeating. It might be useful to set it to `false` if periodically refetching the instances, as every refetch will also trigger a healthcheck.", + "type": "java.lang.Boolean" + }, + { + "name": "spring.cloud.loadbalancer.retry.backoff.enabled", + "defaultValue": false, + "description": "Indicates whether Reactor Retry backoffs should be applied.", + "type": "java.lang.Boolean" + }, + { + "name": "spring.cloud.loadbalancer.retry.backoff.jitter", + "defaultValue": 0.5, + "description": "Used to set `RetryBackoffSpec.jitter`.", + "type": "java.lang.Double" + }, + { + "name": "spring.cloud.loadbalancer.retry.backoff.max-backoff", + "defaultValue": "Long.MAX ms", + "description": "Used to set `RetryBackoffSpec.maxBackoff`.", + "type": "java.time.Duration" + }, + { + "name": "spring.cloud.loadbalancer.retry.backoff.min-backoff", + "defaultValue": "5 ms", + "description": "Used to set `RetryBackoffSpec#minBackoff`.", + "type": "java.time.Duration" + }, + { + "name": "spring.cloud.loadbalancer.retry.max-retries-on-next-service-instance", + "defaultValue": 1, + "description": "Number of retries to be executed on the next `ServiceInstance`. A `ServiceInstance` is chosen before each retry call.", + "type": "java.lang.Integer" + }, + { + "name": "spring.cloud.loadbalancer.retry.max-retries-on-same-service-instance", + "defaultValue": 0, + "description": "umber of retries to be executed on the same `ServiceInstance`.", + "type": "java.lang.Integer" + }, + { + "name": "spring.cloud.loadbalancer.retry.retry-on-all-operations", + "defaultValue": false, + "description": "Indicates retries should be attempted on operations other than `HttpMethod.GET`}.", + "type": "java.lang.Boolean" + }, + { + "name": "spring.cloud.loadbalancer.retry.retryable-status-codes", + "defaultValue": "{}", + "description": "A `Set` of status codes that should trigger a retry.", + "type": "java.util.Set" + }, + { + "name": "spring.cloud.loadbalancer.sticky-session.add-service-instance-cookie", + "defaultValue": false, + "description": "Indicates whether a cookie with the newly selected instance should be added by LoadBalancer.", + "type": "java.lang.Boolean" + }, + { + "name": "spring.cloud.loadbalancer.sticky-session.instance-id-cookie-name", + "defaultValue": "sc-lb-instance-id", + "description": "The name of the cookie holding the preferred instance id.", + "type": "java.lang.String" + }, + { + "name": "spring.cloud.loadbalancer.x-forwarded.enabled", + "defaultValue": false, + "description": "To Enable X-Forwarded Headers.", + "type": "java.lang.Boolean" } ] }