What will be printed by this program, and why?

Serialization Puzzle

Image for post
Image for post
Java and Lombok are close to each other. Maybe too close ? :)

What is Lombok? According to its homepage:

Project Lombok is a java library that automatically plugs into your editor and build tools, spicing up your java.
Never write another getter or equals method again. Early access to future java features such as
val, and much more.

I happened to become a user of Lombok in an existing codebase. After some fustrating hours let me share some thoughts about its dangers, which I became aware of.

“automatically plugs into your editor and build tools, spicing up your java”

O o. That might sound promising, but such slogans are suspicious to me. Using a middle sized project my collegue happened to face with the same problem, which was reported a few weeks ago. …

Recently we had a discussion about fail-fast with my colleagues. We cannot fix organisation problems, monitoring shortcomings or log spam with just throwing an exception to show an error message for the end customer. That is true. I still prefer fail-fast since

  • it can help the developer to identify and fix the problems faster, which in the end leads to higher customer satisfaction
  • often I cannot fix the things mentioned above

So I tend to think about fail-fast pragmatically.

Dependent Tests

Similar problem is when tests are depending subtly on each other. It can be really time consuming and annoying to find and fix such tests. …

Hystrix with Spring Boot in 2 Minutes

Image for post
Image for post
Photo by Blake Connally on Unsplash

Today, the creation of web applications has been made really easy with frameworks like Spring Boot. Let’s say we want to be sure that our application remains responsive even if a third party system does not answer our requests. Here’s how we can solve this problem with Spring Boot in some code snippets coming directly from our payment component:

The EnableHystrix annotation does the following, according to its JavaDoc:

All it does is turn on circuit breakers and let the autoconfiguration find the Hystrix classes if they are available (i.e., you also need Hystrix on the classpath).

Apart from that, we only need to add the HystrixCommand annotation to the methods, which we can cancel, in the case of a timeout or…

Gábor Lipták

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