Authored by unknown

Merge branch 'redis_mq整改' into test6.3

@@ -82,6 +82,10 @@ @@ -82,6 +82,10 @@
82 <groupId>com.yoho.core</groupId> 82 <groupId>com.yoho.core</groupId>
83 <artifactId>yoho-core-redis-cluster</artifactId> 83 <artifactId>yoho-core-redis-cluster</artifactId>
84 </dependency> 84 </dependency>
  85 + <dependency>
  86 + <groupId>com.yoho.core</groupId>
  87 + <artifactId>yoho-core-rabbitmq</artifactId>
  88 + </dependency>
85 89
86 90
87 <!-- <dependency> 91 <!-- <dependency>
@@ -71,6 +71,10 @@ @@ -71,6 +71,10 @@
71 <artifactId>union-service-model</artifactId> 71 <artifactId>union-service-model</artifactId>
72 <version>1.2.6-SNAPSHOT</version> 72 <version>1.2.6-SNAPSHOT</version>
73 </dependency> 73 </dependency>
  74 + <dependency>
  75 + <groupId>com.yoho.core</groupId>
  76 + <artifactId>yoho-core-rabbitmq</artifactId>
  77 + </dependency>
74 </dependencies> 78 </dependencies>
75 79
76 <build> 80 <build>
@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON; @@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON;
4 import com.alibaba.fastjson.JSONArray; 4 import com.alibaba.fastjson.JSONArray;
5 import com.alibaba.fastjson.JSONObject; 5 import com.alibaba.fastjson.JSONObject;
6 import com.yoho.core.common.utils.MD5; 6 import com.yoho.core.common.utils.MD5;
  7 +import com.yoho.core.rabbitmq.YhConsumer;
7 import com.yoho.unions.dal.IArticleBlockDao; 8 import com.yoho.unions.dal.IArticleBlockDao;
8 import com.yoho.unions.dal.IArticleDAO; 9 import com.yoho.unions.dal.IArticleDAO;
9 import com.yoho.unions.dal.model.Article; 10 import com.yoho.unions.dal.model.Article;
@@ -27,7 +28,7 @@ import java.util.*; @@ -27,7 +28,7 @@ import java.util.*;
27 * Created by lenovo on 2017/6/15. 28 * Created by lenovo on 2017/6/15.
28 */ 29 */
29 @Component 30 @Component
30 -public class ArticlePushConsumer implements CommonMessageConsumer { 31 +public class ArticlePushConsumer implements YhConsumer {
31 32
32 private Logger logger = LoggerFactory.getLogger(ArticlePushConsumer.class); 33 private Logger logger = LoggerFactory.getLogger(ArticlePushConsumer.class);
33 34
@@ -53,10 +54,10 @@ public class ArticlePushConsumer implements CommonMessageConsumer { @@ -53,10 +54,10 @@ public class ArticlePushConsumer implements CommonMessageConsumer {
53 @Autowired 54 @Autowired
54 private IArticleBlockDao articleBlockDao; 55 private IArticleBlockDao articleBlockDao;
55 56
56 - @Override  
57 - public String getMessageTopic() {  
58 - return ARTICLE_PUSH_TOPIC;  
59 - } 57 +// @Override
  58 +// public String getMessageTopic() {
  59 +// return ARTICLE_PUSH_TOPIC;
  60 +// }
60 61
61 @Override 62 @Override
62 public void handleMessage(Object message) { 63 public void handleMessage(Object message) {
@@ -3,6 +3,7 @@ package com.yoho.unions.server.mqconsumer; @@ -3,6 +3,7 @@ package com.yoho.unions.server.mqconsumer;
3 import com.alibaba.fastjson.JSON; 3 import com.alibaba.fastjson.JSON;
4 import com.alibaba.fastjson.JSONObject; 4 import com.alibaba.fastjson.JSONObject;
5 import com.yoho.core.message.YhMessageConsumer; 5 import com.yoho.core.message.YhMessageConsumer;
  6 +import com.yoho.core.rabbitmq.YhConsumer;
6 import com.yoho.unions.common.utils.DateUtil; 7 import com.yoho.unions.common.utils.DateUtil;
7 import com.yoho.unions.dal.IUserOrdersDAO; 8 import com.yoho.unions.dal.IUserOrdersDAO;
8 import com.yoho.unions.dal.IUserOrdersRelationDAO; 9 import com.yoho.unions.dal.IUserOrdersRelationDAO;
@@ -23,11 +24,11 @@ import java.util.Map; @@ -23,11 +24,11 @@ import java.util.Map;
23 * Created by zhouxiang on 2016/11/4. 24 * Created by zhouxiang on 2016/11/4.
24 */ 25 */
25 @Component 26 @Component
26 -public class OrderPushConsumer implements CommonMessageConsumer { 27 +public class OrderPushConsumer implements YhConsumer {
27 28
28 private Logger logger = LoggerFactory.getLogger(OrderPushConsumer.class); 29 private Logger logger = LoggerFactory.getLogger(OrderPushConsumer.class);
29 30
30 - private final static String ORDER_PUSH_TOPIC = "union.order_push"; 31 +// private final static String ORDER_PUSH_TOPIC = "union.order_push";
31 32
32 @Autowired 33 @Autowired
33 IUserOrdersDAO userOrdersDAO; 34 IUserOrdersDAO userOrdersDAO;
@@ -35,10 +36,10 @@ public class OrderPushConsumer implements CommonMessageConsumer { @@ -35,10 +36,10 @@ public class OrderPushConsumer implements CommonMessageConsumer {
35 @Autowired 36 @Autowired
36 IUserOrdersRelationDAO userOrdersRelationDAO; 37 IUserOrdersRelationDAO userOrdersRelationDAO;
37 38
38 - @Override  
39 - public String getMessageTopic() {  
40 - return ORDER_PUSH_TOPIC;  
41 - } 39 +// @Override
  40 +// public String getMessageTopic() {
  41 +// return ORDER_PUSH_TOPIC;
  42 +// }
42 43
43 @Override 44 @Override
44 public void handleMessage(Object o) { 45 public void handleMessage(Object o) {
  1 +consumer:
  2 + - address: 192.168.102.45:5672
  3 +
  4 + consumers:
  5 + - class: com.yoho.unions.server.mqconsumer.ArticlePushConsumer
  6 + topic: guang.article_push
  7 +
  8 + - class: com.yoho.unions.server.mqconsumer.OrderPushConsumer
  9 + topic: union.order_push
  10 +
  11 +
  12 +
  13 +
  1 +consumer:
  2 + - address: ${rabbit_common_aws}
  3 + username: ${rabbit_common_aws_user}
  4 + password: ${rabbit_common_aws_password}
  5 + - address: ${rabbit_common_qq}
  6 + username: ${rabbit_common_qq_user}
  7 + password: ${rabbit_common_qq_password}
  8 + consumers:
  9 + - class: com.yoho.unions.server.mqconsumer.ArticlePushConsumer
  10 + topic: guang.article_push
  11 +
  12 + - class: com.yoho.unions.server.mqconsumer.OrderPushConsumer
  13 + topic: union.order_push
  14 +