瀏覽代碼

暂时关闭mq

hanqingsong 3 年之前
父節點
當前提交
256a346569

+ 3 - 3
depot-intelligent/pom.xml

@@ -33,7 +33,7 @@
33 33
         <skipTests>true</skipTests>
34 34
         <java.version>1.8</java.version>
35 35
         <spring-cloud.version>Hoxton.SR12</spring-cloud.version>
36
-        <rocketmq-starter.version>2.2.1</rocketmq-starter.version>
36
+        <!--<rocketmq-starter.version>2.2.1</rocketmq-starter.version>-->
37 37
     </properties>
38 38
 
39 39
     <dependencies>
@@ -167,11 +167,11 @@
167 167
             <artifactId>spring-session-data-redis</artifactId>
168 168
         </dependency>
169 169
         <!-- rocketmq -->
170
-        <dependency>
170
+        <!--<dependency>
171 171
             <groupId>org.apache.rocketmq</groupId>
172 172
             <artifactId>rocketmq-spring-boot-starter</artifactId>
173 173
             <version>${rocketmq-starter.version}</version>
174
-        </dependency>
174
+        </dependency>-->
175 175
     </dependencies>
176 176
 
177 177
     <dependencyManagement>

+ 8 - 8
depot-intelligent/src/main/java/com/chinaitop/depot/intelligent/pushs/service/impl/GrainPushsServiceImpl.java

@@ -12,8 +12,8 @@ import com.chinaitop.depot.intelligent.grainsituation.model.TWarningThresholdHis
12 12
 import com.chinaitop.depot.intelligent.grainsituation.service.TWarningThresholdHistoryService;
13 13
 import com.chinaitop.depot.intelligent.grainsituation.service.TemperatureRecordService;
14 14
 import com.chinaitop.depot.intelligent.pushs.service.GrainPushsService;
15
-import com.chinaitop.depot.intelligent.rocketMQ.producerMQ.model.MqMsg;
16
-import com.chinaitop.depot.intelligent.rocketMQ.producerMQ.service.RocketMqService;
15
+/*import com.chinaitop.depot.intelligent.rocketMQ.producerMQ.model.MqMsg;
16
+import com.chinaitop.depot.intelligent.rocketMQ.producerMQ.service.RocketMqService;*/
17 17
 import com.chinaitop.depot.intelligent.utils.JsonToObjectUtils;
18 18
 import com.chinaitop.depot.intelligent.utils.UuidUtils;
19 19
 import com.chinaitop.depot.intelligent.utils.VerificationSourceUtils;
@@ -54,8 +54,8 @@ public class GrainPushsServiceImpl implements GrainPushsService {
54 54
     private ResolutionToSendAlarmService resolutionToSendAlarmService;
55 55
     @Resource
56 56
     private TWarningThresholdHistoryService tWarningThresholdHistoryService;
57
-    @Resource
58
-    private RocketMqService rocketMqService;
57
+    /*@Resource
58
+    private RocketMqService rocketMqService;*/
59 59
 
60 60
     @Transactional(rollbackFor = Exception.class)
61 61
     @Override
@@ -280,15 +280,15 @@ public class GrainPushsServiceImpl implements GrainPushsService {
280 280
                 if (tTestdataList.size() > 0) {
281 281
                     temperatureRecordService.insertBatch(tTestdataList);
282 282
                     // 消息 CRUD 增加(Create)、* 不需要检索(Retrieve)、更新(Update)和删除(Delete) 小写区分增删改查
283
-                    rocketMqService.asyncSend(new MqMsg("smart_grp_yn", "t_testdata_c", null, tTestdataList));
283
+//                    rocketMqService.asyncSend(new MqMsg("smart_grp_yn", "t_testdata_c", null, tTestdataList));
284 284
                 }
285 285
                 if (tTestdataLayerArrayList.size() > 0) {
286 286
                     tTestdataLayerMapper.insertBatch(tTestdataLayerArrayList);
287
-                    rocketMqService.asyncSend(new MqMsg("smart_grp_yn", "t_testdata_layer_c", null, tTestdataLayerArrayList));
287
+//                    rocketMqService.asyncSend(new MqMsg("smart_grp_yn", "t_testdata_layer_c", null, tTestdataLayerArrayList));
288 288
                 }
289 289
                 if (tWarningThresholdHistorieList.size() > 0) {
290 290
                     tWarningThresholdHistoryMapper.insertBatch(tWarningThresholdHistorieList);
291
-                    rocketMqService.asyncSend(new MqMsg("smart_grp_yn", "t_warning_threshold_history_c", null, tWarningThresholdHistorieList));
291
+//                    rocketMqService.asyncSend(new MqMsg("smart_grp_yn", "t_warning_threshold_history_c", null, tWarningThresholdHistorieList));
292 292
                     List<TWarningThresholdHistory> collect = tWarningThresholdHistorieList.stream().filter(TWarningThresholdHistory -> TWarningThresholdHistory.getwWarning().equals("0")).collect(Collectors.toList());
293 293
                     boolean alarmDetails = resolutionToSendAlarmService.getAlarmDetails(collect);
294 294
                     if (!alarmDetails) {
@@ -296,7 +296,7 @@ public class GrainPushsServiceImpl implements GrainPushsService {
296 296
                             obj.setIsSend("2");
297 297
                             tWarningThresholdHistoryService.updateById(obj);
298 298
                         });
299
-                        rocketMqService.asyncSend(new MqMsg("smart_grp_yn", "t_warning_threshold_history_u", null, collect));
299
+//                        rocketMqService.asyncSend(new MqMsg("smart_grp_yn", "t_warning_threshold_history_u", null, collect));
300 300
                     }
301 301
                 }
302 302
             }

+ 8 - 4
depot-intelligent/src/main/java/com/chinaitop/depot/intelligent/rocketMQ/producerMQ/service/impl/RocketMqServiceImpl.java

@@ -1,6 +1,6 @@
1 1
 package com.chinaitop.depot.intelligent.rocketMQ.producerMQ.service.impl;
2 2
 
3
-import com.chinaitop.depot.intelligent.rocketMQ.producerMQ.model.MqMsg;
3
+/*import com.chinaitop.depot.intelligent.rocketMQ.producerMQ.model.MqMsg;
4 4
 import com.chinaitop.depot.intelligent.rocketMQ.producerMQ.service.RocketMqService;
5 5
 import lombok.extern.slf4j.Slf4j;
6 6
 import org.apache.rocketmq.client.producer.SendCallback;
@@ -9,26 +9,29 @@ import org.apache.rocketmq.spring.core.RocketMQTemplate;
9 9
 import org.springframework.stereotype.Service;
10 10
 import org.springframework.util.StringUtils;
11 11
 
12
-import javax.annotation.Resource;
12
+import javax.annotation.Resource;*/
13 13
 
14 14
 /**
15 15
  * @author qingsong.han
16 16
  * @description:
17 17
  * @create 2022-03-23 14:09
18 18
  */
19
+/*
19 20
 @Slf4j
20 21
 @Service
21 22
 public class RocketMqServiceImpl implements RocketMqService {
22 23
     @Resource
23 24
     private RocketMQTemplate rocketMQTemplate;
24 25
 
25
-    /**
26
+    */
27
+/**
26 28
      * topic: smart_grp_yn
27 29
      * tags:
28 30
      *  测温: yn_cw
29 31
      *
30 32
      * @param mqMsg 发送消息实体类
31
-     */
33
+     *//*
34
+
32 35
     @Override
33 36
     public void asyncSend(MqMsg mqMsg) {
34 37
         log.info("asyncSend发送消息到mqMsg: {}", mqMsg);
@@ -51,3 +54,4 @@ public class RocketMqServiceImpl implements RocketMqService {
51 54
         );
52 55
     }
53 56
 }
57
+*/

+ 9 - 9
depot-intelligent/src/main/resources/bootstrap.yml

@@ -20,7 +20,7 @@ spring:
20 20
   # 数据库配置
21 21
   datasource:
22 22
     driver-class-name: com.mysql.cj.jdbc.Driver
23
-    url: jdbc:mysql://localhost:3306/depot_yunnan?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=UTC
23
+    url: jdbc:mysql://localhost:3306/depot?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=UTC
24 24
     username: root
25 25
     password: 123456
26 26
   # 缓存配置
@@ -68,14 +68,14 @@ num_version3: :20013
68 68
 cxf:
69 69
   path: /intelligent
70 70
 
71
-rocketmq:
72
-  # master
73
-  name-server: 172.16.4.16:9876;172.16.4.17:9876
74
-  producer:
75
-    group: depot_yn_group
76
-    send-message-timeout: 2000
77
-    retry-times-when-send-async-failed: 5
78
-    retry-times-when-send-failed: 5
71
+#rocketmq:
72
+#  # master
73
+#  name-server: 172.16.0.8:9876;172.16.0.10:9876
74
+#  producer:
75
+#    group: depot_yn_group
76
+#    send-message-timeout: 2000
77
+#    retry-times-when-send-async-failed: 5
78
+#    retry-times-when-send-failed: 5
79 79
 # sql 打印
80 80
 #logging:
81 81
 #  level: