Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spring配置共享订阅者方式中的问题 #118

Open
songshaopu opened this issue Nov 20, 2015 · 0 comments
Open

Spring配置共享订阅者方式中的问题 #118

songshaopu opened this issue Nov 20, 2015 · 0 comments

Comments

@songshaopu
Copy link

对于共享订阅者配置方式,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)会调用不到。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant