Latest Posts

If you are using the core Spring Framework (that is, not Spring Boot), then you may have encountered a problem where Spring doesn’t seem to completely ignore mocked beans in your tests: Perhaps Spring attempts to inject beans into them or run your @PostConstruct lifecycle methods. In this post I present that problem together with… Continue Reading

In this post I am going to show how to copy MDC data from Web threads to @Async threads using a brand new Spring Framework 4.3 feature: ThreadPoolTaskExecutor#setTaskDecorator() [set-task-decorator]. This is the end result: Notice the third and second last log lines: they have [userId:Duke] just left of the log level. The first line is… Continue Reading

In this post I am going to look into Kotlin properties [1] from a Java developers perspective. By a few examples and by looking into the generated code. I have created an example project on GitHub. You will find a few examples of how to declare properties – and for each of them, also identical… Continue Reading

In the context of my favorite framework, Spring Boot, I have recently started to explore the effect of using the Kotlin 1.1 programming language (as an alternative to Java 8). This post describes a few language features that may be interesting to a typical Java 8 developer. Also, I hope you will see that: Spring… Continue Reading

Are you a savvy Java EE 7 application developer? My bet is then, that you are using Java 7/8 for developing your favorite components (EJBs, CDI beans etc). In this post I am going to show how you can develop a Java EE 7 application using Kotlin 1.1 instead. It is very very (!) easy:… Continue Reading

In this post I show how you can create a Spring Boot 1.5 application using Kotlin 1.1 (as opposed to typically Java 8 in these times). The example I’ve created is a typical “Hello World” example. I have chosen to implement a Spring MVC controller – and an awesome Spring Boot integration test. The Gradle… Continue Reading

In this post I show how you can add support for Prometheus in Spring Boot applications. Step 1 of 2: Add the Prometheus Spring Boot Starter You can get Prometheus support in Spring Boot applications via a so-called “starter”. Here is how to get that… It’s a one liner in Gradle: And a five liner… Continue Reading