Spring配置共享订阅者方式中的问题
Opened this issue · 0 comments
songshaopu commented
对于共享订阅者配置方式,messageConsumer没有被创建
<!-- listener container to subscribe topics -->
<bean id ="listenerContainer" class="com.taobao.metamorphosis.client.extension.spring.MessageListenerContainer">
<property name="messageSessionFactory" ref="sessionFactory"/>
<property name="messageBodyConverter" ref="messageBodyConverter"/>
<property name="shareConsumer" value="true"/>
<property name="defaultTopic" ref="dateTopic"/>
<property name="defaultMessageListener" ref="messageListener"/>
</bean>
MessageListenerContainer 类
public void afterPropertiesSet() throws Exception {
log.info("Start to initialize message listener container.");
if (this.subscribers != null) {
Set<MessageConsumer> consumers = new HashSet<MessageConsumer>();
for (Map.Entry<MetaqTopic, ? extends DefaultMessageListener<?>> entry : this.subscribers.entrySet() /*没有元素*/) {
//....
this.subscribers.entrySet() 中没有添加元素,getMessageConsumer(topic)
会调用不到。