Hi All,
I am trying to change dependency from Spring Cloud Config Server into Spring Cloud Starter Config as @spencergibb suggest. But my config server always DOWN.
Do You have any idea?
Here the repo to reproduce the issue --> https://gitlab.com/microservice-samples/micro-services-spring-cloud-config/config-server
Thanks
Comment From: spencergibb
Here is the diff that works for me
❮ git diff
diff --git a/pom.xml b/pom.xml
index 97c22cf..0410e21 100644
--- a/pom.xml
+++ b/pom.xml
@@ -24,7 +24,7 @@
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
- <artifactId>spring-cloud-starter-config</artifactId>
+ <artifactId>spring-cloud-config-server</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
diff --git a/src/main/java/com/hendisantika/microservices/configserver/ConfigServerApplication.java b/src/main/java/com/hendisantika/microservices/configserver/ConfigServerApplication.java
index 055f5e8..14060c6 100644
--- a/src/main/java/com/hendisantika/microservices/configserver/ConfigServerApplication.java
+++ b/src/main/java/com/hendisantika/microservices/configserver/ConfigServerApplication.java
@@ -3,9 +3,11 @@ package com.hendisantika.microservices.configserver;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
+import org.springframework.cloud.config.server.EnableConfigServer;
@SpringBootApplication
@EnableDiscoveryClient
+@EnableConfigServer
public class ConfigServerApplication {
public static void main(String[] args) {
diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties
index a25fd27..4b1ed69 100644
--- a/src/main/resources/application.properties
+++ b/src/main/resources/application.properties
@@ -3,17 +3,11 @@ server.port=8888
# URI of GIT repo containing properties
#spring.cloud.config.server.git.uri=https://gitlab.com/microservice-samples/micro-services-spring-cloud-config/configuration
#spring.cloud.config.server.git.uri=https://github.com/hendisantika/microservices-config-server
spring.cloud.config.server.git.skip-ssl-validation=true
-spring.cloud.config.enabled=false
-#spring.config.import=optional:configserver:http://localhost:8888
-spring.cloud.config.fail-fast=true
-spring.cloud.config.retry.max-attempts=15
# path to properties from root of repo
-spring.cloud.config.server.git.default-label= master
-spring.cloud.config.label=master
+spring.cloud.config.server.git.default-label=master
spring.cloud.config.server.git.searchPaths=configuration
management.security.enabled=false
-#spring.cloud.config.server.git.clone-on-start=true
eureka.instance.instance-id=${spring.cloud.client.hostname}:${spring.application.name}:${random.uuid}
logging.level.org.springframework.web=INFO
Comment From: hendisantika
I don't understand the point.
Comment From: spencergibb
Those changes I made to your code made it so config server started and the /actuator/health endpoint reported ok
Comment From: hendisantika
On previous issue You have We have to use spring-cloud-config-server instead of spring-cloud-starter-config. But Here You are using spring-cloud-config-server again.
Comment From: spencergibb
Are you trying to run a config server or connect to one?
Comment From: hendisantika
Both.
Comment From: spencergibb
So what I showed is running config server
Comment From: hendisantika
OK. Let me try again. Because my previous code is using spring-cloud-config-server is running well only I got error on yml/properties file. Then as You suggest I change to spring-cloud-starter-config then error occured because I can not use @EnableConfigServer if I am using spring-cloud-starter-config.
Comment From: spencergibb
I didn't have the right context in your unrelated comment on the previous issue. What I did gets config server running
Comment From: hendisantika
If back to spring-cloud-config-server then the issue is closed. Thank You @spencergibb .
I will add another issue then.