factory.setNetworkRecoveryInterval(this.networkRecoveryInterval);
connFactory.setAutomaticRecoveryEnabled(true); connFactory.setRequestedHeartbeat(CloudBusGlobalProperty.RABBITMQ_HEART_BEAT_TIMEOUT); connFactory.setNetworkRecoveryInterval((int) TimeUnit.SECONDS.toMillis(CloudBusGlobalProperty.RABBITMQ_NETWORK_RECOVER_INTERVAL)); connFactory.setConnectionTimeout((int) TimeUnit.SECONDS.toMillis(CloudBusGlobalProperty.RABBITMQ_CONNECTION_TIMEOUT));
connectionFactory.setNetworkRecoveryInterval( Integer.valueOf(configMap.get(RABBITMQ_CONFIG_KEY_NETWORK_RECOVERY_INTERVAL).toString()));
try { int serverRetryInterval = Integer.parseInt(serverRetryIntervalS); connectionFactory.setNetworkRecoveryInterval(serverRetryInterval); } catch (NumberFormatException e) { log.warn("Number format error in reading server retry interval value. Proceeding with default value", e);
this.factory.setAutomaticRecoveryEnabled(true); this.factory.setTopologyRecoveryEnabled(true); this.factory.setNetworkRecoveryInterval(5000); if (username != null) this.factory.setUsername(username); if (password != null) this.factory.setPassword(password);
private static Connection newConnection(RabbitMQOptions config) throws IOException, TimeoutException { ConnectionFactory cf = new ConnectionFactory(); String uri = config.getUri(); // Use uri if set, otherwise support individual connection parameters List<Address> addresses = null; if (uri != null) { try { cf.setUri(uri); } catch (Exception e) { throw new IllegalArgumentException("Invalid rabbitmq connection uri " + uri); } } else { cf.setUsername(config.getUser()); cf.setPassword(config.getPassword()); addresses = config.getAddresses().isEmpty() ? Collections.singletonList(new Address(config.getHost(), config.getPort())) : config.getAddresses(); cf.setVirtualHost(config.getVirtualHost()); } cf.setConnectionTimeout(config.getConnectionTimeout()); cf.setRequestedHeartbeat(config.getRequestedHeartbeat()); cf.setHandshakeTimeout(config.getHandshakeTimeout()); cf.setRequestedChannelMax(config.getRequestedChannelMax()); cf.setNetworkRecoveryInterval(config.getNetworkRecoveryInterval()); cf.setAutomaticRecoveryEnabled(config.isAutomaticRecoveryEnabled()); //TODO: Support other configurations return addresses == null ? cf.newConnection() : cf.newConnection(addresses); }
factory.setPort(this.getFetcherQConf().getPort()); factory.setAutomaticRecoveryEnabled(true); factory.setNetworkRecoveryInterval(5000);
factory.setNetworkRecoveryInterval(endpoint.getNetworkRecoveryInterval());
connectionFactory.setMetricsCollector(rabbitMQConfiguration.getMetricsCollector()); connectionFactory.setHost(rabbitMQConfiguration.getHost()); connectionFactory.setNetworkRecoveryInterval(rabbitMQConfiguration.getNetworkRecoveryInterval()); if(rabbitMQConfiguration.isNio()) { connectionFactory.useNio();