我使用Spring使用带有IBM MQ jars配置的工作JMS 应用程序
它适用于正确的队列信息,但是当我提供错误的队列信息时
它挂在
LOG.info("SENDING MESSAGE");
jmsTemplate.send(this.getDestination(), messageCreator ); //here
我有我的日志说正在发送消息,我正在处理 org.springframework.jmsexception ,但它没有抛出......我认为它在那时挂起。
我无法为发送超时找到 jmstemplate 的任何属性,仅用于接收超时...
这是app-context.xml (Spring)中的jmstemplate conf
<bean id="jmsTemplate" class="org.springframework.jms.core.JmsTemplate102">
<property name="connectionFactory">
<ref bean="jmsQueueConnectionFactory" />
</property>
<property name="destinationResolver">
<ref bean="jmsDestinationResolver" />
</property>
<property name="pubSubDomain">
<value>false</value>
</property>
<property name="receiveTimeout">
<value>20000</value>
</property>
和ibm mq 配置-
<bean id="mqConnectionFactory" class="com.ibm.mq.jms.MQQueueConnectionFactory">
<property name="hostName">
<value>${queue_hostname}</value>
</property>
<property name="port">
<value>${queue_port}</value>
</property>
<property name="queueManager">
<value>${queue_manager}</value>
</property>
<property name="channel">
<value>${queue_channel}</value>
</property>
<property name="transportType">
<value>1</value>
</property>
</bean>
我已将其设置为自动确认
this.jmsTemplate.setSessionAcknowledgeMode(Session.AUTO_ACKNOWLEDGE);
所以请告诉我如何在发送消息时超时以抛出jmsexception。