News for hackers. Stuff that matters.
Re:Spring vs. Java EE by twic on Sunday April 09, 2017 @06:47PM (#14074738)
> Or: I could use Spring-Retry[0].

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:

  @LeftPad(width = 50)
  public String getNameForDisplay() {
    return name;
  }
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.

Re:Spring vs. Java EE by nimish on Sunday April 09, 2017 @07:50PM (#14074983)
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.

Re:Spring vs. Java EE by wsargent on Monday April 10, 2017 @02:43PM (#14081348)
I really like jhalterman's failsafe library. Exponential backoff, jitter, circuit breaker support, etc.

https://github.com/jhalterman/failsafe

Re:Spring vs. Java EE by springsux on Monday April 10, 2017 @12:11AM (#14075951)
Death by a thousand annotations, which used to be death by a thousand XML files.