@@ -83,8 +83,6 @@ public class Config implements Serializable
8383
8484 private final SecuritySettings securitySettings ;
8585
86- private final int routingFailureLimit ;
87- private final long routingRetryDelayMillis ;
8886 private final long fetchSize ;
8987 private final long routingTablePurgeDelayMillis ;
9088
@@ -109,8 +107,6 @@ private Config( ConfigBuilder builder )
109107
110108 this .securitySettings = builder .securitySettingsBuilder .build ();
111109
112- this .routingFailureLimit = builder .routingFailureLimit ;
113- this .routingRetryDelayMillis = builder .routingRetryDelayMillis ;
114110 this .connectionTimeoutMillis = builder .connectionTimeoutMillis ;
115111 this .routingTablePurgeDelayMillis = builder .routingTablePurgeDelayMillis ;
116112 this .retrySettings = builder .retrySettings ;
@@ -233,7 +229,7 @@ SecuritySettings securitySettings()
233229
234230 RoutingSettings routingSettings ()
235231 {
236- return new RoutingSettings ( routingFailureLimit , routingRetryDelayMillis , routingTablePurgeDelayMillis );
232+ return new RoutingSettings ( routingTablePurgeDelayMillis );
237233 }
238234
239235 RetrySettings retrySettings ()
@@ -280,8 +276,6 @@ public static class ConfigBuilder
280276 private long connectionAcquisitionTimeoutMillis = PoolSettings .DEFAULT_CONNECTION_ACQUISITION_TIMEOUT ;
281277 private String userAgent = format ( "neo4j-java/%s" , driverVersion () );
282278 private final SecuritySettings .SecuritySettingsBuilder securitySettingsBuilder = new SecuritySettings .SecuritySettingsBuilder ();
283- private int routingFailureLimit = RoutingSettings .DEFAULT .maxRoutingFailures ();
284- private long routingRetryDelayMillis = RoutingSettings .DEFAULT .retryTimeoutDelay ();
285279 private long routingTablePurgeDelayMillis = RoutingSettings .DEFAULT .routingTablePurgeDelayMs ();
286280 private int connectionTimeoutMillis = (int ) TimeUnit .SECONDS .toMillis ( 30 );
287281 private RetrySettings retrySettings = RetrySettings .DEFAULT ;
@@ -487,86 +481,6 @@ public ConfigBuilder withTrustStrategy( TrustStrategy trustStrategy )
487481 return this ;
488482 }
489483
490- /**
491- * Specify how many times the client should attempt to reconnect to the routing servers before declaring the
492- * cluster unavailable.
493- * <p>
494- * The routing servers are tried in order. If connecting any of them fails, they are all retried after
495- * {@linkplain #withRoutingRetryDelay a delay}. This process of retrying all servers is then repeated for the
496- * number of times specified here before considering the cluster unavailable.
497- * <p>
498- * The default value of this parameter is {@code 1}, which means that the the driver will not re-attempt to
499- * connect to the cluster when connecting has failed to each individual server in the list of routers. This
500- * default value is sensible under this assumption that if the attempt to connect fails for all servers, then
501- * the entire cluster is down, or the client is disconnected from the network, and retrying to connect will
502- * not bring it back up, in which case it is better to report the failure sooner.
503- *
504- * @param routingFailureLimit
505- * the number of times to retry each server in the list of routing servers
506- * @return this builder
507- * @deprecated in 1.2 because driver memorizes seed URI used during construction and falls back to it at
508- * runtime when all other known router servers failed to respond. Driver is also able to perform DNS lookup
509- * for the seed URI during rediscovery. This means updates of cluster members will be picked up if they are
510- * reflected in a DNS record. This configuration allowed driver to retry rediscovery procedure and postpone
511- * failure. Currently there exists a better way of doing retries via
512- * {@link Session#readTransaction(TransactionWork)} and {@link Session#writeTransaction(TransactionWork)}.
513- * <b>Method will be removed in the next major release.</b>
514- */
515- @ Deprecated
516- public ConfigBuilder withRoutingFailureLimit ( int routingFailureLimit )
517- {
518- if ( routingFailureLimit < 1 )
519- {
520- throw new IllegalArgumentException (
521- "The failure limit may not be smaller than 1, but was: " + routingFailureLimit );
522- }
523- this .routingFailureLimit = routingFailureLimit ;
524- return this ;
525- }
526-
527- /**
528- * Specify how long to wait before retrying to connect to a routing server.
529- * <p>
530- * When connecting to all routing servers fail, connecting will be retried after the delay specified here.
531- * The delay is measured from when the first attempt to connect was made, so that the delay time specifies a
532- * retry interval.
533- * <p>
534- * For each {@linkplain #withRoutingFailureLimit retry attempt} the delay time will be doubled. The time
535- * specified here is the base time, i.e. the time to wait before the first retry. If that attempt (on all
536- * servers) also fails, the delay before the next retry will be double the time specified here, and the next
537- * attempt after that will be double that, et.c. So if, for example, the delay specified here is
538- * {@code 5 SECONDS}, then after attempting to connect to each server fails reconnecting will be attempted
539- * 5 seconds after the first connection attempt to the first server. If that attempt also fails to connect to
540- * all servers, the next attempt will start 10 seconds after the second attempt started.
541- * <p>
542- * The default value of this parameter is {@code 5 SECONDS}.
543- *
544- * @param delay
545- * the amount of time between attempts to reconnect to the same server
546- * @param unit
547- * the unit in which the duration is given
548- * @return this builder
549- * @deprecated in 1.2 because driver memorizes seed URI used during construction and falls back to it at
550- * runtime when all other known router servers failed to respond. Driver is also able to perform DNS lookup
551- * for the seed URI during rediscovery. This means updates of cluster members will be picked up if they are
552- * reflected in a DNS record. This configuration allowed driver to retry rediscovery procedure and postpone
553- * failure. Currently there exists a better way of doing retries via
554- * {@link Session#readTransaction(TransactionWork)} and {@link Session#writeTransaction(TransactionWork)}.
555- * <b>Method will be removed in the next major release.</b>
556- */
557- @ Deprecated
558- public ConfigBuilder withRoutingRetryDelay ( long delay , TimeUnit unit )
559- {
560- long routingRetryDelayMillis = unit .toMillis ( delay );
561- if ( routingRetryDelayMillis < 0 )
562- {
563- throw new IllegalArgumentException ( String .format (
564- "The retry delay may not be smaller than 0, but was %d %s." , delay , unit ) );
565- }
566- this .routingRetryDelayMillis = routingRetryDelayMillis ;
567- return this ;
568- }
569-
570484 /**
571485 * Specify how long to wait before purging stale routing tables.
572486 * <p>
0 commit comments