Created
March 14, 2020 08:12
-
-
Save KalpaD/6d1916a39e53ebb66e7ffb237d681c13 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| private static void debuggingUsingCheckpoints() { | |
| List<String> nameList = Arrays.asList("Rochel", "April", "Hong"); | |
| Flux<String> stringFlux = Flux.fromIterable(nameList) | |
| .distinct() | |
| .checkpoint("after distinct()") | |
| .map(name -> name.substring(0, 3)) | |
| .checkpoint("after substring") | |
| .map(String::toUpperCase) | |
| .checkpoint("after toUpperCase") | |
| .map(name -> { | |
| if (name.equals("HON")) { | |
| throw new RuntimeException("Boom!"); | |
| } else { | |
| return name; | |
| } | |
| }) | |
| .checkpoint("after gate map"); | |
| stringFlux.subscribe(log::info); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment