8000 fix: 解决同名队列和交换机声明多个绑定时 bean 冲突 · cadecode/uni-boot-cloud@d0002da · GitHub
[go: up one dir, main page]

Skip to content

Commit d0002da

Browse files
committed
fix: 解决同名队列和交换机声明多个绑定时 bean 冲突
1 parent a7c3dba commit d0002da

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

common/plugin/mq/src/main/java/com/github/cadecode/uniboot/common/plugin/mq/config/RabbitAutoConfig.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,8 @@ public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory)
168168
}
169169
Binding binding = new Binding(bindName, o.getBindType(), o.getExchangeName(), o.getRoutingKey(), o.getArguments());
170170
binding.setAdminsThatShouldDeclare(getAdminBeanName(connectionName));
171-
String beanName = geneDeclareBeanName(connectionName, o.getBindName() + "-" + o.getExchangeName());
171+
String declareName = o.getBindName() + "-" + o.getBindType() + "-" + o.getExchangeName() + "-" + o.getRoutingKey();
172+
String beanName = geneDeclareBeanName(connectionName, declareName);
172173
beanFactory.registerSingleton(beanName, binding);
173174
log.info("Rabbit auto register binding, connection:{}, bind {} to {}, bindType:{}, {}", connectionName, o.getBindName(),
174175
o.getExchangeName(), o.getBindType(), o);

0 commit comments

Comments
 (0)
0