Skip to content

Extracted catalog watch auto-configuration. #434

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

Merged
merged 2 commits into from
Jul 24, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Removed @EnableScheduling
  • Loading branch information
TYsewyn committed Jul 23, 2019
commit 810f4bb9264ad02264e6105ee50b0927e84c15d7
4 changes: 4 additions & 0 deletions docs/src/main/asciidoc/discovery-client.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,7 @@ spring.cloud.kubernetes.discovery.enabled=false

Some Spring Cloud components use the `DiscoveryClient` in order to obtain information about the local service instance. For
this to work, you need to align the Kubernetes service name with the `spring.application.name` property.

Spring Cloud Kubernetes can also watch the Kubernetes service catalog for changes and update the
`DiscoveryClient` implementation accordingly. In order to enable this functionality you need to add
`@EnableScheduling` on a configuration class in your application.
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,13 @@
import org.springframework.cloud.kubernetes.KubernetesAutoConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling;

/**
* Auto configuration for catalog watcher.
*
* @author Tim Ysewyn
*/
@Configuration
@EnableScheduling
@ConditionalOnDiscoveryEnabled
@ConditionalOnProperty(name = "spring.cloud.kubernetes.enabled", matchIfMissing = true)
@AutoConfigureAfter({ KubernetesAutoConfiguration.class })
Expand Down