Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
log-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
赵啸非
log-platform
Commits
8aae94d2
Commit
8aae94d2
authored
Sep 27, 2022
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
业务日志添加
parent
80503362
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
1 deletion
+16
-1
log-manager/src/main/java/com/mortals/xhx/base/framework/config/RabbitConfig.java
...a/com/mortals/xhx/base/framework/config/RabbitConfig.java
+15
-0
log-manager/src/main/java/com/mortals/xhx/base/framework/listener/OperateMessageConsumerListener.java
...se/framework/listener/OperateMessageConsumerListener.java
+1
-1
No files found.
log-manager/src/main/java/com/mortals/xhx/base/framework/config/RabbitConfig.java
View file @
8aae94d2
...
...
@@ -111,6 +111,21 @@ public class RabbitConfig {
return
factory
;
}
@Bean
(
name
=
"consumerContainerFactory"
)
public
SimpleRabbitListenerContainerFactory
consumerContainerFactory
(
SimpleRabbitListenerContainerFactoryConfigurer
configurer
,
ConnectionFactory
connectionFactory
)
{
// 创建 SimpleRabbitListenerContainerFactory 对象
SimpleRabbitListenerContainerFactory
factory
=
new
SimpleRabbitListenerContainerFactory
();
factory
.
setAfterReceivePostProcessors
(
m
->
{
m
.
getMessageProperties
().
setContentType
(
"application/json"
);
return
m
;
});
configurer
.
configure
(
factory
,
connectionFactory
);
return
factory
;
}
//修改系列和与反序列化转换器
@Bean
public
MessageConverter
messageConverter
()
{
...
...
log-manager/src/main/java/com/mortals/xhx/base/framework/listener/OperateMessageConsumerListener.java
View file @
8aae94d2
...
...
@@ -34,7 +34,7 @@ import java.util.stream.Collectors;
**/
@Slf4j
@Component
@RabbitListener
(
queues
=
QueueKey
.
OPERATION_LOG_QUEUE
)
@RabbitListener
(
queues
=
QueueKey
.
OPERATION_LOG_QUEUE
,
containerFactory
=
"consumerContainerFactory"
)
//@RabbitListener(queues = QueueKey.OPERATION_LOG_QUEUE,
// containerFactory = "consumerBatchContainerFactory")
public
class
OperateMessageConsumerListener
{
...
...
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