我想關閉Spring ApplicationContext以避免「資源泄漏:」上下文「永遠不會關閉」警告。但是當我關閉它時,DefaultJMSListenerContainer也被關閉。因此我不能再收到任何消息。我的問題是我可以關閉ApplicationContext,但離開JMSListenerContainer活?如何關閉Spring ApplicationContext,但不要停止JMS Listener以避免「資源泄漏:」上下文「永遠不會關閉」?
的JMSListenerContainer是象下面這樣:
<bean id="jmsContainer" class="org.springframework.jms.listener.DefaultMessageListenerContainer">
<property name="connectionFactory" ref="jmsConnectionFactory" />
<property name="destination" ref="topicDestination" />
<property name="messageListener" ref="clientMessageListener" />
</bean>
與JMSListenerContainer配置,你可以更新的問題? – Evgeny
@Evgeny我添加了JmsListenerContainer,你可以參考它並給我建議。如果我不調用AbstractApplicationContext的close方法,MessageContainer可以工作。但是如果我調用它,MessageListenerContainer也會被關閉。 – Linhoo