Fix bootstrap bug for integrated example (#2989)

* Change the external configuration to spring.config.import to import

* Fixed an issue where external configuration could not be introduced

* Fix the problem that the external configuration of the database cannot be imported.

* Fix cross-domain filtering configuration due to springboot version change

* Add dependency of loadbalancer missing.

* Change to map host.

* Delete relevant configs.

* Delete duplicate define.

* Delete duplicate define.

* Follow the nacos example to modify the configured import.
pull/2875/merge
MieAh 2 years ago committed by GitHub
parent 45838bb7a8
commit 11b9bbe1f7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -11,11 +11,12 @@ spring:
group: integrated-example
config:
server-addr: nacos-server:8848
file-extension: yaml
group: integrated-example
shared-configs[0]:
dataid: datasource-config.yaml
group: integrated-example
file-extension: yaml
config:
import:
- optional:nacos:integrated-account.yaml
- optional:nacos:datasource-config.yaml
seata:
application-id: ${spring.application.name}

@ -104,10 +104,10 @@ public class GatewayConfig {
public CorsWebFilter corsFilter() {
UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
CorsConfiguration config = new CorsConfiguration();
config.addAllowedOrigin("*");
config.setAllowCredentials(true);
config.addAllowedHeader("*");
config.addAllowedMethod("*");
config.addAllowedOriginPattern("*");
source.registerCorsConfiguration("/**", config);
return new CorsWebFilter(source);

@ -5,10 +5,12 @@ spring:
name: integrated-gateway
cloud:
nacos:
discovery:
server-addr: nacos-server:8848
group: integrated-example
config:
server-addr: nacos-server:8848
group: integrated-example
file-extension: yaml
discovery:
server-addr: nacos-server:8848
group: integrated-example
config:
import: optional:nacos:integrated-gateway.yaml

@ -66,6 +66,12 @@
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-loadbalancer</artifactId>
</dependency>
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>integrated-common</artifactId>

@ -11,11 +11,12 @@ spring:
group: integrated-example
config:
server-addr: nacos-server:8848
file-extension: yaml
group: integrated-example
shared-configs[0]:
dataid: datasource-config.yaml
group: integrated-example
file-extension: yaml
config:
import:
- optional:nacos:integrated-order.yaml
- optional:nacos:datasource-config.yaml
seata:
application-id: ${spring.application.name}

@ -7,11 +7,14 @@ spring:
file-extension: yaml
server-addr: nacos-server:8848
group: integrated-example
shared-configs[0]:
dataid: datasource-config.yaml
group: integrated-example
discovery:
server-addr: nacos-server:8848
group: integrated-example
config:
import:
- optional:nacos:integrated-consumer.yaml
- optional:nacos:datasource-config.yaml
server:
port: 8014

@ -10,5 +10,8 @@ spring:
discovery:
server-addr: nacos-server:8848
group: integrated-example
config:
import: optional:nacos:integrated-provider.yaml
server:
port: 8015

@ -11,11 +11,11 @@ spring:
group: integrated-example
config:
server-addr: nacos-server:8848
file-extension: yaml
group: integrated-example
shared-configs[0]:
dataid: datasource-config.yaml
group: integrated-example
config:
import:
- optional:nacos:integrated-storage.yaml
- optional:nacos:datasource-config.yaml
seata:
application-id: ${spring.application.name}
@ -25,3 +25,4 @@ seata:
integrated-storage-group: default
grouplist:
default: seata-server:8091
Loading…
Cancel
Save