Fix indentation. Document AOT and native support.
This commit is contained in:
@@ -1511,7 +1511,7 @@ However, you might occasionally need to change the keys (for example, in the ev
|
||||
In that case, all the clients would need to change their source config files (for example, in git) and use a new `{key:...}` prefix in all the ciphers.
|
||||
Note that the clients need to first check that the key alias is available in the Config Server keystore.
|
||||
|
||||
TIP: If you want to let the Config Server handle all encryption as well as decryption, the `{name:value}` prefixes can also be added as plain text posted to the `/encrypt` endpoint, .
|
||||
TIP: If you want to let the Config Server handle all encryption as well as decryption, the `{name:value}` prefixes can also be added as plain text posted to the `/encrypt` endpoint.
|
||||
|
||||
=== Serving Encrypted Properties
|
||||
|
||||
@@ -1519,7 +1519,7 @@ Sometimes you want the clients to decrypt the configuration locally, instead of
|
||||
In that case, if you provide the `encrypt.*` configuration to locate a key, you can still have `/encrypt` and `/decrypt` endpoints, but you need to explicitly switch off the decryption of outgoing properties by placing `spring.cloud.config.server.encrypt.enabled=false` in `bootstrap.[yml|properties]`.
|
||||
If you do not care about the endpoints, it should work if you do not configure either the key or the enabled flag.
|
||||
|
||||
== Serving Alternative Formats
|
||||
=== Serving Alternative Formats
|
||||
|
||||
The default JSON format from the environment endpoints is perfect for consumption by Spring applications, because it maps directly onto the `Environment` abstraction.
|
||||
If you prefer, you can consume the same data as YAML or Java properties by adding a suffix (".yml", ".yaml" or ".properties") to the resource path.
|
||||
@@ -1533,7 +1533,7 @@ For example, the JSON is structured as an ordered list of property sources, with
|
||||
The YAML and properties forms are coalesced into a single map, even if the origin of the values has multiple sources, and the names of the original source files are lost.
|
||||
Also, the YAML representation is not necessarily a faithful representation of the YAML source in a backing repository either. It is constructed from a list of flat property sources, and assumptions have to be made about the form of the keys.
|
||||
|
||||
== Serving Plain Text
|
||||
=== Serving Plain Text
|
||||
|
||||
Instead of using the `Environment` abstraction (or one of the alternative representations of it in YAML or properties format), your applications might need generic plain-text configuration files that are tailored to their environment.
|
||||
The Config Server provides these through an additional endpoint at `/{application}/{profile}/{label}/{path}`, where `application`, `profile`, and `label` have the same meaning as the regular environment endpoint, but `path` is a path to a file name (such as `log.xml`).
|
||||
@@ -1558,7 +1558,7 @@ The following sections show how each one works:
|
||||
* <<spring-cloud-config-serving-plain-text-aws-s3>>
|
||||
|
||||
[[spring-cloud-config-serving-plain-text-git-svn-native-backends]]
|
||||
=== Git, SVN, and Native Backends
|
||||
==== Git, SVN, and Native Backends
|
||||
|
||||
Consider the following example for a GIT or SVN repository or a native backend:
|
||||
|
||||
@@ -1624,7 +1624,7 @@ server {
|
||||
====
|
||||
|
||||
[[spring-cloud-config-serving-plain-text-aws-s3]]
|
||||
=== AWS S3
|
||||
==== AWS S3
|
||||
|
||||
To enable serving plain text for AWS s3, the Config Server application needs to include a dependency on Spring Cloud AWS.
|
||||
For details on how to set up that dependency, see the
|
||||
@@ -1632,7 +1632,7 @@ https://cloud.spring.io/spring-cloud-static/spring-cloud-aws/2.1.3.RELEASE/singl
|
||||
Then you need to configure Spring Cloud AWS, as described in the
|
||||
https://cloud.spring.io/spring-cloud-static/spring-cloud-aws/2.1.3.RELEASE/single/spring-cloud-aws.html#_configuring_credentials[Spring Cloud AWS Reference Guide].
|
||||
|
||||
=== Decrypting Plain Text
|
||||
==== Decrypting Plain Text
|
||||
|
||||
By default, encrypted values in plain text files are not decrypted. In order to enable decryption for plain text files, set `spring.cloud.config.server.encrypt.enabled=true` and `spring.cloud.config.server.encrypt.plainTextEncrypt=true` in `bootstrap.[yml|properties]`
|
||||
|
||||
@@ -1640,7 +1640,7 @@ NOTE: Decrypting plain text files is only supported for YAML, JSON, and properti
|
||||
|
||||
If this feature is enabled, and an unsupported file extention is requested, any encrypted values in the file will not be decrypted.
|
||||
|
||||
== Embedding the Config Server
|
||||
=== Embedding the Config Server
|
||||
|
||||
The Config Server runs best as a standalone application.
|
||||
However, if need be, you can embed it in another application.
|
||||
@@ -1678,7 +1678,7 @@ If you want to read the configuration for an application directly from the backe
|
||||
basically want an embedded config server with no endpoints.
|
||||
You can switch off the endpoints entirely by not using the `@EnableConfigServer` annotation (set `spring.cloud.config.server.bootstrap=true`).
|
||||
|
||||
== Push Notifications and Spring Cloud Bus
|
||||
=== Push Notifications and Spring Cloud Bus
|
||||
|
||||
Many source code repository providers (such as Github, Gitlab, Gitea, Gitee, Gogs, or Bitbucket) notify you of changes in a repository through a webhook.
|
||||
You can configure the webhook through the provider's user interface as a URL and a set of events in which you are interested.
|
||||
@@ -1698,6 +1698,10 @@ NOTE: The `RefreshRemoteApplicationEvent` is transmitted only if the `spring-clo
|
||||
|
||||
NOTE: The default configuration also detects filesystem changes in local git repositories. In that case, the webhook is not used. However, as soon as you edit a config file, a refresh is broadcast.
|
||||
|
||||
=== AOT and native image support
|
||||
|
||||
Since `4.0.0`, Spring Cloud Config Server supports Spring AOT transformations. However, for the time being, GraalVM native images are not supported. Implementing native image support is blocked by https://github.com/oracle/graal/issues/5134[graal#5134] and will likely require the completion of the work on https://github.com/graalvm/taming-build-time-initialization[https://github.com/graalvm/taming-build-time-initialization] to be fixed.
|
||||
|
||||
== Spring Cloud Config Client
|
||||
|
||||
A Spring Boot application can take immediate advantage of the Spring Config Server (or other external property sources provided by the application developer).
|
||||
@@ -1970,3 +1974,15 @@ String name = "World";
|
||||
----
|
||||
|
||||
The preceding code would sets the value of the `name` variable to `appAsecret`.
|
||||
|
||||
=== AOT and native image support
|
||||
|
||||
Since `4.0.0`, Spring Cloud Config Client supports Spring AOT transformations and GraalVM native images.
|
||||
|
||||
WARNING: AOT and native image support is not available for <<config-first-bootstrap, config first bootstrap>> (with `spring.config.use-legacy-processing=true`).
|
||||
|
||||
WARNING: Refresh scope is not supported with native images. If you're going to run your config client application as a native image, make sure to set `spring.cloud.refresh.enabled` property to `false`.
|
||||
|
||||
WARNING: While building a project that contains Spring Cloud Config Client, it is necessary to make sure that the configuration data source that it connects to (such as, Spring Cloud Config Server, Consul, Zookeeper, Vault, etc.) is available. For example, if you retrieve configuration data from Spring Cloud Config Server, make sure you have its instance running and available at the port indicated in the Config Client setup. This is necessary because the application context is being optimized at build time and requires the target environment to be resolved.
|
||||
|
||||
WARNING: Since in AOT and native mode, configuration is being processed and the context is being optimised at build time, any properties that would influence bean creation (such as the ones used within bootstrap context) should be set to the same values at build time and runtime to avoid unexpected behaviour.
|
||||
|
||||
Reference in New Issue
Block a user