We are experiencing this same issue. Actually to be exact it seems that sometimes when an mq queue becomes unable, the connection IS re-established, but other times it is not. it seems that when the entire queuemanager is bounced the connection is re-established but when the manager is bounced by operations with a nightly script (haven't root-caused the difference) we do NOT reconnect.
ARe others experiencing this? Is there some configuration we can change?
We are using jmstempate for sending like this:
Code:
//snippets
// spring bean.. see below config
public class JmsDistributionPoint implements DistributionPoint {
private final JmsTemplate jmsTemplate;
private final String queueName;
@Override
public void send(final Message outboundMessage) {
final String messageXml = converter.getConvertedPayload(outboundMessage);
jmsTemplate.send(queueName,
new MessageCreator() {
@Override
public Message createMessage(Session session) throws JMSException {
TextMessage message = session.createTextMessage();
return makeTextMessage(message , outboundMessage, messageXml);
}
});
}
application-context:
Code:
// NB: 'xxx' simply obscuring company details
<bean id="xxx_DP_ONE" class="com.[xxx].model.configuration.distribution.JmsDistributionPoint">
<constructor-arg value="${xxx.queue.name}"/>
<constructor-arg ref ="xxxConnectionFactory"/>
</bean>
<bean id="[xxx]ConnectionFactory"
class="org.springframework.jms.connection.CachingConnectionFactory">
<property name="targetConnectionFactory" ref="xxxConnectionFactoryImpl"/>
<property name="sessionCacheSize" value="1"/>
</bean>
<bean id="xxxConnectionFactoryImpl" class="com.ibm.mq.jms.MQQueueConnectionFactory">
<property name="transportType" ref="transportTypeConst"/>
<property name="queueManager" value="${xxx.queue.manager}"/>
<property name="hostName" value="${xxx.queue.host}"/>
<property name="port" value="${xxx.queue.port}"/>
<property name="channel" value="${xxx.queue.channel}"/>
</bean>