Skip to content

Commit

Permalink
Disable Backup-Request / Retries. (#102)
Browse files Browse the repository at this point in the history
* Disable Backup-Request / Retries.

**Problem**
There are bugs related to Backup-Request/Retries subscription.
The remaining part of the code is ok.

**Solution**
Disable the code in the ClientBuilder.

* Address comments
  • Loading branch information
stevegury authored and NiteshKant committed Jun 23, 2016
1 parent 023bb54 commit 667c746
Showing 1 changed file with 1 addition and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,19 +103,6 @@ public ClientBuilder withConnectTimeout(long timeout, TimeUnit unit) {
);
}

public ClientBuilder withBackupRequest(double quantile) {
return new ClientBuilder(
name,
executor,
requestTimeout, requestTimeoutUnit,
connectTimeout, connectTimeoutUnit,
quantile,
retries, retryThisException,
connector,
source
);
}

public ClientBuilder withExecutor(ScheduledExecutorService executor) {
return new ClientBuilder(
name,
Expand Down Expand Up @@ -155,19 +142,6 @@ public ClientBuilder withSource(Publisher<List<SocketAddress>> source) {
);
}

public ClientBuilder withRetries(int nbOfRetries, Function<Throwable, Boolean> retryThisException) {
return new ClientBuilder(
name,
executor,
requestTimeout, requestTimeoutUnit,
connectTimeout, connectTimeoutUnit,
backupQuantile,
nbOfRetries, retryThisException,
connector,
source
);
}

public ReactiveSocket build() {
if (source == null) {
throw new IllegalStateException("Please configure the source!");
Expand All @@ -183,14 +157,7 @@ public ReactiveSocket build() {
Publisher<List<ReactiveSocketFactory<SocketAddress>>> factories =
sourceToFactory(source, filterConnector);

ReactiveSocket socket = new LoadBalancer(factories);
if (0.0 < backupQuantile && backupQuantile < 1.0) {
socket = new BackupRequestSocket(socket, backupQuantile, executor);
}
if (retries > 0) {
socket = new RetrySocket(socket, retries, t -> true);
}
return socket;
return new LoadBalancer(factories);
}

private Publisher<List<ReactiveSocketFactory<SocketAddress>>> sourceToFactory(
Expand Down

0 comments on commit 667c746

Please sign in to comment.