当前位置:网站首页>Only one ConfirmCallback is supported by each RabbitTemplate 解决办法
Only one ConfirmCallback is supported by each RabbitTemplate 解决办法
2022-06-27 09:24:00 【Sparkle_wsl】
Only one ConfirmCallback is supported by each RabbitTemplate 解决办法
错误原因:
spring中Bean默认是使用的的单列模式,不巧的是RabbitTemplate 只能设置一个ConfirmCallback,所以造成了上诉的BUG
解决办法:
RabbitTemplate 设置成多列模式
@Bean
@Scope("prototype")
public RabbitTemplate rabbitTemplate(ConnectionFactory connectionFactory) {
RabbitTemplate template = new RabbitTemplate(connectionFactory);
template.setMandatory(true);
template.setMessageConverter(new SerializerMessageConverter());
return template;
}
边栏推荐
- Digital ic-1.9 understands the coding routine of state machine in communication protocol
- Source insight 工具安装及使用方法
- That is, a one-stop live broadcast service with "smooth live broadcast" and full link upgrade
- ucore lab4
- Rman-08137 main library failed to delete archive file
- 【mysql篇-基础篇】通用语法1
- 力扣84柱状图中最大的矩形
- A classic interview question covering 4 hot topics
- [original] typescript string UTF-8 encoding and decoding
- 2022.6.26-----leetcode. seven hundred and ten
猜你喜欢
我大抵是卷上瘾了,横竖睡不着!竟让一个Bug,搞我两次!
不容置疑,这是一个绝对精心制作的项目
Win10 add right-click menu for any file
Preliminary understanding of pytorch
力扣84柱状图中最大的矩形
Rockermq message sending and consumption mode
Some exercises about binary tree
I'm almost addicted to it. I can't sleep! Let a bug fuck me twice!
1098 insertion or heap sort (PAT class a)
I'm almost addicted to it. I can't sleep! Let a bug fuck me twice!
随机推荐
CLassLoader
E+h secondary meter repair pH transmitter secondary display repair cpm253-mr0005
Design of a solar charge pump power supply circuit
orthofinder直系同源蛋白分析及结果处理
Brief introduction to SSL encryption process
Introduction to websocket protocol
Imx8qxp DMA resources and usage (unfinished)
The most direct manifestation of memory leak
Design of multiple classes
ucore lab3
数据类型占内存大小?LongVsObject
ucore lab5
i=i++;
VIM from dislike to dependence (19) -- substitution
1098 insertion or heap sort (PAT class a)
June 26, 2022 (LC 6100 counts the number of ways to place houses)
JS 文件上传下载
巴基斯坦安全部队开展反恐行动 打死7名恐怖分子
[MySQL basic] general syntax 1
Pakistani security forces killed 7 terrorists in anti-terrorism operation