use of com.alibaba.otter.canal.client.impl.SimpleNodeAccessStrategy in project canal by alibaba.
the class CanalConnectors method newClusterConnector.
/**
* 创建带cluster模式的客户端链接,自动完成failover切换
*
* @param addresses
* @param destination
* @param username
* @param password
* @return
*/
public static CanalConnector newClusterConnector(List<? extends SocketAddress> addresses, String destination, String username, String password) {
ClusterCanalConnector canalConnector = new ClusterCanalConnector(username, password, destination, new SimpleNodeAccessStrategy(addresses));
canalConnector.setSoTimeout(60 * 1000);
canalConnector.setIdleTimeout(60 * 60 * 1000);
return canalConnector;
}
Aggregations