From 78160aefef3e6fd1d06a73fb45948db806531ace Mon Sep 17 00:00:00 2001 From: lutovich Date: Fri, 24 Mar 2017 14:50:01 +0100 Subject: [PATCH] Deprecated old routing retry settings This commit deprecates `ConfigBuilder#withRoutingFailureLimit()` and `ConfigBuilder#withRoutingRetryDelay()` methods because they are now obsolete. They were initially introduced to postpone failure when no routers are available. Currently there exists a better way of doing this with transaction functions (`Session#readTransaction()` and `Session@writeTransaction()`). Driver also memorizes the seed URI and falls back to it during rediscovery when all other routers are dead. --- .../main/java/org/neo4j/driver/v1/Config.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/driver/src/main/java/org/neo4j/driver/v1/Config.java b/driver/src/main/java/org/neo4j/driver/v1/Config.java index 2eea9f359f..ce09650102 100644 --- a/driver/src/main/java/org/neo4j/driver/v1/Config.java +++ b/driver/src/main/java/org/neo4j/driver/v1/Config.java @@ -364,7 +364,15 @@ public ConfigBuilder withTrustStrategy( TrustStrategy trustStrategy ) * @param routingFailureLimit * the number of times to retry each server in the list of routing servers * @return this builder + * @deprecated in 1.2 because driver memorizes seed URI used during construction and falls back to it at + * runtime when all other known router servers failed to respond. Driver is also able to perform DNS lookup + * for the seed URI during rediscovery. This means updates of cluster members will be picked up if they are + * reflected in a DNS record. This configuration allowed driver to retry rediscovery procedure and postpone + * failure. Currently there exists a better way of doing retries via + * {@link Session#readTransaction(TransactionWork)} and {@link Session#writeTransaction(TransactionWork)}. + * Method will be removed in the next major release. */ + @Deprecated public ConfigBuilder withRoutingFailureLimit( int routingFailureLimit ) { if ( routingFailureLimit < 1 ) @@ -398,7 +406,15 @@ public ConfigBuilder withRoutingFailureLimit( int routingFailureLimit ) * @param unit * the unit in which the duration is given * @return this builder + * @deprecated in 1.2 because driver memorizes seed URI used during construction and falls back to it at + * runtime when all other known router servers failed to respond. Driver is also able to perform DNS lookup + * for the seed URI during rediscovery. This means updates of cluster members will be picked up if they are + * reflected in a DNS record. This configuration allowed driver to retry rediscovery procedure and postpone + * failure. Currently there exists a better way of doing retries via + * {@link Session#readTransaction(TransactionWork)} and {@link Session#writeTransaction(TransactionWork)}. + * Method will be removed in the next major release. */ + @Deprecated public ConfigBuilder withRoutingRetryDelay( long delay, TimeUnit unit ) { long routingRetryDelayMillis = unit.toMillis( delay );