Commit Graph

53 Commits

Author SHA1 Message Date
Dave Syer
f8d91ef32b Add some Javadocs 2015-02-06 09:52:23 +00:00
Dave Syer
9e35f60d97 Initialize beans after rebinding as necessary
On startup a bean will be bound by the
ConfigurationPropertiesBindingPostProcessor and then initialized
by the ApplicationContext. The ConfigurationPropertiesRebinder
does the binding but not the initialization (until this change).

Fixes gh-80
2015-02-05 14:24:18 +01:00
Dave Syer
79d20a0f74 Fix error message if not failing fast
Fixes gh-78
2015-02-04 11:46:14 +01:00
Dave Syer
6d3a60b64c Add a call to update log levels during bootstrap
Since the bootstrap customizations are applied in ApplicationContextInitializers
they come too late to affect the logging levels. But the LoggingRebinder listener
isn't installed yet, and the context is not ready for events to be published. So
to get the logging changes in as early as possible we actually need to explicitly
apply them in the property source initializer as soon as the remote properties are
available.

Fixes gh-74, fixes gh-75
2015-01-30 11:44:22 +00:00
Dave Syer
e5e4cb0348 Change method name from getUri() to getRawUri()
Users would have seen DOWN status in a health indicator whenever
the config server was secure.

Fixes gh-69
2015-01-23 17:39:14 +00:00
Dave Syer
8c6740ab71 Use only ConfigFileApplicationListener in server mini-application
In the server we use a SpringApplicationEnvironmentRepository to load
the YAML and properties files from git (or locally). It creates a mini
SpringApplication so as to faithfully replicate the way the Environment
is created. Unfortunately that can have side effects on the server
application itself (e.g. setting log levels). In particular if the
mini SpringApplication fails to start then the log levels could be
left in a "preInitialized" state with all log levels OFF by default.

This change ensures that the server logs all errors when loading YAML
and properties files, and also that the client logs the error response
if it is JSON (as it should be).

Fixes gh-66, fixes gh-67
2015-01-21 14:40:39 +00:00
Dave Syer
55f04aaa38 More @Conditionals to prevent error if bootstrap disabled
If user disables bootstrap configuration
(spring.cloud.bootstrap.enabled:false) we have to anticipate some
beans will be missing.

Fixes gh-65
2015-01-19 16:51:53 +00:00
Dave Syer
048bc6a9a7 systemPropertiesOverride -> overrideSystemProperties 2015-01-17 15:11:47 +00:00
Dave Syer
a0c9ae3ff0 Allow system property override to be switched off
The default behaviour is the same as before, so a config client
adds the remote property sources "first" (i.e. ahead of system
properties). If the user sets up a  remote config repo with
spring.cloud.config.overrideSystemProperties=false they can
change this behaviour and insert the new property source after
systemEnvironment (i.e. before local config files but after the
other local sources). Of course using an `application.yml` on
the server you can change the default  for all applications.

There is also a new feature in the config server where the operator
can add a map of override properties in
spring.cloud.config.server.overrides.* and have them added with
highest priority in the Environment returned from the server.
Using that the operator can prevent config repositories from
changing the override behaviour by setting
spring.cloud.config.allowOverride=false.

Fixes gh-57
2015-01-16 16:24:41 +00:00
Dave Syer
1a2c21a081 Move health indicator to main application context 2015-01-16 14:12:59 +00:00
Dave Syer
d8c7cc52fe Be smarter about the ConfigClientProperties and parent context
In case there is a parent context we can re-use the bean from that
if it exists, instead of always creating it and risking the values
being different.
2015-01-16 14:03:12 +00:00
Stefan Djurasic
e2b4bea238 Fixing copy/paste error in BootsrapApplicationListener
... which prevented using an external bootstrap.properties file

Fixes gh-56, fixes gh-59
2015-01-15 16:14:56 +00:00
Dave Syer
3796133980 Use @ConditionalOnProperty where possible 2015-01-15 14:07:45 +00:00
Dave Syer
2a718a2d40 Suppress compiler warnings 2015-01-02 07:29:48 +00:00
Spencer Gibb
fade46210e make ConfigClientProperties required=false
fixes gh-50
2014-12-16 12:55:02 -07:00
Spencer Gibb
eb48314cea added failFast option
fixes gh-1
2014-12-04 19:38:02 -07:00
Marcin Zajaczkowski
66ab6ca461 Small simplifications in BootstrapApplicationListener
Fixes gh-42
2014-12-04 08:35:40 +00:00
Spencer Gibb
28b27dfac7 add RefreshScopeRefreshedEvent when RefreshScope.refresh*() is called. This is so apps can do something when a POST is received at /refresh even if the environment hasn't changed. 2014-12-03 11:36:47 -07:00
Dave Syer
2caf87f92e Revert some @Ignores after bugfixes in Spring
Also lifts the restriction on @RefreshScope and @Configuration
(since that was imposed by a bug).

Fixes gh-43
2014-12-03 17:19:05 +00:00
Dave Syer
3911d91e57 Remove reflection hack 2014-12-03 15:06:17 +00:00
Dave Syer
0d2cb07384 Revert some of the changes to RefreshScope and @Configuration
Some things were changed in Spring and some problems are fixed
(while at least one is not - scope!="refresh" for a @Configuration
with @RefreshScope)
2014-12-03 14:31:39 +00:00
Dave Syer
1065149cc9 Fix Maven compiler error 2014-12-01 10:35:38 +00:00
Dave Syer
0ae34b06fe Make it illegal to add @RefreshScope to @Configuration
There are still some problematic areas (see SPR-12486) where users
might be surprised, but at least there now is an error message for the
specific case of @RefreshScope on @Configuration.

Fixes gh-43
2014-12-01 09:47:58 +00:00
Dave Syer
6205bc7d81 Add more tests for gh-43 2014-11-26 08:11:13 +00:00
Dave Syer
689d12e9c1 Break Mvc endpoint configuration out from non Mvc
Fixes gh-44 because it allows an extra layer to insert
an @AutoConfigureAfter.

Also adds some more integration tests for refresh scope

Per gh-43, note that @Configuration does not play well
with @RefreshScope (see @Ignored test case).
2014-11-25 12:25:14 +00:00
Dave Syer
56434c79eb Fix pull request builds 2014-11-25 09:47:55 +00:00
Dave Syer
4f326b59a0 Add @ConditionalOnClass to health indicator 2014-11-23 07:40:15 +00:00
Spencer Gibb
65112da6fb Merge pull request #35 from spring-cloud/config-server-health-indicator
a HealthIndicator for ConfigServer.  It tests the http connection to the...
2014-11-18 11:11:54 -07:00
Dave Syer
03d827b432 Break @ConfigurationProperties out to type level 2014-11-17 14:35:52 +00:00
Dave Syer
93bca31f64 Extract code that is now no visible in Boot 2014-11-17 09:27:26 +00:00
Dave Syer
bfd3616d15 Ensure context ID can be set in bootstrap.yml
The problem was the ordering of ApplicationContextInitializers:
the bootstrap process sets the parent application context in an
initializer (formerly with no @Order) which needs to happen
before any other initializers that depend on the Environment.
Fix is to add an @Order (e.g. 0) so it comes before the
ContextIdApplicationContextInitializer.

Fixes gh-37
2014-11-13 17:58:08 +00:00
Spencer Gibb
62e41f63c0 change spring.cloud.config.enabled to @ConditionalOnExpression 2014-11-12 14:33:27 -07:00
Dave Syer
e132e8e9e5 Add support for spring.cloud.config.enabled=false 2014-11-12 15:54:53 +00:00
Spencer Gibb
cae3c1fe42 a HealthIndicator for ConfigServer. It tests the http connection to the config server and lists the names of the property sources if it is up. 2014-11-10 13:54:55 -07:00
Dave Syer
7d84c94bed Fix tess configuration for fail fast encryption 2014-11-10 14:57:49 +00:00
Dave Syer
91e1ddc9a3 Add fail fast flag for config client if local decryption fails
On the server we choose not to fail if a property cannot be decrypted (clients
might be relying on the other values to be able to deal with the failure).

Fixes gh-31
2014-11-10 09:57:45 +00:00
Dave Syer
b6f22b83c7 Strip prefix in info rebinding 2014-11-06 14:14:53 +00:00
Dave Syer
9efae007fa Add Environment to ProeprtySourceLocator.locate()
In this way each contexet in a hierarchy can in principle have a different
set of property sources
2014-10-30 11:43:00 +00:00
Dave Syer
010d29c124 Fix application name always being "bootstrap" 2014-10-30 07:17:02 +00:00
Dave Syer
ec0108f867 Clarify role of spring.application.name and context hierarchies
Also allow override of bootstrap properties location using
spring.cloud.config.*.

Fixes gh-22
2014-10-29 14:59:48 +00:00
Dave Syer
c966bfe3c4 Add spring.cloud.config.discovery.* configuration properties 2014-10-26 15:36:35 +00:00
Dave Syer
19cd6be001 Add @Order to the default property source locator 2014-10-25 08:15:58 +01:00
Dave Syer
43956df9af Tidy (mostly pom warnings) 2014-10-14 17:34:28 +01:00
Dave Syer
99eb1606c7 Remove obsolete README 2014-10-13 16:56:24 +01:00
Dave Syer
3f05eddc42 Expunge .platform. from config project
Fixes gh-12
2014-10-13 14:16:47 +01:00
Dave Syer
5d15afabe5 Add HTTP Basic security 2014-10-10 15:57:50 +01:00
Dave Syer
9730c84b6d Fix platform->cloud for config.uri 2014-10-01 15:06:56 +01:00
Dave Syer
59111051a2 Fix tests 2014-09-24 15:49:04 +01:00
Dave Syer
561c0bd2f1 Make /refresh endpoint work as designed
All @RefreshScope beans should be invalidated even if there
are no changes in property values (since those might have come from
a POST to /env for instance).
2014-09-10 18:33:06 -05:00
Dave Syer
6dd6e57c57 Make /info refreshable 2014-09-07 10:34:15 +01:00