Search code examples
jhipsterspring-cloud-config

Running jhipster-registry in native profile: central-config folder not rode


I am currently trying to run jhipster-registry in dev profile to serve the configurations to a jhipster microservice application.

I've followed this official jhipster registry doc and:

have built it from sources, and launched it as follow:

./jhipster-registry-3.0.0.war --spring.profiles.active=dev  

And as the doc states, i have put the central-config directory containing <mymicrosericeappname>-dev.yml alongside the jhipster-registry generated war file.

When i launch jhipster-registry, everything is ok,
but when i run my microservice application, it connects to the registry (i can see it in the jhipster-registry dashboard), but i realize that it is reading the application-dev.yml file located at src/main/resources/config/ inside the microservice app.

I dont know if i misplaced the central-config folder... That said, i really need to know what's wrong.

Thanks


Solution

  • Thanks to @GaelMarziou, his answer helped me found why the central-config was not being rode.
    In fact the Spring Cloud Config bootstrap configuration for the "dev" profile bootstrap.yml file gives this:

    cloud:
            config:
                server:
                    git:
                        uri: https://github.com/jhipster/jhipster-registry-sample-config
                    native:
                        search-locations: file:./central-config  
    

    So each time i ran jhipster-registry, it was pointing the git repo and not the central-config directory. To get it work, i had to launch the registry in dev,native profile :

    ./jhipster-registry-3.0.0.war --spring.profiles.active=dev,native  
    

    Nevertheless the documentation states this:

    Using the dev profile will run the JHipster Registry with the dev and the native profiles.

    Which is not really true... considering my struggling.