1

I just ran jhipster registry and its working fine. It's looking for config files from central-config folder. I want to refactor my config files under folders in the central-config folder itself. That's something that I can achieve running Spring Cloud Config server with a configuration like this:

spring:
       cloud:
            config:
                   server:
                         git:
                            default-label: develop
                            uri: file://${user.home}/config-repo
                            search-paths: employee-service, enterprise-service

How can I achieve such behavior with 'composite thing' in jhipster-registry. For info, this is the bootstrap.yml file from jhipster registry:

# ===================================================================
# Spring Cloud Config bootstrap configuration for the "dev" profile
# In prod profile, properties will be overwriten by the ones defined in bootstrap-prod.yml
# ===================================================================

spring:
    application:
        name: jhipster-registry
    profiles:
        active: dev
        include: composite
    cloud:
        config:
            server:
                bootstrap: true
                composite:
                    - type: native
                      search-locations: file:./central-config
                     #search-locations: file://${user.home}/Acensi/isupplier/config-repo

                prefix: /config
            fail-fast: true
            # name of the config server's property source (file.yml) that we want to use
            name: jhipster-registry
            profile: dev # profile(s) of the property source
            label: master # toggle to switch to a different version of the configuration as stored in git
            # it can be set to any label, branch or commit of the config source git repository

info:
    project:
        version: #project.version#

# uncomment to enable encryption features
#encrypt:
#    key: my-secret-encryption-key-to-change-in-production
Habchi
  • 1,921
  • 2
  • 22
  • 50

2 Answers2

0

I had the same issue. I added to my application.yml file the following:

spring:
  cloud:
    config:
      server:
        bootstrap: true
        composite:
          - type: native
            search-locations: file:./central-config/myFolder

You were very close, hope it helps.

esseara
  • 834
  • 5
  • 27
  • 47
0

I was upgrading an existing older JHipster Registry to 5.0.1. I was also using the git repo. The problem with the above configurations is that the property is not called search-locations for the git repo it is search-paths. In order to keep everything working as before which was had the search paths specified via an environment variable SPRING_CLOUD_CONFIG_SERVER_GIT_SEARCH-PATHS, I use the following configuration in my prod bootstrap.

bootstrap-prod.yml:

spring:
    cloud:
        config:
            server:
                bootstrap: true
                composite:
                    - type: git
                    uri: git@bitbucket.org:whatever/repo
                    search-paths: ${spring.cloud.config.server.git.search-paths}
                    ignore-local-ssh-settings: true
                    private-key: |
                      -----BEGIN RSA PRIVATE KEY-----
Matt
  • 4,405
  • 1
  • 17
  • 9