* First pass on observation
* Polished tests
* Moved tests to observation registry tests
* Polish
* Adds required Aspect.class to ObservationConfiguration
* Moved away from AOP
* Updated the code to use the ObservationConvention mechanism
* Updated code
* Prepared observation tests
* Polish
* Aligned against latest milestones
Co-authored-by: spencergibb <sgibb@pivotal.io>
* Add support for multiple-url-strategy configuration for clients.
Add support for new property spring.cloud.config.multiple-uri-strategy.
The value must be one of: always, connection_timeout_only. The default
value is connection_timeout_only. This default setting maintains existing
behavior.
If a client has multiple URLs in the spring.cloud.config.uri property,
and if multiple-uri-strategy is set to "always", then if the client gets
any error from config server whatsoever or gets no response, the client
will try the next URL in the list.
The existing and default behavior is that the other URLs in the list will be
tried only if and when the client receives no response from config server.
This is mainly to allow for a client failing over to secondary URLs when
it receives a 404 due to config server being unable to reach its git server
(and config server does not have the requested configs in its local git cache).
With the default behavior, the client receives a 404 and never tries the
next URL in the list(which might point to a different git server that is
currently up). Another benefit is that it allows for a client failing over
to a secondary config server if the first one returns a 503 (OUT_OF_SERVICE).
Fixes gh-1845.
* Fix code style after committing change for gh-1845.
* Fix support for multiple-url-strategy configuration for clients.
Fix issue with the new multiple URI strategy behavior.
Even when strategy was ALWAYS, the client would not try
the next URL when it received server-side errors. Fixed
this by adding HttpServerErrorException to catch clause
in ConfigServicePropertySourceLocator.
Also, fix code style issues and add unit tests.
Fix existing fail-fast unit tests that were not correct.
(They were not mocking out raw status code method on
the response. The error thrown back was actually due to
RestTemplate.handleResponse being unable to to map raw
status code 0 to an HttpStatus.)
* Fix support for multiple-url-strategy configuration for clients.
Merge with dev and undo unintentional changes that were
done automatically. This is part of the pull request
fixing gh-1845.
* Fix support for multiple-url-strategy configuration for clients.
Update ConfigServerConfigDataLoader to try multiple URLs
even for server-side errors when strategy is ALWAYS. This was
missed in previous commit. This is part of the pull request
fixing gh-1845.
* Add ConfigServerConfigDataLoaderTests.
When ConfigServerConfigDataLoader was originally introduced
for the new Spring Boot 2.4 way to import configuration data
(https://github.com/spring-cloud/spring-cloud-config/pull/1656/files),
no unit test was added. I needed to add tests to cover changes
made for the new MultipleUriStrategy (gh-1845). I copied
tests from ConfigServicePropertySourceLocatorTests and modified
as needed for the new class. (There were 2-3 test cases from
ConfigServicePropertySourceLocatorTests that I did not
copy over because it wasn't clear to me expected behavior
or how to set up test case).
This is part of the pull request fixing gh-1845.
* Update the default for multiple-uri-strategy to ALWAYS.
(Per code review.) This is part of the pull request fixing
gh-1845.
* Update documentation for the new multiple-uri-strategy property.
Also, add documentation comparing behavior of multiple URLs
under spring.cloud.config.uri versus multiple URLs under
spring.config.import.
This is part of the pull request fixing gh-1845.
Co-authored-by: UPINCMA <marnee.derider@pearson.com>