Re:Spring vs. Java EE
by jacques_chester on Sunday April 09, 2017 @08:49PM
(#14075198)
> The idea that you would add a dependency to avoid writing a try-catch in a loop is absolutely bewildering to me.
Reliable retry is very important in some cases, and it's easier to test a retry-agnostic unit of code.
Edit: and I also rather like that it's declarative, rather than needing to infer intention or write my own boilerplate to explicate intention.
Being able to quickly change in different retry mechanisms and policies is pretty useful. Sometimes you want exponential backoff, sometimes no backoff, sometimes it depends on other state.
Not as simple as you might think. And if you're gonna be writing microservices you're going to be intimately familiar with retries.
I really like jhalterman's failsafe library. Exponential backoff, jitter, circuit breaker support, etc.
The idea that you would add a dependency to avoid writing a try-catch in a loop is absolutely bewildering to me. What next, Spring Pad? I can see it now: