Adjusting configuration and adding documentation
This commit is contained in:
committed by
Ioannis Canellos
parent
41bb31fd4c
commit
3d766effa6
@@ -0,0 +1,18 @@
|
||||
package io.fabric8.spring.cloud.kubernetes.examples;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@SpringBootApplication
|
||||
@EnableScheduling
|
||||
public class App {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(App.class, args);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package io.fabric8.spring.cloud.kubernetes.examples;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
public class MyBean {
|
||||
|
||||
@Autowired
|
||||
private MyConfig config;
|
||||
|
||||
@Scheduled(fixedDelay = 5000)
|
||||
public void hello() {
|
||||
System.out.println("The message is: " + config.getMessage());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package io.fabric8.spring.cloud.kubernetes.examples;
|
||||
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@Configuration
|
||||
@ConfigurationProperties(prefix = "bean")
|
||||
public class MyConfig {
|
||||
|
||||
private String message = "a message that can be changed live";
|
||||
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
public void setMessage(String message) {
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
spring.application.name=reload-example
|
||||
|
||||
spring.cloud.kubernetes.reload.enabled=true
|
||||
|
||||
#spring.cloud.kubernetes.reload.strategy=restart_context
|
||||
#spring.cloud.kubernetes.reload.mode=polling
|
||||
#spring.cloud.kubernetes.reload.period=5000
|
||||
#spring.cloud.kubernetes.reload.monitoring-config-maps=false
|
||||
#spring.cloud.kubernetes.reload.monitoring-secrets=true
|
||||
Reference in New Issue
Block a user