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

Java, JPA, Spring, Spring Data

Create and modification date with Spring Data

Using created and last modified fields for an entity is considered general pattern and a good practice. It provides you the information about what and when happens in your database, therefore makes your life easier when the time of problem solving comes. As we love to automatize such boring tasks, using Hibernate it is common to… Continue reading Create and modification date with Spring Data

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

Artifactory, Atlassian, Gradle

Publishing with Gradle into Artifactory

In order to publish your project artifact into Artifactory, you need to define publication details in your build.gradle file. First you need to define the Artifactory server and credentials for deploying your artifact. In the "artifactory" you can define the target repository even dynamically. In my example the repository URL depends on the type of the… Continue reading Publishing with Gradle into Artifactory

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