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

Advertisement
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

Java, Spring

My favorite Lombok features

I use the Lombok project with a great pleasure. It makes it easier to create a nice code without boilerplate code. My favorite features @Data Maybe the most used annotation. Generates all boilerplate code for a domain object. Getters, setters, equals, hashcode, toString. It is a very good feature to start with. You will never… Continue reading My favorite Lombok features

JPA, Spring

Batching database operations with Spring and Hibernate

Recently I needed to do some database performance optimization for a Spring Boot application. The application persisted a huge amount of log like data to the Oracle database via Spring JPA. With Hibernate and Spring Data JPA it was not really deficient to write this data, due to the time of single datasource, transaction and… Continue reading Batching database operations with Spring and Hibernate