Toggle navigation
Toggle navigation
This project
Loading...
Sign in
YOHOBUY
/
yohobuy-union
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
unknown
7 years ago
Commit
b920c8f39cf21072efea680b1719314636e4bd70
1 parent
5795a0f0
Mq迁移
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
48 additions
and
11 deletions
pom.xml
server/pom.xml
server/src/main/java/com/yoho/unions/server/mqconsumer/ArticlePushConsumer.java
server/src/main/java/com/yoho/unions/server/mqconsumer/OrderPushConsumer.java
web/src/main/resources/rabbitmq.yml
web/src/main/webapp/META-INF/autoconf/rabbitmq.yml
pom.xml
View file @
b920c8f
...
...
@@ -82,6 +82,10 @@
<groupId>
com.yoho.core
</groupId>
<artifactId>
yoho-core-redis-cluster
</artifactId>
</dependency>
<dependency>
<groupId>
com.yoho.core
</groupId>
<artifactId>
yoho-core-rabbitmq
</artifactId>
</dependency>
<!-- <dependency>
...
...
server/pom.xml
View file @
b920c8f
...
...
@@ -71,6 +71,10 @@
<artifactId>
union-service-model
</artifactId>
<version>
1.2.6-SNAPSHOT
</version>
</dependency>
<dependency>
<groupId>
com.yoho.core
</groupId>
<artifactId>
yoho-core-rabbitmq
</artifactId>
</dependency>
</dependencies>
<build>
...
...
server/src/main/java/com/yoho/unions/server/mqconsumer/ArticlePushConsumer.java
View file @
b920c8f
...
...
@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.yoho.core.common.utils.MD5
;
import
com.yoho.core.rabbitmq.YhConsumer
;
import
com.yoho.unions.dal.IArticleBlockDao
;
import
com.yoho.unions.dal.IArticleDAO
;
import
com.yoho.unions.dal.model.Article
;
...
...
@@ -27,7 +28,7 @@ import java.util.*;
* Created by lenovo on 2017/6/15.
*/
@Component
public
class
ArticlePushConsumer
implements
CommonMessage
Consumer
{
public
class
ArticlePushConsumer
implements
Yh
Consumer
{
private
Logger
logger
=
LoggerFactory
.
getLogger
(
ArticlePushConsumer
.
class
);
...
...
@@ -53,10 +54,10 @@ public class ArticlePushConsumer implements CommonMessageConsumer {
@Autowired
private
IArticleBlockDao
articleBlockDao
;
@Override
public
String
getMessageTopic
()
{
return
ARTICLE_PUSH_TOPIC
;
}
// @Override
// public String getMessageTopic() {
// return ARTICLE_PUSH_TOPIC;
// }
@Override
public
void
handleMessage
(
Object
message
)
{
...
...
server/src/main/java/com/yoho/unions/server/mqconsumer/OrderPushConsumer.java
View file @
b920c8f
...
...
@@ -3,6 +3,7 @@ package com.yoho.unions.server.mqconsumer;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.yoho.core.message.YhMessageConsumer
;
import
com.yoho.core.rabbitmq.YhConsumer
;
import
com.yoho.unions.common.utils.DateUtil
;
import
com.yoho.unions.dal.IUserOrdersDAO
;
import
com.yoho.unions.dal.IUserOrdersRelationDAO
;
...
...
@@ -23,11 +24,11 @@ import java.util.Map;
* Created by zhouxiang on 2016/11/4.
*/
@Component
public
class
OrderPushConsumer
implements
CommonMessage
Consumer
{
public
class
OrderPushConsumer
implements
Yh
Consumer
{
private
Logger
logger
=
LoggerFactory
.
getLogger
(
OrderPushConsumer
.
class
);
private
final
static
String
ORDER_PUSH_TOPIC
=
"union.order_push"
;
//
private final static String ORDER_PUSH_TOPIC = "union.order_push";
@Autowired
IUserOrdersDAO
userOrdersDAO
;
...
...
@@ -35,10 +36,10 @@ public class OrderPushConsumer implements CommonMessageConsumer {
@Autowired
IUserOrdersRelationDAO
userOrdersRelationDAO
;
@Override
public
String
getMessageTopic
()
{
return
ORDER_PUSH_TOPIC
;
}
// @Override
// public String getMessageTopic() {
// return ORDER_PUSH_TOPIC;
// }
@Override
public
void
handleMessage
(
Object
o
)
{
...
...
web/src/main/resources/rabbitmq.yml
0 → 100644
View file @
b920c8f
consumer
:
-
address
:
192.168.102.45:5672
consumers
:
-
class
:
com.yoho.unions.server.mqconsumer.ArticlePushConsumer
topic
:
guang.article_push
-
class
:
com.yoho.unions.server.mqconsumer.OrderPushConsumer
topic
:
union.order_push
...
...
web/src/main/webapp/META-INF/autoconf/rabbitmq.yml
0 → 100644
View file @
b920c8f
consumer
:
-
address
:
${rabbit_common_aws}
username
:
${rabbit_common_aws_user}
password
:
${rabbit_common_aws_password}
-
address
:
${rabbit_common_qq}
username
:
${rabbit_common_qq_user}
password
:
${rabbit_common_qq_password}
consumers
:
-
class
:
com.yoho.unions.server.mqconsumer.ArticlePushConsumer
topic
:
guang.article_push
-
class
:
com.yoho.unions.server.mqconsumer.OrderPushConsumer
topic
:
union.order_push
...
...
Please
register
or
login
to post a comment