Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrate text box

For an explanation on Spring Cloud Config see http://cloud.spring.io/spring-cloud-config/spring-cloud-config.html 

The runtime Runtime uses Spring Cloud Config to be able to load properties from a remote configuration server.

By default the runtime is packaged with an embedded configuration server. This embedded server is configured serve a set of property files located on the file system. Because the server is embedded, the cloud config client does not need to be configured with a remote uri of the configuration server. Instead the client will automatically load its configuration from the embedded config server.

For the embedded config server the following properties are configured:

Code Block
spring.profiles.active=native 
spring.cloud.config.server.native.searchLocations=${spring.config.location}
spring.cloud.config.server.bootstrap=true

By specifying the for changing and reloading properties. In the configured folder (

Include Page
_ConfigLocation
_ConfigLocation
) one can place  property, the location from where property files are read may be changed. At this location an
Include Page
_PropertiesFileJava
_PropertiesFileJava
 (or YAML variants) as the default name is application (can be configured via spring.application.name=application).

...

 may be placed with properties to configure the runtime.

Warning

Properties supplied to the runtime through the config server take precedence over all other property sources. This may be changed by setting one of the following properties:

  • spring.cloud.config.allowOverride=[true|false] (false for lowest priority)
  • spring.cloud.config.overrideNone=[true|false] (true for highest priority)
  • spring.cloud.config.overrideSystemProperties=[true|false] (true for higher priority than system properties, false for lower priority than system properties)

For any of these properties to have effect, they must be specified in a property file hosted by the config server. For example in

Include Page
_PropertiesFileJava
_PropertiesFileJava
in the directory specified by spring.cloud.config.server.native.searchLocations property or in the configured git repository if applicable.

See also http://cloud.spring.io/spring-cloud-static/spring-cloud.html#overriding-bootstrap-properties for more information

Client Config

Spring config client is integrated in the blueriq-runtime.

...

In order to connect to a remote server instead of the embedded server, the following properties can be set in a file named bootstrap.properties at the 

Include Page
_ConfigLocation
_ConfigLocation

Code Block
titlebootstrap.properties
spring:
  cloud:
    config:
      uri: http://localhost:8888
      username: .cloud.config.uri=<cloud-server-uri>
spring.cloud.config.username=<cloud-server-username> (*)
      password: spring.cloud.config.password=<cloud-server-password> (*)
      failFast: true
      retry:
        max-attempts: 10
        initial-interval: 5000
        max-interval: spring.cloud.config.failFast=true
spring.cloud.config.retry.max-attempts=10
spring.cloud.config.retry.initial-interval=5000
spring.cloud.config.retry.max-interval=10000

* To make a connection to cloud config server, see #scsauth
Include Page_PropertiesFileJava_PropertiesFileJava will not contain any property meant for the config client

...

Server Config

Spring config server will can run separately and handle the property files. The client will communicate with the server to get the property files.

The property files will either come from the file-system or use GIT.

 

Code Block
titlebootstrap.properties
encrypt:
  failOnError: .failOnError=false
  key: "IGotTheKey"
  encrypt.key=IGotTheKey
encrypt.key-store:
    secret: "IGotTheSecret"
spring:
  cloud:
    config:
      server:
        bootstrap: .secret=IGotTheSecret
spring.cloud.config.server.bootstrap=true (*)

* Indicates that the server should read it’s own

Include Page
_PropertiesFileJava
_PropertiesFileJava
 from the remote config server configured property files (GIT or filesystem)

Code Block
titlebootstrap.properties - extended for using the file-system
spring:
  profiles:
    active: native
  cloud:
    config:
      server:
        native:
          searchLocations: file:D:/local-properties.profiles.active=native
spring.cloud.config.server.native.searchLocations

 

Code Block
titlebootstrap.properties - extended for using GIT - basic authentication
spring:
  cloud:
    config:
      server:
        git:
          uri: .cloud.config.server.git.uri=https://git.blueriq.com/config-repo.git
          basedir: target/config
          username: <git_username>
          password: spring.cloud.config.server.git.basedir=target/config
spring.cloud.config.server.git.username=<git_username>
spring.cloud.config.server.git.password=<git_password>

 

Anchor
scsauth
scsauth

Code Block
titleapplication.properties
server:
  port: .port=8888
security:
  user:
    name: .user.name=<username> (*)
    password: security.user.password=<password> (*)
management:
  .context-path: =/admin

 * Username and password that will be used for the client to connect to this server.

Info
UI Text Box
typenote

Currently static resources are not managed by the spring cloud config server (for example frontend sources and exports). This may change in a future release.

Further reading

Reading properties from file system

Reading properties from GIT

...