Not able to Stop MQueue listener

前端 未结 1 970
太阳男子
太阳男子 2020-12-20 06:10

I have the following configuration for my MQueue:



        
相关标签:
1条回答
  • 2020-12-20 06:53

    I actually had to set autoStartup to true.

    Since I can't do that using jms:listener-container, I instanciated a DefaultMessageListenerContainer bean and set the autoStartup property to false.

    Here's the code that worked for me :

    <bean class="org.springframework.jms.listener.DefaultMessageListenerContainer"  id="pitagorCPYListener">
        <property name="autoStartup" value="false" />
        <property name="connectionFactory" ref="cachedConnectionFactory" />
        <property name="destination" ref="defaultDestination" />
        <property name="messageListener" ref="listenerPitagorCPY" />
    </bean>
    
     <bean id="defaultDestination" class="com.ibm.mq.jms.MQQueue">
        <constructor-arg value="#{mqConnectionFactory.destination}"/>
      </bean>
    
    0 讨论(0)
提交回复
热议问题