-
Notifications
You must be signed in to change notification settings - Fork 704
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use new boot ConfigData framework #703
Conversation
0032c00
to
1d48c79
Compare
ConfigDataEnvironment is package protected, so ConfigDataAccessor was created in the same package as a workaround until spring-projects/spring-boot#22601 is done
24f444b
to
bfd7f60
Compare
Some tests ignored with a FIXME comment
If you review post-merge, not a problem, I can address issues later since this is just a milestone. |
@spencergibb - Hey we have a library which provides a custom property source for bootstrap configuration when users add our Is bootstrap property sources being deprecated or is there an alternate way to access this feature? We are also wondering if we should instruct users that they should add |
Because bootstrapping is now disabled by default, my client no longer connects to the config server (bootstrap properties with config server uri are no longer read). What is they new/correct way to have the client now about and connect to the config server after these changes? |
@ruben056 see the documentation https://docs.spring.io/spring-cloud-config/docs/3.0.0-M5/reference/html/#config-first-bootstrap
|
@ryanjbaxter Thx for the info, I was looking at the "older" docs I guess (https://cloud.spring.io/spring-cloud-config/multi/multi__spring_cloud_config_client.html) |
@ruben056 - I think instead of setting the properties you can try using the new Adding this dependency to your project should have the equivalent effect of using I think the "preferred" style is to migrate to the new |
* Bumping versions * removes unused files * Moves integration tests to separate package * fixes ordering * fixes description * Forces web-application-type=none in ContextRefresher. This allows apps with spring.main.web-application-type={REACTIVE|SERVLET} to function properly without error. fixes spring-cloudgh-678 * formatting * Removes inadvertant copied file * Make LoadBalancerClientFactory bean conditional on missing bean. (spring-cloud#679) * Bumping versions * fix double checked locking with volatile (spring-cloud#649) * Changes default value of management.endpoint.env.post.enabled to false. fixes spring-cloudgh-681 * Fix gh 629 new (spring-cloud#683) * Swaps deprecated ConditionalOnEnabledEndpoint for updated annotation. Swaps with ConditionalOnAvailableEndpoint * Migrates to new OutputCaptureRule * Migrates to new OutputCaptureRule * Add health check loadBalancing implementation. * Make isAlive() method protected. Co-authored-by: Spencer Gibb <spencer@gibb.tech> * Fix warning wording. * Add info on SimpleDiscoveryClient in the docs. Remove redundant param. (spring-cloud#684) * Add info on SimpleDiscoveryClient in the docs. Remove redundant parameter. * Remove warning after discussion. * Allow overriding ReactorLoadBalancerExchangeFilterFunction. * Allow overriding choose(String serviceId) method. * Remove ribbon integration (spring-cloud#691) * Remove Ribbon-specific configuration. * Remove Ribbon-specific docs. Refactor. * Move BootstrapPropertySource to its own class and expose delegate PropertySource via getter (spring-cloud#695) * Making constructor public * Fixes issues in HealthCheckServiceInstanceListSupplier (spring-cloud#685) - WebClient response leaks - potential Scheduled task leak - rework polling to plain reactor operators - remove non atomic operations on ServiceInstance lists related to spring-cloudgh-629 fixes issues from spring-cloudgh-683 * formatting * Updates javadoc to mention WebClient. fixes spring-cloudgh-645 * Pass SimpleDiscoveryProperties as parameter. 18a4227 turned proxying off which broke this. fixes spring-cloudgh-687 * formatting * Ensures HikariDataSource is never re-bound. Removes HikariDataSource from extra-refreshable and adds it to a new property never-refreshable. ConfigurationPropertiesRebinder now checks that property and does not rebind beans whose class is in never-refreshable. fixes spring-cloudgh-687 * Update SNAPSHOT to 2.2.2.RELEASE * Going back to snapshots * Bumping versions to 2.2.3.BUILD-SNAPSHOT after release * Bumping versions * Increase timeout for CI tests * formatting * Updates ContextRefresher to maintain property source ordering. (spring-cloud#705) Updates the targetName so that property sources maintain ordering from the bootstrap environment where they were refreshed. Fixes spring-cloudgh-704 * Typo correction in document (spring-cloud#708) Co-authored-by: jinsoohan <jinsoo.han@gmail.com> * Removes references to Hystrix * Increase timeout for CI tests * Adds reconstructURI method to ReactorLoadBalancerExchangeFilterFunction fixes spring-cloudgh-711 * Minor refactoring to adjust to team conventions. * Adds boot 2.3 compatiblity * Bumps to build 2.2.4.BUILD-SNAPSHOT * Updates compatible versions to 2.2.x and 2.3.x see spring-cloud/spring-cloud-build#153 * Verifies current boot version is in CompatibilityVerifierProperties. Also fixes support for wildcard 2.2.x beyond boot 2.1.x fixes spring-cloudgh-715 * Updates ilford boot compatibility * Bumps to build 2.3.0.BUILD-SNAPSHOT * Bumping versions * Ignores flaky test. See gh-1627 * Fixes issue * Ignores failing test because of old boot version. see spring-cloudgh-717 * try to fix flaky test (spring-cloud#718) fixes spring-cloudgh-716 * fix Endpoint ID 'service-registry' contains invalid characters, please migrate to a valid format (spring-cloud#701) * Add a property source that produces a random value that is cached (spring-cloud#719) * Add a property source that produces a random value that is cached. * Updated docs * Cherry picking commit 4119a9c * Add utility method to provide a service if to IdUtils (spring-cloud#721) * Update SNAPSHOT to 3.0.0.M1 * Going back to snapshots * Bumping versions * Changing default value to be false. Fixes spring-cloud#738 * spring-cloud#738 (spring-cloud#740) The default value for management.endpoint.env.post.enabled should be false instead of true. * Update license comments. * Update license comments. * Fix docs on Instance Health-Check for LoadBalancer. Fixes spring-cloudgh-746. * spring-cloud-loadbalancer add additional-spring-configuration-metadata.json # Conflicts: # spring-cloud-loadbalancer/src/main/resources/META-INF/additional-spring-configuration-metadata.json * Fix capitalisation. * Lb configuration builders (spring-cloud#751) * Adds ServiceInstanceListSuppliers.java with Builder * Implement TODOs. * Add javadocs. * Remove unused type. * Add test. * Safer caching config: resolve LoadBalancerCacheManager lazily. Return delegate if LoadBalancerCacheManager not available. * Switch to using builder in LoadBalancerClientConfiguration. * Autoformatting with spring-java-format. * Update docs. Co-authored-by: Spencer Gibb <spencer@gibb.us> * ignores .sdkmanrc * Stops casting RandomPropertySource. This avoids casting errors if property sources are wrapped. Fixes spring-cloudgh-757 * Add predefined ServiceInstanceListSupplier configurations. 2nd part of spring-cloudgh-741. (spring-cloud#758) * Removes deprecated ServiceInstanceSupplier Fixes spring-cloudgh-753 * Renames ServiceInstanceListSuppliers to ServiceInstanceListSupplierBuilder (spring-cloud#761) Puts static builder() method on ServiceInstanceListSupplier. Deprecates ServiceInstanceListSupplier.fixed(Environment) and replaces with fixed(serviceId). * Adds support for non-enumerable property sources in bootstrap. Fixes spring-cloudgh-724 * Renames ServiceInstanceListSuppliers to ServiceInstanceListSupplierBuilder (spring-cloud#761) Puts static builder() method on ServiceInstanceListSupplier. Deprecates ServiceInstanceListSupplier.fixed(Environment) and replaces with fixed(serviceId). * Adds ConditionalOnMissingBean to SimpleDiscoveryProperties. Fixes spring-cloudgh-759 Fixes spring-cloudgh-762 * Bumping versions * Setting up repository for docs.spring.io migration * Setting up repository for docs.spring.io migration * Gh 760 health check with cache new (spring-cloud#765) * Cache first element of service instance list flux. * Invoke destroy() and afterPropertiesSet() in non-bean ServiceInstanceListSupplier delegates. * Fix return updated instances. * Fix return updated instances. * Gh 760 health check with cache new (spring-cloud#765) * Cache first element of service instance list flux. * Invoke destroy() and afterPropertiesSet() in non-bean ServiceInstanceListSupplier delegates. * Fix return updated instances. * Fix return updated instances. (cherry picked from commit 88b2f0e) * Bumping versions * Fix execution thread for blocking and adjusts timing * Fix execution thread for blocking DiscoveryClientServiceInstanceListSupplier. * Desynchronise HealthCheck and Cache. Add info about using HealthCheck without Cache to docs. See spring-cloudgh-760 * Handle exceptions and timeouts new (spring-cloud#767) * Handle timeouts and exceptions while retrieving instances. * Update docs. * Switch initialDelay to Duration. (spring-cloud#768) * Update README. * Bumping versions * Update SNAPSHOT to 2.2.3.RELEASE * Going back to snapshots * Bumping versions to 2.2.4.BUILD-SNAPSHOT after release * Update SNAPSHOT to 3.0.0-M2 * Going back to snapshots * Fix property name in docs. * Migrated to docs.spring.io & updated sc-build * Bumping versions * Uploading sources for docs * Changed packaging to jar * Bumping versions * Adds junit-vintage-engine * Move Request and Response to loadbalancer package. Fixes spring-cloudgh-772. (spring-cloud#773) * Move Request and Response to loadbalancer package. Fixes spring-cloudgh-772. * Fix checkstyle. * Inherit and reference repackaged classes. * Revert "Inherit and reference repackaged classes." This reverts commit 02808c5. * Fix Status enums. * Make old classes extend the new ones. * Remove deprecated Request and Response classes. (spring-cloud#779) * Avoid field autowiring in SimpleDiscoveryClientAutoConfiguration (spring-cloud#786) In order to fix GraalVM compatibility * Avoid field autowiring in SimpleDiscoveryClientAutoConfiguration (spring-cloud#786) In order to fix GraalVM compatibility * Lb complete lifecycle (spring-cloud#783) * Add LoadBalancerLifecycle. Trigger lifecycle callbacks. Set hints from properties. * Trigger LB lifecycle callbacks from BlockingLoadBalancerClient and RetryLoadBalancerInterceptor. * Register LifecycleProcessors with @LoadBalancerClients * Register LifecycleProcessors with @LoadBalancerClients configuration. * Handle null lifecycle beans map returned from factory. Adjust tests to code changes. * Handle null lifecycle beans map returned from factory in RetryLoadBalancerInterceptor. Ensure ReactiveLoadBalancer.Factory bean is present while instantiating RetryLoadBalancerInterceptor. Add more tests. * Remove generics from supports(...) method signature. * Allow setting hint per service via properties. * Add some toString() methods. Add more info on deprecated callbacks in javadocs and comments. * Add javadocs. * Format javadocs. Add docs. * Update hint docs. * Fix docs. * Fix docs. * Extract filtering supported lifecycle processors to a separate class; Execute onComplete() calls for DISCARD status in RetryLoadBalancerInterceptor. Remove duplicated `onComplete` calls for FAILED and SUCCESS status in RetryLoadBalancerInterceptor. Add test for no duplicated lifecycle calls in RetryLoadBalancerInterceptorTest. * Small refactoring: remove deprecated methods use, add final keywords, remove unnecessary keywords. * Add javadoc. * Bumping versions * Update SNAPSHOT to 3.0.0-M3 * Going back to snapshots * Mock property source name * Disables failing test. See spring-cloudgh-802 * Update SNAPSHOT to 2.2.4.RELEASE * Going back to snapshots * Bumping versions to 2.2.5.BUILD-SNAPSHOT after release * Fixes s-c-build version to snapshot * Use new boot ConfigData framework (spring-cloud#703) Bootstrap is now opt-in using `spring.config.use-legacy-processing`. Otherwise, bootstrap is left as is. If bootstrap is disabled, the `ContextRefresher` uses new `ConfigData` framework from boot. See spring-cloud#608 for original motivation. * Replaces usage of ConfigFileApplicationListener with a subclass. BootstrapConfigFileApplicationListener.java overrides the onApplicationEvent() method to not throw an exception. * Updates to use new ConfigDataEnvironmentPostProcessor.applyTo() method * Adds spring-cloud-starter-bootstrap. This allows users to opt-in to bootstrap via classpath rather than properties. * Formatting * Updates to use repo.spring.io/snapshot * Subscribe on flux earlier. Fixes spring-cloudgh-802. * Updates to use new BootstrapRegistry for ConfigData * Setting reactor bom to 2020.0.0-SNAPSHOT due to reactor bom overriding in HATEOAS * add common classes for TLS properties (spring-cloud#803) * add common classes for TLS test * Revert "add common classes for TLS test" This reverts commit 7f5d076. * add common tls properties * add unit tests for tls properties * Removes dependency management for okhttp3 and httpclient These are managed by boot. Fixes spring-cloudgh-813 * Bumping versions * Update SNAPSHOT to 2.2.5.RELEASE * Going back to snapshots * Bumping versions to 2.2.6.BUILD-SNAPSHOT after release * Make HATEOAS properly optional * Bumping versions * Performance improvements to NamedContextFactory. (spring-cloud#826) Fixes spring-cloudgh-825 * Compatibility check if Spring Boot version is unknown It is better not to fail the compatibility check if the Spring Boot version is unknown. * Adjust to updates in boot. * Reformat. * Add retry support for blocking LoadBalancer (spring-cloud#832) * Add LoadBalancerProperties and BlockingLoadBalancedRetryPolicy. Add spring-retry dependency in LoadBalancer. * Add BlockingLoadBalancedRetryFactory * Move retry properties to LoadBalancerRetryProperties. * Refactor and remove deprecations, fix checkstyle. * Add BlockingLoadBalancedRetryPolicy to autoconfiguration. Set default retryableStatusCode prop. Fix javadoc. * Allow using @order on LoadBalancedRetryFactory beans. * Add tests. Reformat tests. Add explanatory comments. * Add documentation. * Fix javadoc. * Fix docs after review. * Change field name. * Wording changes (spring-cloud#784) Replacing some terms * Updating Evictor Project link * Avoid retrying on same instance (spring-cloud#834) * cherry-pick switching to properties * Pass information on previous ServiceInstance to RequestContext. # Conflicts: # spring-cloud-loadbalancer/src/main/java/org/springframework/cloud/loadbalancer/blocking/retry/BlockingLoadBalancedRetryPolicy.java * Add a RoundRobinLoadBalancer implementation that avoids same service instance while retrying. * Wrap instances in ArrayList. Add tests. * Enable AvoidPreviousInstanceRoundRobinLoadBalancer by default if SpringRetry on classpath. * Fix failing tests. Add javadocs and author tags. * Fix properties. * Add documentation. * Fix docs after review. * Fix docs after review. * Handle avoiding previous instance with ServiceInstanceListSupplier in place of LoadBalancer. * Fix property name. * Change spelling. * Add more logs. * Remove URL check that causes loading 401 responses from Spring Cloud Config * Override equals(), hashCode() and toString() in DefaultRequest and DefaultRequestContext. * Add equals(), hashCode() and toString() methods to HintRequestContext and RetryableRequestContext. * Revert "Setting reactor bom to 2020.0.0-SNAPSHOT due to reactor bom overriding in HATEOAS" This reverts commit 6ea0b47. * Update SNAPSHOT to 3.0.0-M4 * Going back to snapshots * Deprecates SimpleServiceInstance in favor of DefaultServiceInstance (spring-cloud#835) * Initial Commit * Added URI to DefaultServiceInstance * Added default constructor * Fixed PR Comments * Adjust after PR merge. Minor refactoring. * Bumping versions * Ignored a test; added conditional on property * Update SNAPSHOT to 2.2.6.RELEASE * Going back to snapshots * Bumping versions to 2.2.7.BUILD-SNAPSHOT after release * Add Reactive retries for SC LoadBalancer (spring-cloud#847) * Implement retry logic. * Fix retrying on next instance when RetryExhausted in same instance. * Fix retrying on next instance when RetryExhausted in same instance. * Fix retrying on next instance when RetryExhausted in same instance. * Move duplicated methods to utility class. Fix checkstyle. * Fix test. * Add more tests. * Fix test. * Add autoConfiguration. * Refactor and add javadocs. * Add javadocs. * Use RetryAwareServiceInstanceListSupplier with reactive retries. * Update properties. * Fix the docs. * Rename utility class. * Verify interactions in order. * Remove LB caching from default health-check config, since HealthCheckServiceInstanceListSupplier has a separate caching mechanism. Fixes spring-cloudgh-849. * Bumping versions * Move properties to parameter. Fixes spring-cloudgh-850 * formatting * Bumping versions * Update SNAPSHOT to 3.0.0-M5 * Going back to snapshots * Bumping versions * Re-implement /pause endpoint A new interface PauseHandler provides a callback for /pause and /resume. The only implementation provided out of the box is for Spring Integration's Pausable (so it will work with Spring Cloud Stream Kafka for instance). Fixes spring-cloudgh-788 * Allow refetching instances for healthcheck (spring-cloud#855) * Allow refetching instances by HealthCheckServiceInstanceListSupplier. * Add docs and javadocs. * Fix docs after review. * Add ServerHttpRequestContext. (spring-cloud#857) * Update SNAPSHOT to 3.0.0-M6 * Going back to snapshots * Support same service instance preference (spring-cloud#862) * Draft initial implementation. * Rename default configuration property. Check previously chosen instance for equality. * Verify previous service instance for null. Add tests. * Add docs. * Add javadocs. * Fix javadocs after review. * Fix @SInCE info. * Request based sticky session (spring-cloud#860) * Implement first draft for sticky-session load-balancing. * Make setting instance cookie opt-in. * Add tests. * Make adding request cookie opt-in. * Add docs and javadocs. * Add default configuration with blocking discovery client. * Fix docs after review. * Do not pass response body to LB lifecycle beans. (spring-cloud#864) * Do not pass response body to LB lifecycle beans. * Fix argument name. * Fix generics. * Add HttpServerRequest-based constructor to RequestData. (spring-cloud#865) * Add HttpServerRequest-based constructor to RequestData. Add HttpServerResponse-based constructor to ResponseData. * Also get request cookies from headers. * Handle cookie pattern not found. * Fix adding cookie. * Fix adding cookies. Update docs. * Remove deprecations. * Move LoadBalancerProperties to the parent package. * Add function-based health check. Add restTemplate-based health-check beans to default config (spring-cloud#866) * Switch to a function-based HealthCheckServiceInstanceListSupplier. * Handle exception for restTemplate based function. Add default blocking health-check configuration. * Add docs. * Add RandomLoadBalancer, along with tests and docs. (spring-cloud#868) # Conflicts: # spring-cloud-loadbalancer/src/main/java/org/springframework/cloud/loadbalancer/core/RoundRobinLoadBalancer.java * Fix after merge. * Update SNAPSHOT to 3.0.0-RC1 * Going back to snapshots * Bumping versions * Moves classes from spring-cloud-security to spring-cloud-commons * Lb micrometer stats (spring-cloud#871) * Add stats lifecycle bean. Add onStartRequest method to LoadBalancerLifecycle. Add loadbalancer.Request field to CompletionContext. * Add TimedRequestContext interface. Make RetryableRequestContext extend RequestDataContext. Improve generating metrics. Add utility class for working with tags. Ensure tags are not null. * Add separate meters depending on CompletionContext.Status. * Modify registered metrics. Add adapter for BlockingLoadBalancerClient requests. Add autoconfiguration. * Make new config conditional on MeterRegistry class. * Rename lifecycle bean. Do not log request if 0 timestamp. * Fix onStartRequest call arguments for BlockingLoadBalancerClient. * Fix onStartRequest and onComplete calls for RetryLoadBalancerInterceptor. * Only register timed request once. Add tests. * Adjust tags logic. Add more tests. * Add more tests. * Refactor. Add javadocs. * Refactor. * Refactor. * Retrieve client response data if possible in BlockingLoadBalancerClient. * Refactor. * Fix docs after review. * Make previousServiceInstanceMutable. * Change argument order for CompletionContext constructors. Remove duplicated start time setting. * Add missing LB properties to configuration-metadata. * making getDiscoveryClients public in ReactiveCompositeDiscoveryClient * Creates TextEncryptorBindHandler for Binder decryption. It is registered in TextEncryptorConfigBootstrapper for later use in other ConfigData implementations. * Creates DecryptEnvironmentPostProcessor. This is used if bootstrap and legacy processing are not enabled. EnvironmentDecryptApplicationInitializer is only is if bootstrap and legacy processing are enabled. Fixes spring-cloudgh-815 * Update SNAPSHOT to 3.0.0 * Going back to snapshots * Bumping versions to 3.0.1-SNAPSHOT after release * Bumping versions Co-authored-by: Ryan Baxter <rbaxter@pivotal.io> Co-authored-by: buildmaster <buildmaster@springframework.org> Co-authored-by: Spencer Gibb <spencer@gibb.us> Co-authored-by: Olga Maciaszek-Sharma <olga.maciaszek@gmail.com> Co-authored-by: shenjianeng <30279020+shenjianeng@users.noreply.github.com> Co-authored-by: Spencer Gibb <spencer@gibb.tech> Co-authored-by: robotmrv <robotmrv@gmail.com> Co-authored-by: JinSoo Han <hahahohokiss@gmail.com> Co-authored-by: jinsoohan <jinsoo.han@gmail.com> Co-authored-by: Timothy <timothy.mathison96@gmail.com> Co-authored-by: Nikita Konev <3160384+nkonev@users.noreply.github.com> Co-authored-by: Marcin Grzejszczak <marcin.grzejszczak@gmail.com> Co-authored-by: Tim van Baarsen <tim@jtim.nl> Co-authored-by: 如梦技术 <596392912@qq.com> Co-authored-by: Andrew Fitzgerald <andrewcfitzgerald@gmail.com> Co-authored-by: Spencer Gibb <sgibb@pivotal.io> Co-authored-by: shollander <shollander1@gmail.com> Co-authored-by: Sébastien Deleuze <sdeleuze@users.noreply.github.com> Co-authored-by: jialindai <53717919+jialindai@users.noreply.github.com> Co-authored-by: Ryan Baxter <rbaxter@vmware.com> Co-authored-by: Dave Syer <dsyer@vmware.com> Co-authored-by: Dave Syer <dsyer@pivotal.io> Co-authored-by: Jay Bryant <jbryant@pivotal.io> Co-authored-by: Mushtaq Ahmed <ahm.mushtaq@gmail.com> Co-authored-by: Ralph Goers <rgoers@apache.org> Co-authored-by: alchemy24 <charu.covindane@gmail.com>
Bootstrap is now opt-in.
See #608 for original motivation.
Remaining issues
FIXME: legacy
issues. Mostly disabled tests.Deprecate bootstrap?make bootsrap opt-in