Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
asset-distribution
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
data-spider
asset-distribution
Commits
fc576e5a
Commit
fc576e5a
authored
Jul 30, 2019
by
data-爬虫-任锋
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mq消息接收添加日志
parent
18e86113
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
ConsumerConfig.java
...up/asset/distribution/config/rabbitmq/ConsumerConfig.java
+5
-2
No files found.
src/main/java/com/quantgroup/asset/distribution/config/rabbitmq/ConsumerConfig.java
View file @
fc576e5a
...
@@ -2,6 +2,7 @@ package com.quantgroup.asset.distribution.config.rabbitmq;
...
@@ -2,6 +2,7 @@ package com.quantgroup.asset.distribution.config.rabbitmq;
import
cn.quantgroup.tech.brave.service.ITechRabbitBuilder
;
import
cn.quantgroup.tech.brave.service.ITechRabbitBuilder
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.google.common.base.Stopwatch
;
import
com.quantgroup.asset.distribution.enums.funding.FundingResult
;
import
com.quantgroup.asset.distribution.enums.funding.FundingResult
;
import
com.quantgroup.asset.distribution.service.funding.IAidFundRouteRecordService
;
import
com.quantgroup.asset.distribution.service.funding.IAidFundRouteRecordService
;
import
com.rabbitmq.client.Channel
;
import
com.rabbitmq.client.Channel
;
...
@@ -21,6 +22,7 @@ import org.springframework.messaging.handler.annotation.support.DefaultMessageHa
...
@@ -21,6 +22,7 @@ import org.springframework.messaging.handler.annotation.support.DefaultMessageHa
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.util.concurrent.TimeUnit
;
@Slf4j
@Slf4j
@Configuration
@Configuration
...
@@ -61,16 +63,17 @@ public class ConsumerConfig implements RabbitListenerConfigurer {
...
@@ -61,16 +63,17 @@ public class ConsumerConfig implements RabbitListenerConfigurer {
public
void
process
(
Message
message
,
Channel
channel
)
throws
IOException
{
public
void
process
(
Message
message
,
Channel
channel
)
throws
IOException
{
String
ms
=
null
;
String
ms
=
null
;
try
{
try
{
Stopwatch
stopwatch
=
Stopwatch
.
createStarted
();
ms
=
new
String
(
message
.
getBody
(),
"utf-8"
);
ms
=
new
String
(
message
.
getBody
(),
"utf-8"
);
log
.
info
(
"助贷资金路由结果消息接收, 消息内容 : {} "
,
ms
);
JSONObject
jo
=
JSONObject
.
parseObject
(
ms
);
JSONObject
jo
=
JSONObject
.
parseObject
(
ms
);
String
noticeType
=
jo
.
getString
(
"noticeType"
);
String
noticeType
=
jo
.
getString
(
"noticeType"
);
if
(
FundingResult
.
REJECT
.
getCode
().
equals
(
noticeType
)
if
(
FundingResult
.
REJECT
.
getCode
().
equals
(
noticeType
)
||
FundingResult
.
CANCEL_LOAN
.
getCode
().
equals
(
noticeType
)
||
FundingResult
.
CANCEL_LOAN
.
getCode
().
equals
(
noticeType
)
||
FundingResult
.
FUAD_ASSIGN_SUCC
.
getCode
().
equals
(
noticeType
)){
||
FundingResult
.
FUAD_ASSIGN_SUCC
.
getCode
().
equals
(
noticeType
)){
log
.
info
(
"助贷资金路由有效MQ消息接收, 消息内容 : {} "
,
ms
);
String
applyNo
=
jo
.
getJSONObject
(
"data"
).
getString
(
"applyNo"
);
String
applyNo
=
jo
.
getJSONObject
(
"data"
).
getString
(
"applyNo"
);
iAidFundRouteRecordService
.
fundingResultNotity
(
applyNo
,
FundingResult
.
getAuditResultByDesc
(
noticeType
));
iAidFundRouteRecordService
.
fundingResultNotity
(
applyNo
,
FundingResult
.
getAuditResultByDesc
(
noticeType
));
log
.
info
(
"助贷资金路由
结果消息处理完毕, bizNo : {} ,noticeType : {} "
,
applyNo
,
noticeType
);
log
.
info
(
"助贷资金路由
有效MQ消息处理结束, bizNo : {} ,noticeType : {} , 耗时 : {} "
,
applyNo
,
noticeType
,
stopwatch
.
stop
().
elapsed
(
TimeUnit
.
MILLISECONDS
)
);
}
}
// 采用手动应答模式, 手动确认应答更为安全稳定
// 采用手动应答模式, 手动确认应答更为安全稳定
channel
.
basicAck
(
message
.
getMessageProperties
().
getDeliveryTag
(),
true
);
channel
.
basicAck
(
message
.
getMessageProperties
().
getDeliveryTag
(),
true
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment