Summary: We would like to be able to configure a fallback uri that the config server would use if an error occurs when contacting the primary uri. Our config server needs to be highly available.

I saw two other requests that looked related, but it didn't appear as though they were implemented, and I didn't see a workaround: https://github.com/spring-cloud/spring-cloud-config/pull/1220 and https://github.com/spring-cloud/spring-cloud-config/issues/617#issuecomment-275436934.

We should be able to provide this any place we can provide the uri parameter. For example:

      server:
        composite:
        -
          type: git
          basedir: ${spring.cloud.config.server.git.basedir}
          uri: ${DefaultURI}
          uri-backup: ${BackupURI}

          repos:
            Messaging:
              pattern: Msg*
              searchPaths: "*, Common/*"
              basedir: ${basedirParent}\\baseMessaging
              uri: ${DefaultURI}
              uri-backup: ${BackupURI}
        -
          type: git
          basedir: ${basedirParent}\\baseShared
          uri: ${DefaultURI}
          uri-backup: ${BackupURI}

I am not sure how this should tie in with falling back to the local cache. It could be:

  1. Try primary uri.
  2. If error, use local cache.
  3. If nothing in the local cache, use the backup uri.

or:

  1. Try primary uri.
  2. If error, try the backup uri
  3. If error, use the local cache if available.

Comment From: spencergibb

I think this duplicates #617

Comment From: marnee01

Is that one still open? If so, yes, this is a duplicate. My apologies. I thought that one was closed for some reason.

Comment From: spencergibb

Spring Cloud Config Add support for a backup-uri option to fall back on error