This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@BenchmarkMode({Mode.AverageTime}) | |
@Warmup(iterations = 5, time = 5, timeUnit = TimeUnit.SECONDS) | |
@Measurement(iterations = 5, time = 5, timeUnit = TimeUnit.SECONDS) | |
@Fork(value = 1) | |
@OutputTimeUnit(TimeUnit.NANOSECONDS) | |
@State(Scope.Benchmark) | |
public class MonoOptionalBenchmark { | |
private static final Throwable EXCEPTION = new RuntimeException() { | |
@Override |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Test | |
void testMDC() { | |
Logger log = LoggerFactory.getLogger("test"); | |
Hooks.enableAutomaticContextPropagation(); | |
// To deal with the entire MDC (if we ensured no third-party code modifies it): | |
// ContextRegistry.getInstance().registerThreadLocalAccessor(new MdcAccessor()); | |
// To deal with an individual key in the MDC: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package dev.jedrzejczyk.reactorlab; | |
import java.util.List; | |
import reactor.core.publisher.Flux; | |
import reactor.core.scheduler.Schedulers; | |
public class WrapAroundExercise { | |
public static void main(String[] args) { |