Skip to content

Commit

Permalink
Driver SDK 适配 spring-boot 2.4.x 版本配置文件
Browse files Browse the repository at this point in the history
  • Loading branch information
pnoker committed Jun 8, 2021
1 parent 5b486d5 commit 9ee6f6c
Show file tree
Hide file tree
Showing 15 changed files with 79 additions and 79 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
*
* @author pnoker
*/
@FeignClient(path = Common.Service.DC3_MANAGER_EVENT_URL_PREFIX, name = Common.Service.DC3_DATA_SERVICE_NAME, fallbackFactory = EventClientHystrix.class)
@FeignClient(path = Common.Service.DC3_MANAGER_EVENT_URL_PREFIX, name = Common.Service.DC3_MANAGER_SERVICE_NAME, fallbackFactory = EventClientHystrix.class)
public interface EventClient {

/**
Expand Down
3 changes: 3 additions & 0 deletions dc3-center/dc3-auth/src/main/resources/application-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
eureka:
instance:
ip-address: dc3-auth
1 change: 1 addition & 0 deletions dc3-center/dc3-auth/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ spring:
- mysql
- redis
- feign
- dev
main:
allow-bean-definition-overriding: true
mvc:
Expand Down
26 changes: 16 additions & 10 deletions dc3-center/dc3-data/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,38 +27,44 @@

<dependencies>

<!-- Spring RabbitMq -->
<!-- Spring MongoDB-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-amqp</artifactId>
<artifactId>spring-boot-starter-data-mongodb</artifactId>
</dependency>

<!-- MongoDB-->
<!-- Spring RabbitMq -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-mongodb</artifactId>
<artifactId>spring-boot-starter-amqp</artifactId>
</dependency>

<!-- Quartz -->
<!-- Spring Quartz -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-quartz</artifactId>
</dependency>

<!-- Dc3 Common Core -->
<!-- Dc3 Api -->
<dependency>
<groupId>com.dc3</groupId>
<artifactId>dc3-core</artifactId>
<artifactId>dc3-api-manager</artifactId>
</dependency>
<dependency>
<groupId>com.dc3</groupId>
<artifactId>dc3-api-data</artifactId>
</dependency>

<!-- Dc3 Api -->
<!-- Dc3 Common Profiles -->
<dependency>
<groupId>com.dc3</groupId>
<artifactId>dc3-api-manager</artifactId>
<artifactId>dc3-profiles</artifactId>
</dependency>

<!-- Dc3 Common Core -->
<dependency>
<groupId>com.dc3</groupId>
<artifactId>dc3-api-data</artifactId>
<artifactId>dc3-core</artifactId>
</dependency>

</dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,27 +59,6 @@ public RabbitListenerContainerFactory<?> rabbitListenerContainerFactory(Connecti
return factory;
}

@Bean
TopicExchange eventExchange() {
return new TopicExchange(Common.Rabbit.TOPIC_EXCHANGE_EVENT, true, false);
}

@Bean
Queue deviceEventQueue() {
Map<String, Object> arguments = new HashMap<>();
// 15秒:15 * 1000 = 15000L
arguments.put("x-message-ttl", 15000L);
return new Queue(Common.Rabbit.QUEUE_DEVICE_EVENT, true, false, false, arguments);
}

@Bean
Binding deviceEventBinding() {
return BindingBuilder
.bind(deviceEventQueue())
.to(eventExchange())
.with(Common.Rabbit.ROUTING_DEVICE_EVENT_PREFIX + "*");
}

@Bean
TopicExchange valueExchange() {
return new TopicExchange(Common.Rabbit.TOPIC_EXCHANGE_VALUE, true, false);
Expand Down
3 changes: 3 additions & 0 deletions dc3-center/dc3-data/src/main/resources/application-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
eureka:
instance:
ip-address: dc3-data
16 changes: 14 additions & 2 deletions dc3-center/dc3-data/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,24 @@ server:
spring:
application:
name: @project.artifactId@
profiles:
active:
- register
- monitor
- server
- rabbitmq
- mysql
- mongo
- redis
- feign
- dev
main:
allow-bean-definition-overriding: true
mvc:
throw-exception-if-no-handler-found: true
resources:
add-mappings: false
web:
resources:
add-mappings: false
redis:
database: 3
cache:
Expand Down
4 changes: 1 addition & 3 deletions dc3-center/dc3-manager/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

<dependencies>

<!-- MongoDB-->
<!-- Spring MongoDB-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-mongodb</artifactId>
Expand All @@ -44,8 +44,6 @@
<groupId>com.dc3</groupId>
<artifactId>dc3-api-auth</artifactId>
</dependency>

<!-- Dc3 Manager Api -->
<dependency>
<groupId>com.dc3</groupId>
<artifactId>dc3-api-manager</artifactId>
Expand Down
3 changes: 3 additions & 0 deletions dc3-center/dc3-manager/src/main/resources/application-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
eureka:
instance:
ip-address: dc3-manager
1 change: 1 addition & 0 deletions dc3-center/dc3-manager/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ spring:
- register
- monitor
- server
- rabbitmq
- mysql
- mongo
- redis
Expand Down
14 changes: 7 additions & 7 deletions dc3-common/dc3-config/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,22 +36,22 @@
<artifactId>spring-aspects</artifactId>
</dependency>

<!-- Eureka -->
<!-- Spring Cloud Eureka -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
</dependency>

<!-- Actuator -->
<!-- Spring Admin -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
<groupId>de.codecentric</groupId>
<artifactId>spring-boot-admin-starter-client</artifactId>
</dependency>

<!-- Admin -->
<!-- Spring Actuator -->
<dependency>
<groupId>de.codecentric</groupId>
<artifactId>spring-boot-admin-starter-client</artifactId>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>

<!-- Caffeine Cache -->
Expand Down
16 changes: 8 additions & 8 deletions dc3-common/dc3-profiles/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,28 +30,28 @@

<dependencies>

<!-- Eureka -->
<!-- Spring Cloud Eureka -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
</dependency>

<!-- Admin -->
<!-- Spring Admin -->
<dependency>
<groupId>de.codecentric</groupId>
<artifactId>spring-boot-admin-starter-client</artifactId>
</dependency>

<!-- Dc3 Boot Starter -->
<!-- Spring Actuator -->
<dependency>
<groupId>com.dc3</groupId>
<artifactId>dc3-boot-starter</artifactId>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>

<!-- Actuator -->
<!-- Dc3 Boot Starter -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
<groupId>com.dc3</groupId>
<artifactId>dc3-boot-starter</artifactId>
</dependency>

<!-- Caffeine Cache -->
Expand Down
42 changes: 18 additions & 24 deletions dc3-common/dc3-sdk/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@

<dependencies>

<!-- Spring Cloud Starter -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-bootstrap</artifactId>
</dependency>

<!-- Undertow Web 容器 -->
<dependency>
<groupId>org.springframework.boot</groupId>
Expand All @@ -42,49 +48,43 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-undertow</artifactId>
</dependency>

<!-- Spring Aop -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aspects</artifactId>
</dependency>

<!-- Eureka -->
<!-- Spring Cloud Eureka -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
</dependency>

<!-- Resilience4j -->
<!-- Spring Admin -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-circuitbreaker-resilience4j</artifactId>
<groupId>de.codecentric</groupId>
<artifactId>spring-boot-admin-starter-client</artifactId>
</dependency>

<!-- Actuator -->
<!-- Spring Actuator -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>

<!-- Admin -->
<dependency>
<groupId>de.codecentric</groupId>
<artifactId>spring-boot-admin-starter-client</artifactId>
</dependency>

<!-- Spring RabbitMq -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-amqp</artifactId>
</dependency>

<!-- Quartz -->
<!-- Spring Quartz -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-quartz</artifactId>
</dependency>

<!-- Dc3 Boot Starter -->
<dependency>
<groupId>com.dc3</groupId>
<artifactId>dc3-boot-starter</artifactId>
</dependency>

<!-- Caffeine Cache -->
<dependency>
<groupId>com.github.ben-manes.caffeine</groupId>
Expand All @@ -98,12 +98,6 @@
<artifactId>commons-pool2</artifactId>
</dependency>

<!-- Dc3 Boot Starter -->
<dependency>
<groupId>com.dc3</groupId>
<artifactId>dc3-boot-starter</artifactId>
</dependency>

<!-- Dc3 Common Base -->
<dependency>
<groupId>com.dc3</groupId>
Expand Down
4 changes: 2 additions & 2 deletions dc3/server/dev.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ cd ../../
mvn clean -U -U package
# shellcheck disable=SC2164
cd dc3/
docker-compose build mysql redis mongo rabbitmq register
docker-compose up -d mysql redis mongo rabbitmq register
docker-compose build mysql redis mongo rabbitmq register auth data
docker-compose up -d mysql redis mongo rabbitmq register auth data
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@
<scope>import</scope>
</dependency>

<!-- Spring Boot Admin -->
<!-- Spring Admin -->
<dependency>
<groupId>de.codecentric</groupId>
<artifactId>spring-boot-admin-starter-server</artifactId>
Expand Down

0 comments on commit 9ee6f6c

Please sign in to comment.