Reactive Patterns: Try-Catch-Finally

Photo by Egor Myznik on Unsplash
https://projectreactor.io/docs/core/release/api/reactor/core/publisher/Mono.html#using-java.util.concurrent.Callable-java.util.function.Function-java.util.function.Consumer-
  • First, a temporary file is created. This is our resource.
  • Then, we download the logs from Ansible Tower, write it into the temporary file, and process the result.
  • At the end, we want to delete the temporary file in any case.
  • If anything unexpected happens, we want to handle the exception and rethrow it as an exception of our own.
https://projectreactor.io/docs/core/release/api/reactor/core/publisher/Mono.html#onErrorMap-java.util.function.Function-

--

--

Dies ist das Blog der Digital Frontiers GmbH & Co. KG (http://www.digitalfrontiers.de). Hier veröffentlichen wir zu Themen, die uns interessieren und bewegen.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store