TESTCONTAINERS
Are you struggling finding the right strategy for your integration tests? Mocking does not cover everything and relying on all external services to be present also gives you a headache. What if there was a way to start the real service in your integration tests?…
PICOCLI
Do you want to bring your java applications to your command line? Picocli is a framework that enables you to create your own rich CLI ,backed by java! In this post we will get started with an example CLI called java-genie. To read more on…
ZALANDO LOGBOOK
Do you need http request and response logging without it polluting your business code? Use Zalando Logbook and add this aspect to your stack! In this post we will add logging for all http requests and play around with the configurations. For more in depth…
UPX IMAGE
Do you want smaller images with a faster startup time? Use UPX to compress your executable inside your image. Use a UPX image! For more information on the internals of UPX take a look at their website here. Or at the source code of UPX…
JIB MAVEN PLUGIN
Do you need a simple way to build docker images for your java with maven applications? Use the jib maven plugin and let maven do the heavy lifting! For a complete overview of all capabilities of the jib maven plugin take a look at the…
MAVEN ARCHETYPE
Are you copying an old maven project every time you need a new one? Maybe a maven archetype is the solution for you! In this post we will create a maven archetype to quickly create a micronaut graphQL API. A different guide on how to…
MICRONAUT TESTING
Having trouble testing your micronaut application? Or just interested on my take on micronaut testing? Just read along! In this post we will make some integration and unit tests for a micronaut gRPC API. For a wider view of the micronaut testing capabilities look at…
CREATE A MAVEN PLUGIN
Do you want to incorporate a task in your maven build? Discover how to create a maven plugin! In this post we will create a plugin that will alter a protobuf specifications file. A more in depth guide is made by apache and can be…
GRPC WITH MICRONAUT
Are you sick of writing client libraries for all your clients? Do you have trouble sticking to a contract-first approache with REST? Use gRPC! Specifically gRPC with micronaut! To get familiar with micronaut check out this previous post on micronaut. The complete code for this…
OAS3 AND SPRING BOOT
Looking for an easy way to document your Spring Boot API following the OAS3 specification? Use a Springdoc documentation endpoint, for OAS3 and Spring Boot! In this post we set up Springdoc and add documentation to an example endpoint. The code for the Springdoc project…
SPRING AUTOCONFIGURE
Ever wondered how defining a property in Spring applications can automatically configure functionality? We are going to create this ourselves with Spring autoconfigure. We are going to setup a controller with endpoint with only a dependency and a property. For a more in depth discussion…
KUBERNETES AND PROMETHEUS
In an earlier post we saw how to deploy your Spring application to a Kubernetes cluster. Here we will see how to setup monitoring in your cluster where Kubernetes and Prometheus work together. Follow along to setup your own Prometheus instance! For more in depth…
JAVA TO KOTLIN
For Android developers there is a shift going on from Java to Kotlin. Here we are going to look at some Kotlin features that caught my eye. My overall impression is that it’s Java but more concise and more safe. Let’s have a look. For…
JACKSON ANNOTATIONS
Jackson is a helpful tool when building REST API’s. In this post I will explain what Jackson annotations I use all the time. There are of course many more Jackson annotations for all situations (example tutorials here). Here we focus on the things you want…
SPRING BEAN LOADING ORDER
Spring beans are not always loaded in the same order. The Spring container has freedom in the way beans are loaded and even in the smallest projects the order changes. Here are some ways to control this Spring bean loading order. One of the restrictions…
HIBERNATE ID GENERATION STRATEGIES
It was a regular day in the office. A consumer of our API started just migrated half of their load to our endpoints. Suddenly we get calls of locking insert statements on the underlying database. Here is wat we learned the hard way: Never use…
MIGRATION JAVA 8 TO JAVA 11 WITH SPRING BOOT 2
Upgrading a major version is always a pain. Although from java 9 up it’s supposed to be easier. In this post I will give some examples of the obstacles I encountered. The use case is a Spring Boot application, so we need to upgrade to…