Reconnect - 6.2

Talend ESB Service Developer Guide

Talend Data Fabric
Talend Data Services Platform
Talend ESB
Talend MDM Platform
Talend Open Studio for ESB
Talend Real-Time Big Data Platform
Design and Development
Installation and Upgrade
Talend ESB

If the connection with a JMS broker is interrupted, the client and the server have to restore the connection.

This functionality is provided by CXF, which is included in Talend ESB, in the MessageContainerListener. The listener checks the connection, reports warning if the connection is broken and restores the connection if possible.

When using Connection Pooling, broken connections are not automatically removed from the pool. The solution is to set short expire timeout for connections in pool:

import org.apache.activemq.ActiveMQConnectionFactory;
import org.apache.activemq.pool.PooledConnectionFactory;

ConnectionFactory cf = new ActiveMQConnectionFactory("tcp://localhost:61616");
PooledConnectionFactory pcf = new PooledConnectionFactory();
pcf.setExpiryTimeout(5000); // Make sure to set expiry timeout as the default of 0 prevents reconnect on failures

JMSConfiguration jmsConfig = new JMSConfiguration();