spring-cloud-consul

@RefreshScope stops @Scheduled task

巧了我就是萌 提交于 2020-06-17 02:39:42
问题 I have a monitoring app wherein I am running a fixedRate task. This is pulling in a config parameter configured with Consul. I want to pull in updated configuration, so I added @RefreshScope. But as soon as I update the config value on Consul, the fixedRate task stops running. @Service @RefreshScope public class MonitorService { @Autowired private AppConfig appConfig; @PostConstruct public void postConstRun() { System.out.println(appConfig.getMonitorConfig()); } @Scheduled(fixedRate = 1000)

Consul with Spring Cloud Gateway - Inter Service Communication

时光总嘲笑我的痴心妄想 提交于 2020-02-07 06:01:27
问题 The setup: I have a set of Spring Boot based microservices that are fronted by Spring Cloud Gateway, meaning every request that comes from UI or external API client first comes to Spring Cloud Gateway and is then forwarded to appropriate microservice. The routes are configured in Consul, and Spring Cloud Gateway communicates with Consul to get the routes accordingly. Requirement: There is a need of some microservices communicating with each other with REST APIs. I would prefer this

spring boot logback rolling file append-er not working

陌路散爱 提交于 2020-01-14 05:22:07
问题 I am developing a spring boot application, where I am reading the logback configuration from a YML file which is in Consul . Following are the configuration I have used in the YML file. logging: file: ./logs/application.log pattern: console: "%d %-5level %logger : %msg%n" file: "%d %-4relative [%thread] %-5level %logger{35} - %msg%n" level: org.springframework.web: ERROR com.myapp.somepackage: DEBUG appenders: logFormat: "%d %-4relative [%thread] %-5level %logger{35} - %msg%n"

Read values from consul while bootstrap spring boot

有些话、适合烂在心里 提交于 2019-12-25 01:09:59
问题 I have question is there any way to retrieve certain values and inject them to bootstrap.yml while application is coming up. I have configuration file like this: spring: application: name: myApp cloud: consul: enabled: true host: localhost port: 8500 config: enabled: true datasource: url: jdbc:oracle:thin:@localhost:1111:XXXX username: ${nameOfVariable1} password: ${nameOfVariable1} driver-class-name: oracle.jdbc.OracleDriver For example, I need to configure embedded tomcat port, or DB

Not able to load logback.xml from Consul

守給你的承諾、 提交于 2019-12-11 19:50:05
问题 The issue goes like this I have all my configuration for the project in Consul KV store The configuration includes application.yml, logback.xml and few other configurations needed by my project. Using bootstrap.yml for Spring Cloud Consul configuration which contains logging.config for with the URI of the configuration URI is as follow for logging.config - http://CONSUL_SERVER_IP:CONSUL_SERVER_PORT/v1/kv/CONSUL_CONFIG_PREFIX/logback.xml?raw Also tried passing below as argument/VM argument

Trying to get Spring/Consul/Vault to work together

假装没事ソ 提交于 2019-12-11 05:08:34
问题 I'm trying to do something I think is simple. I want to use Consul for configuration, and Vault for secrets. What I'm looking for is a simple app like this that allows me to get config and services from Consul, and secrets from Vault. In my example, Consul and Vault are connected, and I can see Vault in the Consul services and key-value store. In Postman, I can query Vault directly and see my data at {{vault_url}}/v1/secret/interservice-bus/data-categorizer Right now I cannot see Consul or

Not able to read configuration from Consul in spring-boot application

℡╲_俬逩灬. 提交于 2019-12-04 13:41:17
问题 I am creating a Spring Boot application, which will read configuration like DB properties from Consul . But I am not able to read the key value from Consul using my application. Following is, what I am trying to do. **pom.xml** <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0<

Unable to get logback-spring.xml property file using Spring Cloud Config and Discovery

心已入冬 提交于 2019-12-04 03:46:18
问题 I'm using Discovery first bootstrap feature and Consul as a Discovery Server, url to Config Server is located during start-up and I was able to get application.properties . I need also to get logback-spring.xml configuration from Config server and I don't know how. What should I specify in logging.config={???}logback-spring.xml property to not hardcode url to Config Server? Before Consul integration I was using url formed according to Serving Plain text documentation with hardcoded Config

Unable to get logback-spring.xml property file using Spring Cloud Config and Discovery

回眸只為那壹抹淺笑 提交于 2019-12-01 19:47:06
I'm using Discovery first bootstrap feature and Consul as a Discovery Server, url to Config Server is located during start-up and I was able to get application.properties . I need also to get logback-spring.xml configuration from Config server and I don't know how. What should I specify in logging.config={???}logback-spring.xml property to not hardcode url to Config Server? Before Consul integration I was using url formed according to Serving Plain text documentation with hardcoded Config server url in properties and it was working fine, but now we want to avoid this. From what I debugged