bindian0509 / microservices-complete

⭐️ A complete reference for building robust backend architecture in Java and Spring ⭐️
1 stars 0 forks source link

Issue with config import on docker-compose build of twitter-to-kafka application #10

Open bindian0509 opened 1 year ago

bindian0509 commented 1 year ago

Currently facing problem with using spring url of config server -

2023-09-14 16:57:07 INFO  [main] c.b.m.t.t.k.s.TwitterToKafkaServiceApplication - Starting TwitterToKafkaServiceApplication v0.0.1-SNAPSHOT using Java 20.0.1 with PID 1145 (/workspace/BOOT-INF/classes started by root in /workspace)
2023-09-14 16:57:07 DEBUG [main] c.b.m.t.t.k.s.TwitterToKafkaServiceApplication - Running with Spring Boot v3.1.2, Spring v6.0.11
2023-09-14 16:57:07 INFO  [main] c.b.m.t.t.k.s.TwitterToKafkaServiceApplication - The following 1 profile is active: "twitter_to_kafka"
2023-09-14 16:57:07 INFO  [main] o.s.c.c.c.ConfigServerConfigDataLoader - Fetching config from server at : http://config-server:8888
2023-09-14 16:57:07 WARN  [main] o.s.c.c.c.ConfigServerConfigDataLoader - Could not locate PropertySource ([ConfigServerConfigDataResource@55b5e331 uris = array<String>['http://config-server:8888'], optional = true, profiles = 'default']): Could not extract response: no suitable HttpMessageConverter found for response type [class org.springframework.cloud.config.environment.Environment] and content type [text/html;charset=UTF-8]
2023-09-14 16:57:07 INFO  [main] o.s.c.c.c.ConfigServerConfigDataLoader - Fetching config from server at : http://localhost:8888
2023-09-14 16:57:07 INFO  [main] o.s.c.c.c.ConfigServerConfigDataLoader - Exception on Url - http://localhost:8888:org.springframework.web.client.ResourceAccessException: I/O error on GET request for "http://localhost:8888/twitter-to-kafka-service,config-client/default": Connection refused. Will be trying the next url if available
2023-09-14 16:57:07 WARN  [main] o.s.c.c.c.ConfigServerConfigDataLoader - Could not locate PropertySource ([ConfigServerConfigDataResource@720653c2 uris = array<String>['http://localhost:8888'], optional = true, profiles = 'default']): I/O error on GET request for "http://localhost:8888/twitter-to-kafka-service,config-client/default": Connection refused
2023-09-14 16:57:07 INFO  [main] o.s.c.c.c.ConfigServerConfigDataLoader - Fetching config from server at : http://config-server:8888
2023-09-14 16:57:07 INFO  [main] o.s.c.c.c.ConfigServerConfigDataLoader - Located environment: name=twitter-to-kafka-service,config-client, profiles=[twitter_to_kafka], label=null, version=bebcf61f2cbdbc899dbf691d4d82d6d74fe4758e, state=null
2023-09-14 16:57:07 INFO  [main] o.s.c.c.c.ConfigServerConfigDataLoader - Fetching config from server at : http://config-server:8888
2023-09-14 16:57:07 INFO  [main] o.s.c.c.c.ConfigServerConfigDataLoader - Located environment: name=twitter-to-kafka-service,config-client, profiles=[default], label=null, version=bebcf61f2cbdbc899dbf691d4d82d6d74fe4758e, state=null
2023-09-14 16:57:07 INFO  [main] o.s.c.c.c.ConfigServerConfigDataLoader - Fetching config from server at : http://localhost:8888
2023-09-14 16:57:07 INFO  [main] o.s.c.c.c.ConfigServerConfigDataLoader - Exception on Url - http://localhost:8888:org.springframework.web.client.ResourceAccessException: I/O error on GET request for "http://localhost:8888/twitter-to-kafka-service,config-client/twitter_to_kafka": Connection refused. Will be trying the next url if available
2023-09-14 16:57:07 WARN  [main] o.s.c.c.c.ConfigServerConfigDataLoader - Could not locate PropertySource ([ConfigServerConfigDataResource@7fedfe27 uris = array<String>['http://localhost:8888'], optional = true, profiles = 'twitter_to_kafka']): I/O error on GET request for "http://localhost:8888/twitter-to-kafka-service,config-client/twitter_to_kafka": Connection refused
2023-09-14 16:57:07 INFO  [main] o.s.c.c.c.ConfigServerConfigDataLoader - Fetching config from server at : http://localhost:8888
2023-09-14 16:57:07 INFO  [main] o.s.c.c.c.ConfigServerConfigDataLoader - Exception on Url - http://localhost:8888:org.springframework.web.client.ResourceAccessException: I/O error on GET request for "http://localhost:8888/twitter-to-kafka-service,config-client/default": Connection refused. Will be trying the next url if available
2023-09-14 16:57:07 WARN  [main] o.s.c.c.c.ConfigServerConfigDataLoader - Could not locate PropertySource ([ConfigServerConfigDataResource@2f879bab uris = array<String>['http://localhost:8888'], optional = true, profiles = 'default']): I/O error on GET request for "http://localhost:8888/twitter-to-kafka-service,config-client/default": Connection refused
2023-09-14 16:57:11 INFO  [main] o.s.cloud.context.scope.GenericScope - BeanFactory id=73aaeddf-84ed-35a5-8d97-9e689f09f4f0
bindian0509 commented 1 year ago

It worked with the following optional placeholder on services.yml file but still logs are showing same error -

    environment:

      - "SPRING_CONFIG_IMPORT=optional:configserver:http://config-server:8888"