It's alive

This commit is contained in:
Marcin Grzejszczak
2023-09-07 13:12:30 +02:00
parent 8a744e57c5
commit 96d67fb841
42 changed files with 139 additions and 2369 deletions

View File

@@ -1,33 +0,0 @@
name: Deploy Docs
on:
push:
branches-ignore: [ gh-pages ]
tags: '**'
repository_dispatch:
types: request-build-reference # legacy
#schedule:
#- cron: '0 10 * * *' # Once per day at 10am UTC
workflow_dispatch:
permissions:
actions: write
jobs:
build:
runs-on: ubuntu-latest
# FIXME: enable when pushed to spring-projects
# if: github.repository_owner == 'spring-projects'
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: docs-build
fetch-depth: 1
- name: Dispatch (partial build)
if: github.ref_type == 'branch'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh workflow run deploy-docs.yml -r $(git rev-parse --abbrev-ref HEAD) -f build-refname=${{ github.ref_name }}
- name: Dispatch (full build)
if: github.ref_type == 'tag'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh workflow run deploy-docs.yml -r $(git rev-parse --abbrev-ref HEAD)

View File

@@ -0,0 +1,11 @@
* xref:index.adoc[]
** xref:intro.adoc[]
** xref:spring-cloud-commons/application-context-services.adoc[]
** xref:spring-cloud-commons/common-abstractions.adoc[]
** xref:spring-cloud-commons/loadbalancer.adoc[]
** xref:spring-cloud-commons/cachedrandompropertysource.adoc[]
** xref:spring-cloud-commons/security.adoc[]
* xref:spring-cloud-circuitbreaker.adoc[]
* xref:appendix.adoc[]
** xref:configprops.adoc[]

View File

@@ -1,9 +1,8 @@
:numbered!:
[appendix]
[[common-application-properties]]
= Common application properties
:page-section-summary-toc: 1
include::partial$_attributes.adoc[]
Various properties can be specified inside your `application.properties` file, inside your `application.yml` file, or as command line switches.
This appendix provides a list of common {project-full-name} properties and references to the underlying classes that consume them.
@@ -11,4 +10,9 @@ This appendix provides a list of common {project-full-name} properties and refer
NOTE: Property contributions can come from additional jar files on your classpath, so you should not consider this an exhaustive list.
Also, you can define your own properties.
[[observability]]
== Observability metadata
include::partial$_metrics.adoc[]
include::partial$_spans.adoc[]

View File

@@ -0,0 +1,6 @@
[[configuration-properties]]
= Configuration Properties
Below you can find a list of configuration properties.
include::partial$_configprops.adoc[]

View File

@@ -1,10 +1,9 @@
[[cloud-native-applications]]
= Cloud Native Applications
:page-section-summary-toc: 1
include::partial$_attributes.adoc[]
// TODO: figure out remote includes in docs and replace pasted text
// include::https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/docs/src/main/asciidoc/contributing-docs.adoc[]
NOTE: Spring Cloud is released under the non-restrictive Apache 2.0 license.
If you would like to contribute to this section of the documentation or if you find an error, you can find the source code and issue trackers for the project at {docslink}[github].
If you would like to contribute to this section of the documentation or if you find an error, you can find the source code and issue trackers for the project at {github-issues}[github].

View File

@@ -1,3 +1,5 @@
[[introduction]]
= Introduction
https://pivotal.io/platform-as-a-service/migrating-to-cloud-native-application-architectures-ebook[Cloud Native] is a style of application development that encourages easy adoption of best practices in the areas of continuous delivery and value-driven development.
A related discipline is that of building https://12factor.net/[12-factor Applications], in which development practices are aligned with delivery and operations goals -- for instance, by using declarative programming and management and monitoring.

View File

@@ -1,5 +1,5 @@
[[introduction]]
= Introduction
= Spring Cloud Circuit Breaker
Spring Cloud Circuit breaker provides an abstraction across different circuit breaker implementations.
It provides a consistent API to use in your applications, letting you, the developer, choose the circuit breaker implementation that best fits your needs for your application.
@@ -14,12 +14,11 @@ Spring Cloud supports the following circuit-breaker implementations:
* https://github.com/spring-projects/spring-retry[Spring Retry]
[[core-concepts]]
= Core Concepts
== Core Concepts
To create a circuit breaker in your code, you can use the `CircuitBreakerFactory` API. When you include a Spring Cloud Circuit Breaker starter on your classpath, a bean that implements this API is automatically created for you.
The following example shows a simple example of how to use this API:
====
[source,java]
----
@Service
@@ -38,7 +37,6 @@ public static class DemoControllerService {
}
----
====
The `CircuitBreakerFactory.create` API creates an instance of a class called `CircuitBreaker`.
The `run` method takes a `Supplier` and a `Function`.
@@ -48,12 +46,11 @@ The function is passed the `Throwable` that caused the fallback to be triggered.
You can optionally exclude the fallback if you do not want to provide one.
[[circuit-breakers-in-reactive-code]]
== Circuit Breakers In Reactive Code
=== Circuit Breakers In Reactive Code
If Project Reactor is on the class path, you can also use `ReactiveCircuitBreakerFactory` for your reactive code.
The following example shows how to do so:
====
[source,java]
----
@Service
@@ -73,7 +70,6 @@ public static class DemoControllerService {
}
}
----
====
The `ReactiveCircuitBreakerFactory.create` API creates an instance of a class called `ReactiveCircuitBreaker`.
The `run` method takes a `Mono` or a `Flux` and wraps it in a circuit breaker.
@@ -81,7 +77,7 @@ You can optionally profile a fallback `Function`, which will be called if the ci
that caused the failure.
[[configuration]]
= Configuration
== Configuration
You can configure your circuit breakers by creating beans of type `Customizer`.
The `Customizer` interface has a single method (called `customize`) that takes the `Object` to customize.
@@ -99,7 +95,6 @@ for example, in case of https://resilience4j.readme.io/docs/circuitbreaker#secti
The following example shows the way for each `io.github.resilience4j.circuitbreaker.CircuitBreaker` to consume events.
====
[source,java]
----
Customizer.once(circuitBreaker -> {
@@ -107,4 +102,3 @@ Customizer.once(circuitBreaker -> {
.onStateTransition(event -> log.info("{}: {}", event.getCircuitBreakerName(), event.getStateTransition()));
}, CircuitBreaker::getName)
----
====

View File

@@ -1,4 +1,4 @@
[[spring-cloud-context:-application-context-services]]
[[spring-cloud-context-application-context-services]]
= Spring Cloud Context: Application Context Services
Spring Boot has an opinionated view of how to build an application with Spring.
@@ -18,7 +18,6 @@ Instead of `application.yml` (or `.properties`), you can use `bootstrap.yml`, ke
The following listing shows an example:
.bootstrap.yml
====
----
spring:
application:
@@ -27,7 +26,6 @@ spring:
config:
uri: ${SPRING_CONFIG_URI:http://localhost:8888}
----
====
If your application needs any application-specific configuration from the server, it is a good idea to set the `spring.application.name` (in `bootstrap.yml` or `application.yml`).
For the property `spring.application.name` to be used as the application's context ID, you must set it in `bootstrap.[properties | yml]`.
@@ -45,7 +43,7 @@ The additional property sources are:
* "`bootstrap`": If any `PropertySourceLocators` are found in the bootstrap context and if they have non-empty properties, an optional `CompositePropertySource` appears with high priority.
An example would be properties from the Spring Cloud Config Server.
See "`xref:spring-cloud-commons/context:-application-context-services.adoc#customizing-bootstrap-property-sources[Customizing the Bootstrap Property Sources]`" for how to customize the contents of this property source.
See "`xref:spring-cloud-commons/application-context-services.adoc#customizing-bootstrap-property-sources[Customizing the Bootstrap Property Sources]`" for how to customize the contents of this property source.
NOTE: Prior to Spring Cloud 2022.0.3 `PropertySourceLocators` (including the ones for Spring Cloud Config) were run during
the main application context and not in the Bootstrap context. You can force `PropertySourceLocators` to be run during the
@@ -54,7 +52,7 @@ Bootstrap context by setting `spring.cloud.config.initialize-on-context-refresh=
* "`applicationConfig: [classpath:bootstrap.yml]`" (and related files if Spring profiles are active): If you have a `bootstrap.yml` (or `.properties`), those properties are used to configure the bootstrap context.
Then they get added to the child context when its parent is set.
They have lower precedence than the `application.yml` (or `.properties`) and any other property sources that are added to the child as a normal part of the process of creating a Spring Boot application.
See "`xref:spring-cloud-commons/context:-application-context-services.adoc#customizing-bootstrap-properties[Changing the Location of Bootstrap Properties]`" for how to customize the contents of these property sources.
See "`xref:spring-cloud-commons/application-context-services.adoc#customizing-bootstrap-properties[Changing the Location of Bootstrap Properties]`" for how to customize the contents of these property sources.
Because of the ordering rules of property sources, the "`bootstrap`" entries take precedence.
However, note that these do not contain any data from `bootstrap.yml`, which has very low precedence but can be used to set defaults.
@@ -116,7 +114,6 @@ For instance, you can insert additional properties from a different server or fr
As an example, consider the following custom locator:
====
[source,java]
----
@Configuration
@@ -130,19 +127,16 @@ public class CustomPropertySourceLocator implements PropertySourceLocator {
}
----
====
The `Environment` that is passed in is the one for the `ApplicationContext` about to be created -- in other words, the one for which we supply additional property sources.
It already has its normal Spring Boot-provided property sources, so you can use those to locate a property source specific to this `Environment` (for example, by keying it on `spring.application.name`, as is done in the default Spring Cloud Config Server property source locator).
If you create a jar with this class in it and then add a `META-INF/spring.factories` containing the following setting, the `customProperty` `PropertySource` appears in any application that includes that jar on its classpath:
====
[source]
----
org.springframework.cloud.bootstrap.BootstrapConfiguration=sample.custom.CustomPropertySourceLocator
----
====
As of Spring Cloud 2022.0.3, Spring Cloud will now call `PropertySourceLocators` twice. The first fetch
will retrieve any property sources without any profiles. These property sources will have the opportunity to
@@ -203,7 +197,6 @@ To refresh an individual bean by name, there is also a `refresh(String)` method.
To expose the `/refresh` endpoint, you need to add following configuration to your application:
====
[source,yaml]
----
management:
@@ -212,7 +205,6 @@ management:
exposure:
include: refresh
----
====
NOTE: `@RefreshScope` works (technically) on a `@Configuration` class, but it might lead to surprising behavior.
For example, it does not mean that all the `@Beans` defined in that class are themselves in `@RefreshScope`.
@@ -230,10 +222,17 @@ on the value changing rather than not being present in the application's configu
Spring Cloud has an `Environment` pre-processor for decrypting property values locally.
It follows the same rules as the Spring Cloud Config Server and has the same external configuration through `encrypt.\*`.
Thus, you can use encrypted values in the form of `{cipher}*`, and, as long as there is a valid key, they are decrypted before the main application context gets the `Environment` settings.
Thus, you can use encrypted values in the form of `\{cipher}*`, and, as long as there is a valid key, they are decrypted before the main application context gets the `Environment` settings.
To use the encryption features in an application, you need to include Spring Security RSA in your classpath (Maven co-ordinates: `org.springframework.security:spring-security-rsa`), and you also need the full strength JCE extensions in your JVM.
include:../:jce.adoc[]
If you get an exception due to "Illegal key size" and you use Sun's JDK, you need to install the Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files.
See the following links for more information:
* https://www.oracle.com/technetwork/java/javase/downloads/jce-6-download-429243.html[Java 6 JCE]
* https://www.oracle.com/technetwork/java/javase/downloads/jce-7-download-432124.html[Java 7 JCE]
* https://www.oracle.com/technetwork/java/javase/downloads/jce8-download-2133166.html[Java 8 JCE]
Extract the files into the JDK/jre/lib/security folder for whichever version of JRE/JDK x64/x86 you use.
[[endpoints]]
== Endpoints

View File

@@ -8,10 +8,8 @@ This random value might be useful in the case where you want a random value that
context restarts. The property value takes the form of `cachedrandom.[yourkey].[type]` where `yourkey` is the key in the cache. The `type` value can
be any type supported by Spring Boot's `RandomValuePropertySource`.
====
[source,properties,indent=0]
----
myrandom=${cachedrandom.appname.value}
----
====

View File

@@ -1,4 +1,4 @@
[[spring-cloud-commons:-common-abstractions]]
[[spring-cloud-common-abstractions]]
= Spring Cloud Commons: Common Abstractions
Patterns such as service discovery, load balancing, and circuit breakers lend themselves to a common abstraction layer that can be consumed by all Spring Cloud clients, independent of the implementation (for example, discovery with Eureka or Consul).
@@ -52,7 +52,7 @@ the `getOrder()` method so that it returns the value that is suitable for your s
properties to set the order of the `DiscoveryClient`
implementations provided by Spring Cloud, among others `ConsulDiscoveryClient`, `EurekaDiscoveryClient` and
`ZookeeperDiscoveryClient`. In order to do it, you just need to set the
`spring.cloud.{clientIdentifier}.discovery.order` (or `eureka.client.order` for Eureka) property to the desired value.
`spring.cloud.\{clientIdentifier}.discovery.order` (or `eureka.client.order` for Eureka) property to the desired value.
[[simplediscoveryclient]]
=== SimpleDiscoveryClient
@@ -75,7 +75,6 @@ Commons now provides a `ServiceRegistry` interface that provides methods such as
The following example shows the `ServiceRegistry` in use:
====
[source,java,indent=0]
----
@Configuration
@@ -94,7 +93,6 @@ public class MyConfiguration {
}
}
----
====
Each `ServiceRegistry` implementation has its own `Registry` implementation.
@@ -142,7 +140,6 @@ For instance, Eureka's supported statuses are `UP`, `DOWN`, `OUT_OF_SERVICE`, an
You can configure a `RestTemplate` to use a Load-balancer client.
To create a load-balanced `RestTemplate`, create a `RestTemplate` `@Bean` and use the `@LoadBalanced` qualifier, as the following example shows:
====
[source,java,indent=0]
----
@Configuration
@@ -165,7 +162,6 @@ public class MyClass {
}
}
----
====
CAUTION: A `RestTemplate` bean is no longer created through auto-configuration.
Individual applications must create it.
@@ -182,7 +178,6 @@ Add xref:spring-cloud-commons/loadbalancer.adoc#spring-cloud-loadbalancer-starte
You can configure `WebClient` to automatically use a load-balancer client.
To create a load-balanced `WebClient`, create a `WebClient.Builder` `@Bean` and use the `@LoadBalanced` qualifier, as follows:
====
[source,java,indent=0]
----
@Configuration
@@ -205,7 +200,6 @@ public class MyClass {
}
}
----
====
The URI needs to use a virtual host name (that is, a service name, not a host name).
The Spring Cloud LoadBalancer is used to create a full physical address.
@@ -249,7 +243,6 @@ NOTE: Individual Loadbalancer clients may be configured individually with the sa
NOTE: For load-balanced retries, by default, we wrap the `ServiceInstanceListSupplier` bean with `RetryAwareServiceInstanceListSupplier` to select a different instance from the one previously chosen, if available. You can disable this behavior by setting the value of `spring.cloud.loadbalancer.retry.avoidPreviousInstance` to `false`.
====
[source,java,indent=0]
----
@Configuration
@@ -265,13 +258,11 @@ public class MyConfiguration {
}
}
----
====
If you want to add one or more `RetryListener` implementations to your retry functionality, you need to
create a bean of type `LoadBalancedRetryListenerFactory` and return the `RetryListener` array
you would like to use for a given service, as the following example shows:
====
[source,java,indent=0]
----
@Configuration
@@ -303,7 +294,6 @@ public class MyConfiguration {
}
}
----
====
[[multiple-resttemplate-objects]]
== Multiple `RestTemplate` Objects
@@ -311,7 +301,6 @@ public class MyConfiguration {
If you want a `RestTemplate` that is not load-balanced, create a `RestTemplate` bean and inject it.
To access the load-balanced `RestTemplate`, use the `@LoadBalanced` qualifier when you create your `@Bean`, as the following example shows:
====
[source,java,indent=0]
----
@Configuration
@@ -347,7 +336,6 @@ public class MyClass {
}
}
----
====
IMPORTANT: Notice the use of the `@Primary` annotation on the plain `RestTemplate` declaration in the preceding example to disambiguate the unqualified `@Autowired` injection.
@@ -359,7 +347,6 @@ TIP: If you see errors such as `java.lang.IllegalArgumentException: Can not set
If you want a `WebClient` that is not load-balanced, create a `WebClient` bean and inject it.
To access the load-balanced `WebClient`, use the `@LoadBalanced` qualifier when you create your `@Bean`, as the following example shows:
====
[source,java,indent=0]
----
@Configuration
@@ -397,15 +384,14 @@ public class MyClass {
}
}
----
====
[[loadbalanced-webclient]]
== Spring WebFlux `WebClient` as a Load Balancer Client
The Spring WebFlux can work with both reactive and non-reactive `WebClient` configurations, as the topics describe:
* xref:spring-cloud-commons/commons:-common-abstractions.adoc#webflux-with-reactive-loadbalancer[Spring WebFlux `WebClient` with `ReactorLoadBalancerExchangeFilterFunction`]
* xref:spring-cloud-commons/commons:-common-abstractions.adoc#load-balancer-exchange-filter-function[Spring WebFlux `WebClient` with a Non-reactive Load Balancer Client]
* xref:spring-cloud-commons/common-abstractions.adoc#webflux-with-reactive-loadbalancer[Spring WebFlux `WebClient` with `ReactorLoadBalancerExchangeFilterFunction`]
* xref:spring-cloud-commons/common-abstractions.adoc#load-balancer-exchange-filter-function[Spring WebFlux `WebClient` with a Non-reactive Load Balancer Client]
[[webflux-with-reactive-loadbalancer]]
=== Spring WebFlux `WebClient` with `ReactorLoadBalancerExchangeFilterFunction`
@@ -415,7 +401,6 @@ If you add xref:spring-cloud-commons/loadbalancer.adoc#spring-cloud-loadbalancer
and if `spring-webflux` is on the classpath, `ReactorLoadBalancerExchangeFilterFunction` is auto-configured.
The following example shows how to configure a `WebClient` to use reactive load-balancer:
====
[source,java,indent=0]
----
public class MyClass {
@@ -433,7 +418,6 @@ public class MyClass {
}
}
----
====
The URI needs to use a virtual host name (that is, a service name, not a host name).
The `ReactorLoadBalancer` is used to create a full physical address.
@@ -446,7 +430,6 @@ is auto-configured. Note, however, that this
uses a non-reactive client under the hood.
The following example shows how to configure a `WebClient` to use load-balancer:
====
[source,java,indent=0]
----
public class MyClass {
@@ -464,13 +447,12 @@ public class MyClass {
}
}
----
====
The URI needs to use a virtual host name (that is, a service name, not a host name).
The `LoadBalancerClient` is used to create a full physical address.
WARN: This approach is now deprecated.
We suggest that you use xref:spring-cloud-commons/commons:-common-abstractions.adoc#webflux-with-reactive-loadbalancer[WebFlux with reactive Load-Balancer]
We suggest that you use xref:spring-cloud-commons/common-abstractions.adoc#webflux-with-reactive-loadbalancer[WebFlux with reactive Load-Balancer]
instead.
[[ignore-network-interfaces]]
@@ -481,7 +463,6 @@ A list of regular expressions can be set to cause the desired network interfaces
The following configuration ignores the `docker0` interface and all interfaces that start with `veth`:
.application.yml
====
----
spring:
cloud:
@@ -490,12 +471,10 @@ spring:
- docker0
- veth.*
----
====
You can also force the use of only specified network addresses by using a list of regular expressions, as the following example shows:
.bootstrap.yml
====
----
spring:
cloud:
@@ -504,19 +483,16 @@ spring:
- 192.168
- 10.0
----
====
You can also force the use of only site-local addresses, as the following example shows:
.application.yml
====
----
spring:
cloud:
inetutils:
useOnlySiteLocalInterfaces: true
----
====
See https://docs.oracle.com/javase/8/docs/api/java/net/Inet4Address.html#isSiteLocalAddress--[Inet4Address.html.isSiteLocalAddress()] for more details about what constitutes a site-local address.
@@ -553,7 +529,6 @@ Named features are features that do not have a particular class they implement.
Any module can declare any number of `HasFeature` beans, as the following examples show:
====
[source,java,indent=0]
----
@Bean
@@ -577,7 +552,6 @@ HasFeatures localFeatures() {
.build();
}
----
====
Each of these beans should go in an appropriately guarded `@Configuration`.
@@ -593,7 +567,6 @@ At the moment we verify which version of Spring Boot is added to your classpath.
Example of a report
====
----
***************************
APPLICATION FAILED TO START
@@ -614,7 +587,6 @@ Consider applying the following actions:
You can find the latest Spring Boot versions here [https://spring.io/projects/spring-boot#learn].
If you want to learn more about the Spring Cloud Release train compatibility, you can visit this page [https://spring.io/projects/spring-cloud#overview] and check the [Release Trains] section.
----
====
In order to disable this feature, set `spring.cloud.compatibility-verifier.enabled` to `false`.
If you want to override the compatible Spring Boot versions, just set the

View File

@@ -5,7 +5,7 @@ Spring Cloud provides its own client-side load-balancer abstraction and implemen
mechanism, `ReactiveLoadBalancer` interface has been added and a *Round-Robin-based* and *Random* implementations
have been provided for it. In order to get instances to select from reactive `ServiceInstanceListSupplier`
is used. Currently we support a service-discovery-based implementation of `ServiceInstanceListSupplier`
that retrieves available instances from Service Discovery using a xref:spring-cloud-commons/commons:-common-abstractions.adoc#discovery-client[Discovery Client] available in the classpath.
that retrieves available instances from Service Discovery using a xref:spring-cloud-commons/common-abstractions.adoc#discovery-client[Discovery Client] available in the classpath.
TIP: It is possible to disable Spring Cloud LoadBalancer by setting the value of `spring.cloud.loadbalancer.enabled` to `false`.
@@ -47,9 +47,9 @@ NOTE: The classes you pass as `@LoadBalancerClient` or `@LoadBalancerClients` co
In order to make it easy to use Spring Cloud LoadBalancer, we provide `ReactorLoadBalancerExchangeFilterFunction` that can be used with `WebClient` and `BlockingLoadBalancerClient` that works with `RestTemplate`.
You can see more information and examples of usage in the following sections:
* xref:spring-cloud-commons/commons:-common-abstractions.adoc#rest-template-loadbalancer-client[Spring RestTemplate as a Load Balancer Client]
* xref:spring-cloud-commons/commons:-common-abstractions.adoc#webclinet-loadbalancer-client[Spring WebClient as a Load Balancer Client]
* xref:spring-cloud-commons/commons:-common-abstractions.adoc#webflux-with-reactive-loadbalancer[Spring WebFlux WebClient with `ReactorLoadBalancerExchangeFilterFunction`]
* xref:spring-cloud-commons/common-abstractions.adoc#rest-template-loadbalancer-client[Spring RestTemplate as a Load Balancer Client]
* xref:spring-cloud-commons/common-abstractions.adoc#webclinet-loadbalancer-client[Spring WebClient as a Load Balancer Client]
* xref:spring-cloud-commons/common-abstractions.adoc#webflux-with-reactive-loadbalancer[Spring WebFlux WebClient with `ReactorLoadBalancerExchangeFilterFunction`]
[[loadbalancer-caching]]
== Spring Cloud LoadBalancer Caching
@@ -269,7 +269,7 @@ You can set up the LoadBalancer in such a way that it prefers the instance with
For that, you need to use the `RequestBasedStickySessionServiceInstanceListSupplier`. You can configure it either by setting the value of `spring.cloud.loadbalancer.configurations` to `request-based-sticky-session` or by providing your own `ServiceInstanceListSupplier` bean -- for example:
[[health-check-based-custom-loadbalancer-configuration]]
[[health-check-based-custom-loadbalancer-configuration-example]]
[source,java,indent=0]
----
public class CustomLoadBalancerConfiguration {
@@ -483,7 +483,6 @@ TIP: You can further configure the behavior of those metrics (for example, add h
Individual Loadbalancer clients may be configured individually with a different prefix `spring.cloud.loadbalancer.clients.<clientId>.*` where `clientId` is the name of the loadbalancer. Default configuration values may be set in the `spring.cloud.loadbalancer.*` namespace and will be merged with the client specific values taking precedence
.application.yml
====
----
spring:
cloud:
@@ -495,7 +494,6 @@ spring:
health-check:
interval: 30s
----
====
The above example will result in a merged health-check `@ConfigurationProperties` object with `initial-delay=1s` and `interval=30s`.

View File

@@ -0,0 +1,3 @@
:sc-ext: java
:project-full-name: Spring Cloud Commons
:all: {asterisk}{asterisk}

View File

@@ -1,46 +0,0 @@
antora:
extensions:
- '@springio/antora-extensions/partial-build-extension'
- require: '@springio/antora-extensions/latest-version-extension'
- require: '@springio/antora-extensions/inject-collector-cache-config-extension'
- '@antora/collector-extension'
- '@antora/atlas-extension'
- require: '@springio/antora-extensions/root-component-extension'
root_component_name: 'shell' # FIXME: Change this to match `name:` in antora.yml
# FIXME: Run antora once using this extension to migrate to the Asciidoc Tabs syntax
# and then remove this extension
- require: '@springio/antora-extensions/tabs-migration-extension'
unwrap_example_block: always
save_result: true
site:
title: Spring Shell # FIXME: Change to your Project's title
url: https://docs.spring.io/spring-shell/reference/ # FIXME: Change to your Project's URL
content:
sources:
- url: ./..
branches: HEAD
# FIXME: Change this to the path to the directory containing antora.yml in your project
# See https://docs.antora.org/antora/latest/playbook/content-source-start-path/#start-path-key
start_path: spring-shell-docs
worktrees: true
asciidoc:
attributes:
# FIXME: Change to your stackoverflow URL or remove
page-stackoverflow-url: https://stackoverflow.com/tags/spring-shell
page-pagination: ''
hide-uri-scheme: '@'
tabs-sync-option: '@'
chomp: 'all'
extensions:
- '@asciidoctor/tabs'
- '@springio/asciidoctor-extensions'
sourcemap: true
urls:
latest_version_segment: ''
runtime:
log:
failure_level: warn
format: pretty
ui:
bundle:
url: https://github.com/spring-io/antora-ui-spring/releases/download/v0.3.4/ui-bundle.zip

View File

@@ -1,25 +0,0 @@
name: shell # FIXME: Change to your project name typically just remove spring- from the artifact name
version: true
title: Spring Shell # FIXME: Change to the title of your Project's docs
nav:
- modules/ROOT/nav.adoc
ext:
collector:
run:
# FIXME Change "command" to the command that generates your antora.yml and other antora resources
# See https://gitlab.com/antora/antora-collector-extension/-/blob/main/docs/modules/ROOT/pages/configuration-keys.adoc?ref_type=heads#collector-reference
# HINT: Maven is typically something like:
# ./mvnw validate process-resources -am -Pantora-process-resources
command: gradlew -q "-Dorg.gradle.jvmargs=-Xmx3g -XX:+HeapDumpOnOutOfMemoryError" :spring-shell-docs:generateAntoraYml
local: true
scan:
# FIXME Change "dir" to the location that generated files are at
# See https://gitlab.com/antora/antora-collector-extension/-/blob/main/docs/modules/ROOT/pages/configuration-keys.adoc?ref_type=heads#collector-reference
# HINT: Maven is typically something like:
# target/classes/antora-resources/
dir: ./build/generated-antora-resources
asciidoc:
attributes:
attribute-missing: 'warn'
chomp: 'all'

View File

@@ -1,19 +0,0 @@
* xref:index.adoc[]
* xref:spring-cloud-commons.adoc[]
** xref:spring-cloud-commons/context:-application-context-services.adoc[]
** xref:spring-cloud-commons/commons:-common-abstractions.adoc[]
** xref:spring-cloud-commons/loadbalancer.adoc[]
** xref:spring-cloud-commons/circuit-breaker.adoc[]
** xref:spring-cloud-commons/cachedrandompropertysource.adoc[]
** xref:spring-cloud-commons/security.adoc[]
** xref:spring-cloud-commons/configuration-properties.adoc[]
* xref:_attributes.adoc[]
* xref:intro.adoc[]
* xref:jce.adoc[]
* xref:spring-cloud-circuitbreaker.adoc[]
* xref:README.adoc[]
* xref:_configprops.adoc[]
* xref:_observability.adoc[]
* xref:appendix.adoc[]
* xref:sagan-boot.adoc[]
* xref:sagan-index.adoc[]

View File

@@ -1,12 +0,0 @@
[[building]]
= Building
:page-section-summary-toc: 1
include::https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/main/docs/src/main/asciidoc/building.adoc[]
[[contributing]]
= Contributing
:page-section-summary-toc: 1
include::https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/main/docs/src/main/asciidoc/contributing.adoc[]

View File

@@ -1,14 +0,0 @@
:doctype: book
:idprefix:
:idseparator: -
:tabsize: 4
:numbered:
:sectanchors:
:sectnums:
:icons: font
:hide-uri-scheme:
:docinfo: shared,private
:sc-ext: java
:project-full-name: Spring Cloud Commons
:all: {asterisk}{asterisk}

View File

@@ -1,83 +0,0 @@
|===
|Name | Default | Description
|spring.cloud.compatibility-verifier.compatible-boot-versions | `+++3.2.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.
|spring.cloud.config.initialize-on-context-refresh | `+++false+++` | Flag to initialize bootstrap configuration on context refresh event. Default false.
|spring.cloud.config.override-none | `+++false+++` | Flag to indicate that when {@link #setAllowOverride(boolean) allowOverride} is true, external properties should take lowest priority and should not override any existing property sources (including local config files). Default false.
|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.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.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.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.
|spring.cloud.inetutils.preferred-networks | | List of Java regular expressions for network addresses that will be preferred.
|spring.cloud.inetutils.timeout-seconds | `+++1+++` | Timeout, in seconds, for calculating hostname.
|spring.cloud.inetutils.use-only-site-local-interfaces | `+++false+++` | Whether to use only interfaces with site local addresses. See {@link InetAddress#isSiteLocalAddress()} for more details.
|spring.cloud.loadbalancer.cache.caffeine.spec | | The spec to use to create caches. See CaffeineSpec for more details on the spec format.
|spring.cloud.loadbalancer.cache.capacity | `+++256+++` | Initial cache capacity expressed as int.
|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 <code>StringToDurationConverter</code>. @see <a href= "https://github.com/spring-projects/spring-boot/blob/master/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/convert/StringToDurationConverter.java">StringToDurationConverter.java</a>
|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.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.
|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.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.health-check.update-results-list | `+++true+++` | Indicates whether the {@code healthCheckFlux} should emit on each alive {@link ServiceInstance} that has been retrieved. If set to {@code false}, the entire alive instances sequence is first collected into a list and only then emitted.
|spring.cloud.loadbalancer.hint | | Allows setting the value of <code>hint</code> 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.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 | `+++true+++` | 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+++` | Number of retries to be executed on the same `ServiceInstance`.
|spring.cloud.loadbalancer.retry.retry-on-all-exceptions | `+++false+++` | Indicates retries should be attempted for all exceptions, not only those specified in `retryableExceptions`.
|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-exceptions | `+++{}+++` | A `Set` of `Throwable` classes that should trigger a retry.
|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.stats.micrometer.enabled | `+++false+++` | Enables Spring Cloud LoadBalancer Micrometer stats.
|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.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.
|spring.cloud.refresh.extra-refreshable | `+++true+++` | Additional class names for beans to post process into refresh scope.
|spring.cloud.refresh.never-refreshable | `+++true+++` | Comma separated list of class names for beans to never be refreshed or rebound.
|spring.cloud.service-registry.auto-registration.enabled | `+++true+++` | Whether service auto-registration is enabled. Defaults to true.
|spring.cloud.service-registry.auto-registration.fail-fast | `+++false+++` | Whether startup fails if there is no AutoServiceRegistration. Defaults to false.
|spring.cloud.service-registry.auto-registration.register-management | `+++true+++` | Whether to register the management as a service. Defaults to true.
|spring.cloud.util.enabled | `+++true+++` | Enables creation of Spring Cloud utility beans.
|===

View File

@@ -1,9 +0,0 @@
:root-target: ../../../target/
[[observability]]
= Observability metadata
:page-section-summary-toc: 1
include::{root-target}_metrics.adoc[]
include::{root-target}_spans.adoc[]

View File

@@ -1,8 +0,0 @@
If you get an exception due to "Illegal key size" and you use Sun's JDK, you need to install the Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files.
See the following links for more information:
* https://www.oracle.com/technetwork/java/javase/downloads/jce-6-download-429243.html[Java 6 JCE]
* https://www.oracle.com/technetwork/java/javase/downloads/jce-7-download-432124.html[Java 7 JCE]
* https://www.oracle.com/technetwork/java/javase/downloads/jce8-download-2133166.html[Java 8 JCE]
Extract the files into the JDK/jre/lib/security folder for whichever version of JRE/JDK x64/x86 you use.

View File

@@ -1,16 +0,0 @@
Spring Cloud Commons delivers features as two libraries: Spring Cloud Context and Spring Cloud Commons. Spring Cloud Context provides utilities and special services for the ApplicationContext of a Spring Cloud application (bootstrap context, encryption, refresh scope and environment endpoints). Spring Cloud Commons is a set of abstractions and common classes used in different Spring Cloud implementations (eg. Spring Cloud Netflix vs. Spring Cloud Consul).
## Features
### Spring Cloud Context features:
* Bootstrap Context
* `TextEncryptor` beans
* Refresh Scope
* Spring Boot Actuator endpoints for manipulating the `Environment`
### Spring Cloud Commons features:
* `DiscoveryClient` interface
* `ServiceRegistry` interface
* Instrumentation for `RestTemplate` to resolve hostnames using `DiscoveryClient`

View File

@@ -1,6 +0,0 @@
[[spring-cloud-circuit-breaker]]
= Spring Cloud Circuit Breaker
:page-section-summary-toc: 1
include:../:spring-cloud-circuitbreaker.adoc[leveloffset=+1]

View File

@@ -1,5 +0,0 @@
[[configuration-properties]]
= Configuration Properties
:page-section-summary-toc: 1
To see the list of all Spring Cloud Commons related configuration properties please check link:appendix.html[the Appendix page].