Skip to content

Commit

Permalink
Fix bootstrap bug for integrated example (#2989)
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
Phixsura authored Dec 20, 2022
1 parent 45838bb commit 11b9bbe
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,10 @@ public Mono<ServerResponse> handleRequest(ServerWebExchange serverWebExchange,
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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,8 @@ spring:
discovery:
server-addr: nacos-server:8848
group: integrated-example
config:
import: optional:nacos:integrated-provider.yaml

server:
port: 8015
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand All @@ -25,3 +25,4 @@ seata:
integrated-storage-group: default
grouplist:
default: seata-server:8091

0 comments on commit 11b9bbe

Please sign in to comment.