Spring WebFlux Hidden thoughts

So I recently started using Spring WebFlux and Project Reactor as stated in this post. One more thing I came across as I was debugging why a certain job was not running was that if you do not catch all exceptions and do not have a doOnError statement it will just keep that thought hidden from you and all to itself.

Then I sprinkled some log() statements around and it surfaced that the data import/export I was doing had some unfortunate data that Long.parseLong() did not agree with and threw a NumberFormatException. That however was nowhere in my code to catch and so it failed silently.

This meant I could see the job starting and for all intents and purposes see it do nothing afterwards.

Lesson learned, always have a doOnError on each of your flows.

#code #devops #java