|
14 | 14 | import org.springframework.amqp.support.converter.MessageConverter;
|
15 | 15 | import org.springframework.beans.factory.InitializingBean;
|
16 | 16 | import org.springframework.beans.factory.config.BeanFactoryPostProcessor;
|
17 |
| -import org.springframework.beans.factory.config.BeanPostProcessor; |
18 | 17 | import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
|
19 | 18 | import org.springframework.boot.autoconfigure.amqp.AbstractRabbitListenerContainerFactoryConfigurer;
|
20 | 19 | import org.springframework.boot.autoconfigure.amqp.MultiRabbitConstants;
|
|
28 | 27 | import org.springframework.context.EnvironmentAware;
|
29 | 28 | import org.springframework.context.annotation.Bean;
|
30 | 29 | import org.springframework.context.annotation.Configuration;
|
31 |
| -import org.springframework.context.annotation.DependsOn; |
32 | 30 | import org.springframework.core.env.Environment;
|
33 | 31 |
|
34 | 32 | import java.util.Map;
|
@@ -58,12 +56,6 @@ public MultiRabbitDeclareBeanFactoryPostProcessor multiRabbitDeclareBeanFactoryP
|
58 | 56 | return new MultiRabbitDeclareBeanFactoryPostProcessor();
|
59 | 57 | }
|
60 | 58 |
|
61 |
| - @DependsOn(MultiRabbitConstants.CONNECTION_FACTORY_BEAN_NAME) |
62 |
| - @Bean |
63 |
| - public MultiRabbitContainerBeanPostProcessor multiRabbitContainerBeanPostProcessor() { |
64 |
| - return new MultiRabbitContainerBeanPostProcessor(); |
65 |
| - } |
66 |
| - |
67 | 59 | /**
|
68 | 60 | * RabbitMQ ContainerFactory 配置
|
69 | 61 | * 提供对 MultiRabbit 支持
|
@@ -193,14 +185,4 @@ public String getAdm
7F58
inBeanName(String connectionName) {
|
193 | 185 | return connectionName + MultiRabbitConstants.RABBIT_ADMIN_SUFFIX;
|
194 | 186 | }
|
195 | 187 | }
|
196 |
| - |
197 |
| - /** |
198 |
| - * spring-multirabbit |
199 |
| - * RabbitListener 注解指定 containerFactory 时,由于 multiRabbitConnectionFactory 未加载 |
200 |
| - * 导致 getBean 获取对应 RabbitAdmin 实例失败 |
201 |
| - * 此处使用 @DependsOn 使 multiRabbitConnectionFactory 提前加载 |
202 |
| - */ |
203 |
| - public static class MultiRabbitContainerBeanPostProcessor implements BeanPostProcessor { |
204 |
| - |
205 |
| - } |
206 | 188 | }
|
0 commit comments