spring-cloud / spring-cloud-consul

Spring Cloud Consul
http://cloud.spring.io/spring-cloud-consul/
Apache License 2.0
813 stars 541 forks source link

How to use Consul as Config center for Spring Cloud Gateway #818

Closed NicholasSong closed 1 year ago

NicholasSong commented 1 year ago

trying use consul as config center , not working boot version : 2.7.12 cloud version: 2021.0.7

use spring-cloud-starter-consul-config

bootstrap config is this

server: port: 8082 spring: application: name: XXX cloud: consul: host: localhost port: 8500 discovery: serviceName: XXX config: enabled: true format: yaml prefix: config profile-separator: ':' data-key: data spring.config.import:optional:consul:xxxxxx

I am using Spring Webflux in the Gateway application, while normal Spring Web in other applications. The problem seems to be related to this difference as Consul Config works fine with Spring Web applications.