Sep 10, 2018
I am so happy because today my Spring Boot book is finally available! See https://www.infoq.com/minibooks/spring-boot-building-api-backend for all the details.
Read More...
Aug 30, 2018
Spring Boot 1.5.x uses Flyway 3 while Spring Boot 2.x uses Flyway 5. According to the official migration guide for Spring Boot 2, you need to do 2 releases to be able to migrate an application from Spring Boot 1 to Spring Boot 2 if you are using Flyway:
First upgrade your 1.5.x Spring Boot application to Flyway 4 (4.2.0 at the time of writing), see the instructions for Maven and Gradle.
Read More...
Jul 6, 2018
If you have an application deployed on AWS Elastic Beanstalk and you want to add Datadog integration to it, then these instructions might help you out.
I started out with the instructions at https://www.datadoghq.com/blog/deploy-datadog-aws-elastic-beanstalk/ but they use the older version 5 of the datadog-agent and not the newer version 6.
In your source code, you normally have a .ebextensions folder to configure the Elastic Beanstalk deployment. Inside that folder, create the following files (Create directories as needed):
Read More...
Jun 10, 2018
During the migration of a Spring Boot application from 1.5.13 to 2.0.2, some of my Spring Rest Docs tests started failing. The reason being that some of my RestController s return a org.springframework.data.domain.PageImpl object (from Spring Data Commons).
@RestController public class MyRestController { @GetMapping public PageImpl<SomeDtoObject> listAll() { ... } } With Spring Boot 1.5.13, this results in JSON like this:
{ "content": [ { ... }, { ... }, .
Read More...
Oct 8, 2017
I love using Asciidoctor for writing documentation. I mainly got to know it through the excellent Spring REST Docs project.
I wanted to build an extension (kind of a plug-in) for Asciidoctor. As I don’t know Ruby, writing an extension in Ruby was a bit too much. Luckily, there is AsciidoctorJ (The JVM version of Asciidoctor) which lets me write extensions in any JVM language. Here, we will be using plain Java, but Groovy for example would work equally well.
Read More...
Sep 20, 2017
In the previous post, I showed ./blog/2017/09/18/using-spring-boot-with-javafx/[how to get started with Spring Boot and JavaFX].
Continuing with the same example, we are going to create a new implementation of the CountryService interface that talks to the Open AQ Platform API so the list of countries will be a lot bigger than our HardcodedListCountryService we have now.
Using Retrofit First, we add 2 dependencies in our pom.xml to be able to use Retrofit:
Read More...
Sep 18, 2017
In my previous post, I showed how to use JavaFX with the Raspberry Pi 3. I promised there to follow up with a post on using Spring Boot with JavaFX, so here it goes.
Just as an example, I will be using the REST API service of the Open AQ Platform API as it is simple and does not require any authentication to get started.
Initial Setup We will be using Maven, so we start with a minimal pom.
Read More...
Aug 26, 2017
In this post, I am going to detail the steps to get a simple JavaFX application running on the Raspberry Pi 3 using Gluon.
Hardware For this setup, I used the Raspberry Pi 3 with the official 7" touchscreen connected.
Raspbian Installation First off, download Raspbian from https://www.raspberrypi.org/downloads/raspbian/. I chose the "RASPBIAN STRETCH WITH DESKTOP" version and burned it on an SD-card using Etcher.
Insert the SD-card in the Raspberry Pi and let it boot.
Read More...
Jul 24, 2017
If you use Spring REST Docs, you will be using the Asciidoctor include directive a lot to include the request and responses that are generated from the unit tests. Drawback is that the Asciidoctor plugin for IntelliJ IDEA will not render them by default and looks like this:
The reason is simple, the snippets attribute is only available when running the Maven or Gradle task to build the final documentation.
Read More...
Mar 13, 2017
Spring’s ServletUriComponentsBuilder.fromCurrentRequest() can be really convinient to build an URL from the current request. However, when using Nginx, things might work so well.
The solution is simple, just add these headers to your Nginx configuration file:
proxy_set_header X-Forwarded-Host $host:443; proxy_set_header X-Forwarded-Server $host; proxy_set_header X-Forwarded-Port 443; proxy_set_header X-Forwarded-Proto https; UPDATE 2020-06-08
You need to enable support for this in Spring Boot by setting the following property (Since Spring Boot 2.2):
Read More...