Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use retryWhen() in StatsdMeterRegistry #1946

Merged
merged 1 commit into from
Mar 27, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import reactor.netty.tcp.TcpClient;
import reactor.netty.udp.UdpClient;
import reactor.util.context.Context;
import reactor.util.retry.Retry;

import java.net.PortUnreachableException;
import java.time.Duration;
Expand Down Expand Up @@ -223,7 +224,7 @@ private void prepareUdpClient(Publisher<String> publisher) {
.handle((in, out) -> out
.sendString(publisher)
.neverComplete()
.retry(throwable -> throwable instanceof PortUnreachableException)
.retryWhen(Retry.indefinitely().filter(throwable -> throwable instanceof PortUnreachableException))
)
.connect()
.subscribe(client -> {
Expand Down Expand Up @@ -254,7 +255,7 @@ private void connectAndSubscribe(TcpClient tcpClient) {
}
return Mono.empty();
})
.retryBackoff(Long.MAX_VALUE, Duration.ofSeconds(1), Duration.ofMinutes(1))
.retryWhen(Retry.backoff(Long.MAX_VALUE, Duration.ofSeconds(1)).maxBackoff(Duration.ofMinutes(1)))
.subscribe(client -> {
this.client.replace(client);

Expand Down