ActiveMq 超时时间设置
嘉嘉同学 2017-03-03 04:11:27 最近刚在学ActiveMq,同步接收消息消费者不可能无限等待,要设置个接收时间,比如30S,一旦超过这个时间可以做些处理,比如抛出通讯异常之类的,但是不太知道如何设置。
在jms.xml中配置如下,但是貌似这个时间没有用,时间到后消费者仍在等待。
请教下这个如何设置??
<bean id="jmsContainer"
class="org.springframework.jms.listener.DefaultMessageListenerContainer">
<property name="connectionFactory" ref="connectionFactory" />
<property name="destination" ref="myDestination" />
<property name="messageListener" ref="serverMessageListener" />
<property name="receiveTimeout" value="10000"/>
</bean>