Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
smart_gov_platform
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
赵啸非
smart_gov_platform
Commits
6fc5fc3a
Commit
6fc5fc3a
authored
Aug 23, 2022
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
网关日志添加
parent
b74ca08a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
1 deletion
+10
-1
common-lib/src/main/java/com/mortals/xhx/module/MessageProducer.java
...src/main/java/com/mortals/xhx/module/MessageProducer.java
+10
-1
No files found.
common-lib/src/main/java/com/mortals/xhx/module/MessageProducer.java
View file @
6fc5fc3a
...
@@ -3,18 +3,27 @@ package com.mortals.xhx.module;
...
@@ -3,18 +3,27 @@ package com.mortals.xhx.module;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.mortals.xhx.common.keys.QueueKey
;
import
com.mortals.xhx.common.keys.QueueKey
;
import
com.mortals.xhx.common.pdu.access.AccessLogPdu
;
import
com.mortals.xhx.common.pdu.access.AccessLogPdu
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.amqp.rabbit.core.RabbitTemplate
;
import
org.springframework.amqp.rabbit.core.RabbitTemplate
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
org.springframework.util.ObjectUtils
;
@Component
@Component
@Slf4j
public
class
MessageProducer
{
public
class
MessageProducer
{
@Autowired
@Autowired
private
RabbitTemplate
rabbitTemplate
;
private
RabbitTemplate
rabbitTemplate
;
public
void
syncAccessSend
(
AccessLogPdu
accessLogPdu
)
{
public
void
syncAccessSend
(
AccessLogPdu
accessLogPdu
)
{
if
(!
ObjectUtils
.
isEmpty
(
accessLogPdu
))
{
if
(
log
.
isDebugEnabled
())
{
log
.
debug
(
"accessLog==>{}"
,
JSON
.
toJSONString
(
accessLogPdu
));
}
rabbitTemplate
.
convertAndSend
(
QueueKey
.
EXCHANGE
,
QueueKey
.
ACCESS_LOG_QUEUE
,
JSON
.
toJSONString
(
accessLogPdu
));
rabbitTemplate
.
convertAndSend
(
QueueKey
.
EXCHANGE
,
QueueKey
.
ACCESS_LOG_QUEUE
,
JSON
.
toJSONString
(
accessLogPdu
));
}
}
}
}
}
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