Skip to content

Commit

Permalink
Added Hooks.onErrorDropped()
Browse files Browse the repository at this point in the history
  • Loading branch information
artem-v committed Apr 6, 2021
1 parent 05ff22f commit d683060
Showing 1 changed file with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,30 @@
import java.util.StringJoiner;
import java.util.concurrent.ThreadFactory;
import java.util.function.Function;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Hooks;
import reactor.core.publisher.Mono;
import reactor.netty.FutureMono;
import reactor.netty.channel.AbortedException;
import reactor.netty.resources.LoopResources;

public class RSocketServiceTransport implements ServiceTransport {

public static final Logger LOGGER = LoggerFactory.getLogger(RSocketServiceTransport.class);

static {
Hooks.onErrorDropped(
throwable -> {
if (throwable instanceof AbortedException) {
LOGGER.warn("[onErrorDropped] error: {}", throwable.toString());
} else {
LOGGER.error("[onErrorDropped] error:", throwable);
}
});
}

private int numOfWorkers = Runtime.getRuntime().availableProcessors();

private HeadersCodec headersCodec = HeadersCodec.DEFAULT_INSTANCE;
Expand Down

0 comments on commit d683060

Please sign in to comment.