return Single.fromFuture(
asyncStub.withDeadlineAfter(ClientConfiguration.INSTANCE.getMaxTimeout(), TimeUnit.SECONDS).checkBalance(payload))
.doOnSubscribe(s -> System.out.println("subscribing"))
.doOnSuccess((resp) -> {
log.info("Check Balance got response success {}", resp.getUserID());
log.debug("Check Balance got response success {}", resp.toString());
})
.doOnError(throwable -> {
this.logError(throwable, "Check balance userid:" + payload);
})
.retry((retryCount, error) -> retryCount < 3).toFuture();
From client its getting retried but on server its not getting new request Please suggest what I'm doing wrong
Apparently you create a
Futurebefore RxJava is involved thus retrying a "constant" has no effect. I.e.,You have to make the creation of a fresh
Futurehappen when a (re)subscription happens: