15 articles Spring Boot

Transaktionsmanagement mit Spring, JPA, Hibernate

Lerne die Grundlagen des Transaktionsmanagements in modernen Datenbanken kennen, und erfahre, wie du mit Spring Boot, Spring Data, JPA und Hibernate effektiv arbeitest. In diesem Tutorial starten wir mit den Grundlagen der Datenbanktransaktionen in deiner Anwendung: – Transaktionen starten: Dieses Video ist perfekt für Entwickler, die ihre Fähigkeiten in Spring Framework erweitern und transaktionssichere Anwendungen…

Setup Spring Boot Azure OAuth2 with CORS

What is needed Setup an Azure AAD Application First we need an Azure AAD application which gives us the access to our AD users. The important part are the client id and the tenant id here: Add the web URIs which are allowed to use the OAuth2 login In the next step we have to…

Disable @Scheduled timers for test in Spring

Problem As soon we have timers in our project they may cause issues in our integration tests, as they start running in the most undesirable situation. E.g. during the trigger a specific function which would usually be triggered by the timer. Solution In the easiest scenario if it is a in memory Spring test we…

Aspects with Annotations

Problem Define a pointcut for annotated methods. The most example are based only on @within or @annotation which has the downside that the aspect is added to all methods and the check of the annotation is executed during runtime. Solution Git Repository https://github.com/sterlp/training/tree/master/aspect Links https://www.eclipse.org/aspectj/doc/released/progguide/semantics-pointcuts.html https://docs.spring.io/spring-framework/docs/5.3.x/reference/html/core.html#aop-pointcuts-designators

Spring Boot Redirect to SwaggerUI

Problem Some services don’t have an UI and the OpenAPI/ Swagger UI should be used as default UI of the service. As so the root should be redirected directly to the SwaggerUI. Solution Just add a WebMvc redirect. Swagger Open API dependencies Spring Boot 2.x Ensure you check the current version: Spring Boot 3.x Ensure…

Reconnecting JMS listener

Problem In some projects we still may need to manually to reconnect to our JMS provider. For what ever reason the framework or the container cannot do the job for us. As so we have to ensure that an once registered JMS listener re-register itself if something bad happens. Note: Check first if your container…

Spring Boot RestTemplate no SSL check

Problem By default the Spring RestTempalte and the swagger OpenAPI client does an SSL check. This is usually not required on the test system, as so the goal is to remove the SSL check from the Spring Boot Rest Template. RestTemplate Apache HTTP Client pom.xml Swagger OpenAPI Client Furthermore sometimes it is required to remove…