0

Getting below Json response for the url http://localhost:8888/limits-service/default.It is not reading the file limit-service.properties

{ "name": "limits-service", "profiles": [ "maximum" ], "label": null, "version": null, "state": null, "propertySources": [] }

application.properties

spring.application.name=spring-cloud-confg-server

server.port = 8888

spring.profiles.active=native

spring.cloud.config.server.native.search-locations=file:///C:/Learning/configs-repo/

limit-service.properties (path C:/Learning/configs-repo/)

limits-service.maximum =8999

limits-service.minimum = 8

SpringCloudConfigServerApplication.java

 @EnableConfigServer
 @SpringBootApplication
 public class SpringCloudConfigServerApplication {

public static void main(String[] args) {
    SpringApplication.run(SpringCloudConfigServerApplication.class, args);
}

}

Could you please help me understanding why it is not reading the file

Balaji
  • 11
  • 4
  • What is the error message you get int the application log? – triplem Dec 15 '20 at 06:40
  • o.s.core.env.StandardEnvironment : Activating profiles [default] o.s.c.c.s.e.NativeEnvironmentRepository : Not adding property source: file [C:\Learning\configs-repo\limits-service.properties m.m.a.RequestResponseBodyMethodProcessor : Using 'application/json', given [*/*] and supported [application/json] m.m.a.RequestResponseBodyMethodProcessor : Writing [Environment [name=limits-service, profiles=[default], label=null, propertySources=[], version=null, (truncated)...] o.s.web.servlet.DispatcherServlet : Completed 200 OK – Balaji Dec 15 '20 at 07:25
  • You tried something like limits-service-maximum.properties and rename the proeprties to not contain the profile? – triplem Dec 15 '20 at 10:15
  • No It is not reading the message from the property.Whatever may be the message inside it – Balaji Dec 15 '20 at 10:49

1 Answers1

1

it was not working with Spring boot 2.4.1 and Spring Cloud config server 2020.0.0-M6. Wheres when I changed to Spring boot 2.3.7.RELEASE and Spring cloud config server Hoxton.SR9 it is working

Balaji
  • 11
  • 4