eclipse, Java, REST, Spring, Spring Boot

Bypass SSL certification with Spring RestTemplate

Recently I wanted to try out a REST call on my local computer, running my microservice locally. The service calls another microservice, in the SIT environment, that required secure HTTP s connection. As I did not have the certificate installed on my workstation, but wanted to fast test the call anyway, I had to find… Continue reading Bypass SSL certification with Spring RestTemplate

REST, Spring, Spring Boot

Using multiple RetsTemplates in Spring Boot application

Recently I had to request information from my Spring Boot application from multiple services via REST. Normally it works so simple as calling a the service URL, like this: ResponseEntity response = restTemplate.getForEntity(url, MyResponse.class);   Although in my case both services required different authentication method. The first one was an open service, the second one… Continue reading Using multiple RetsTemplates in Spring Boot application

Docker, Java, Spring, Spring Boot

Using Docker in your development process

Recently I finished the Docker for Java Developers course from Spring Guru on Udemy. My goal was to learn and understand Docker so far, that I should be able to use it in my development and learning process. start a database for development and test purposes locally. Docker makes it possible to spare the installation process,… Continue reading Using Docker in your development process

Java, Spring, Spring Boot

Add your own Grafana metrics

Grafana is a great tool to visualize operational information regarding of a running service. Recently I implemented a function, that continuously sends information to the Influx database that backs our Grafana server.  It provides information about the number of clients, currently connected to our Spring Boot service, via WebSocket. As in the simplest case you… Continue reading Add your own Grafana metrics

Java, Spring, Spring Boot, Websocket

Using Spring Security with Websocket

  If you have a Spring Boot application, that already uses Spring Security, it can be tricky to set up the security for Websocket communication. The problem is, that in case of you need to protect your resources with basic authentication, it avoids the connection to your Websocket service, while Websocket can not work together… Continue reading Using Spring Security with Websocket

Cache, Spring Boot, Spring Data

Spring cache and integration testing

Using caches in a Spring application is relatively easy. It makes the overall performance better, but opens some exciting problems when it comes to integration testing the application.  Adding caching behavior to a functionality without properly thinking over the consequences, is one of the biggest mistakes, a beginner programmer can make. You must have full… Continue reading Spring cache and integration testing

Gradle, Spring Boot

Using Gradle Distribution plug-in

Recently I had to configure the Gradle Distribution plugin for a microservice application, in order to work the same way as the Maven Assembly plugin. This plugin makes it possible to create a tar.gz distribution file for our Spring Boot microservices. It contains the runnable Spring Boot jar file and all necessary configuration files. To… Continue reading Using Gradle Distribution plug-in

Java, Spring, Spring Boot

Setting up MDC context with AOP in Spring Boot application

In order to be able to analyse logs of complex processes for your application, it is useful to use Mapped Diagnostic Context (MDC) and put some process specific information into it. Currently I am implementing a Spring Boot application, with several services, and lots of calls between them. As there is a huge number of… Continue reading Setting up MDC context with AOP in Spring Boot application