diff --git a/dc3-api/dc3-api-manager/src/main/java/com/dc3/api/center/manager/feign/EventClient.java b/dc3-api/dc3-api-manager/src/main/java/com/dc3/api/center/manager/feign/EventClient.java index 3a77b3207..4b05e97e0 100644 --- a/dc3-api/dc3-api-manager/src/main/java/com/dc3/api/center/manager/feign/EventClient.java +++ b/dc3-api/dc3-api-manager/src/main/java/com/dc3/api/center/manager/feign/EventClient.java @@ -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 { /** diff --git a/dc3-center/dc3-auth/src/main/resources/application-dev.yml b/dc3-center/dc3-auth/src/main/resources/application-dev.yml new file mode 100644 index 000000000..f0e73b9a2 --- /dev/null +++ b/dc3-center/dc3-auth/src/main/resources/application-dev.yml @@ -0,0 +1,3 @@ +eureka: + instance: + ip-address: dc3-auth \ No newline at end of file diff --git a/dc3-center/dc3-auth/src/main/resources/application.yml b/dc3-center/dc3-auth/src/main/resources/application.yml index df16c7290..00c679bd7 100644 --- a/dc3-center/dc3-auth/src/main/resources/application.yml +++ b/dc3-center/dc3-auth/src/main/resources/application.yml @@ -12,6 +12,7 @@ spring: - mysql - redis - feign + - dev main: allow-bean-definition-overriding: true mvc: diff --git a/dc3-center/dc3-data/pom.xml b/dc3-center/dc3-data/pom.xml index 1a5d64b8a..be23695c7 100644 --- a/dc3-center/dc3-data/pom.xml +++ b/dc3-center/dc3-data/pom.xml @@ -27,38 +27,44 @@ - + org.springframework.boot - spring-boot-starter-amqp + spring-boot-starter-data-mongodb - + org.springframework.boot - spring-boot-starter-data-mongodb + spring-boot-starter-amqp - + org.springframework.boot spring-boot-starter-quartz - + com.dc3 - dc3-core + dc3-api-manager + + + com.dc3 + dc3-api-data - + com.dc3 - dc3-api-manager + dc3-profiles + + com.dc3 - dc3-api-data + dc3-core diff --git a/dc3-center/dc3-data/src/main/java/com/dc3/center/data/config/TopicRabbitConfig.java b/dc3-center/dc3-data/src/main/java/com/dc3/center/data/config/TopicRabbitConfig.java index a6da5eef8..44311404a 100644 --- a/dc3-center/dc3-data/src/main/java/com/dc3/center/data/config/TopicRabbitConfig.java +++ b/dc3-center/dc3-data/src/main/java/com/dc3/center/data/config/TopicRabbitConfig.java @@ -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 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); diff --git a/dc3-center/dc3-data/src/main/resources/application-dev.yml b/dc3-center/dc3-data/src/main/resources/application-dev.yml new file mode 100644 index 000000000..a772bc994 --- /dev/null +++ b/dc3-center/dc3-data/src/main/resources/application-dev.yml @@ -0,0 +1,3 @@ +eureka: + instance: + ip-address: dc3-data \ No newline at end of file diff --git a/dc3-center/dc3-data/src/main/resources/application.yml b/dc3-center/dc3-data/src/main/resources/application.yml index 3d00fe52a..4d2fe6a3e 100644 --- a/dc3-center/dc3-data/src/main/resources/application.yml +++ b/dc3-center/dc3-data/src/main/resources/application.yml @@ -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: diff --git a/dc3-center/dc3-manager/pom.xml b/dc3-center/dc3-manager/pom.xml index 52907668c..7642139ee 100644 --- a/dc3-center/dc3-manager/pom.xml +++ b/dc3-center/dc3-manager/pom.xml @@ -27,7 +27,7 @@ - + org.springframework.boot spring-boot-starter-data-mongodb @@ -44,8 +44,6 @@ com.dc3 dc3-api-auth - - com.dc3 dc3-api-manager diff --git a/dc3-center/dc3-manager/src/main/resources/application-dev.yml b/dc3-center/dc3-manager/src/main/resources/application-dev.yml new file mode 100644 index 000000000..f916c84bb --- /dev/null +++ b/dc3-center/dc3-manager/src/main/resources/application-dev.yml @@ -0,0 +1,3 @@ +eureka: + instance: + ip-address: dc3-manager \ No newline at end of file diff --git a/dc3-center/dc3-manager/src/main/resources/application.yml b/dc3-center/dc3-manager/src/main/resources/application.yml index 2a0d2bac8..6576048fc 100644 --- a/dc3-center/dc3-manager/src/main/resources/application.yml +++ b/dc3-center/dc3-manager/src/main/resources/application.yml @@ -9,6 +9,7 @@ spring: - register - monitor - server + - rabbitmq - mysql - mongo - redis diff --git a/dc3-common/dc3-config/pom.xml b/dc3-common/dc3-config/pom.xml index 5ed8717b4..10308966d 100644 --- a/dc3-common/dc3-config/pom.xml +++ b/dc3-common/dc3-config/pom.xml @@ -36,22 +36,22 @@ spring-aspects - + org.springframework.cloud spring-cloud-starter-netflix-eureka-client - + - org.springframework.boot - spring-boot-starter-actuator + de.codecentric + spring-boot-admin-starter-client - + - de.codecentric - spring-boot-admin-starter-client + org.springframework.boot + spring-boot-starter-actuator diff --git a/dc3-common/dc3-profiles/pom.xml b/dc3-common/dc3-profiles/pom.xml index 7f8cead25..ad2e1bc4b 100644 --- a/dc3-common/dc3-profiles/pom.xml +++ b/dc3-common/dc3-profiles/pom.xml @@ -30,28 +30,28 @@ - + org.springframework.cloud spring-cloud-starter-netflix-eureka-client - + de.codecentric spring-boot-admin-starter-client - + - com.dc3 - dc3-boot-starter + org.springframework.boot + spring-boot-starter-actuator - + - org.springframework.boot - spring-boot-starter-actuator + com.dc3 + dc3-boot-starter diff --git a/dc3-common/dc3-sdk/pom.xml b/dc3-common/dc3-sdk/pom.xml index 79280d91e..28bac5854 100644 --- a/dc3-common/dc3-sdk/pom.xml +++ b/dc3-common/dc3-sdk/pom.xml @@ -27,6 +27,12 @@ + + + org.springframework.cloud + spring-cloud-starter-bootstrap + + org.springframework.boot @@ -42,49 +48,43 @@ org.springframework.boot spring-boot-starter-undertow - - - - org.springframework - spring-aspects - - + org.springframework.cloud spring-cloud-starter-netflix-eureka-client - + - org.springframework.cloud - spring-cloud-starter-circuitbreaker-resilience4j + de.codecentric + spring-boot-admin-starter-client - + org.springframework.boot spring-boot-starter-actuator - - - de.codecentric - spring-boot-admin-starter-client - - org.springframework.boot spring-boot-starter-amqp - + org.springframework.boot spring-boot-starter-quartz + + + com.dc3 + dc3-boot-starter + + com.github.ben-manes.caffeine @@ -98,12 +98,6 @@ commons-pool2 - - - com.dc3 - dc3-boot-starter - - com.dc3 diff --git a/dc3/server/dev.sh b/dc3/server/dev.sh index 0db545b45..9ec6baa08 100755 --- a/dc3/server/dev.sh +++ b/dc3/server/dev.sh @@ -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 \ No newline at end of file +docker-compose build mysql redis mongo rabbitmq register auth data +docker-compose up -d mysql redis mongo rabbitmq register auth data \ No newline at end of file diff --git a/pom.xml b/pom.xml index 701d4397a..e98566906 100644 --- a/pom.xml +++ b/pom.xml @@ -133,7 +133,7 @@ import - + de.codecentric spring-boot-admin-starter-server