Testcontainers GCloud Module With Spring Boot

Testcontainers is a library that is helpful with writing reliable integration tests in a module-specific (Databases, Kafka, Redis) Docker container. Once the execution of tests is over, the containers are completely destroyed. If your application is using Google Cloud components like Spanner, Firestore, etc. to write efficient integration tests, Testcontainers offers a GCloud module for … Read more

Error Handling in Spring for GraphQL

The Problem Recently, I wrote some GraphQL endpoints and got a bit blocked when I came to the error handling mechanism. Usually, when writing REST endpoints, you either go for a particular @ExceptionHandler for your controller or you go for the @ControllerAdvice to handle exceptions globally for multiple controllers. Apparently, that is not the case … Read more

WebRTC Video Calls With Angular and Spring Boot

WebRTC video calls have been added to the AngularPwaMessenger project. The back end supports WebSocket connections that are secured by JWT tokens to enable WebRTC signaling. The current browsers support video calls with WebRTC. The Angular front end supports the WebRTC calls and needs to access the camera and the microphone. The browsers need to … Read more

How To Create a Spring Boot Kubernetes Controller

In this article, we will look at creating a Kubernetes Controller using Spring Boot that will handle requests when a CRD instance is created, updated, or deleted. Project Setup Let’s go to https://start.spring.io and create a new project with the following dependencies. Next, you need to add the Kubernetes Java client dependency as below <dependency> … Read more

First Impressions When Switching From Spring Boot to Ktor | by Matthias Schenk | Jul, 2022

A Step-by-step guide to write an API endpoint using Ktor, Koin and Exposed When I switched from Java to Kotlin I continued using my familiar tech stack consisting of several parts out of the SpringBoot ecosystem. With some small differences, which are mostly handled by the Kotlin Spring plugin, I could use it the same … Read more

Creating Application using Spring Roo and Deploying on Google App Engine

Spring Roo is a rapid application development tool that helps you in rapidly building spring-based enterprise applications in the java programming language. Google app engine is a cloud computing technology that lets you run your application on Google’s infrastructure. Using Spring Roo, you can develop applications that can be used on the Google app engine. … Read more

Understanding Hot Deployment and Hot Reloading in Spring Boot | by Dwen | Aug, 2022

Sprint Boot hot deployment and hot reloading Photo by Milk-Tea on Unsplash In Spring Boot development and debugging, if we need to restart and debug each line of code modification, it may be time-consuming. The Spring Boot team provides the sprint-boot-devtools (Short name: Devtools) plugin for this problem, which tries to improve the efficiency of … Read more

Externalize Microservice Configuration With Spring

In a microservices system, we might need or want to externalize configuration so that we can abstract sensitive data or credentials outside the applications. We can do something like this with Docker Compose, but the compose file often contains values ​​for multiple services together. We probably want further separation and limited access. This is where … Read more

java – Spring Validator validate method never called

I have two close to each other controllers – one for products and one for users. I’d like to add Spring Validation to both controllers. So I added ProductValidator and UserValidator classes which implement Validator. ProductValidator works fine. The problem is UserValidator is never called. InitBinder method is being called, but validation doesn’t work. At … Read more

java – Hibernate/JDBC connection from spring to postgres in docker container

I’m trying to get spring security to work using JDBC authentication. I have a postgres server running in a docker container which is receiving the requests, but keeps throwing an error. Here is my application.properties: spring.datasource.url=jdbc:postgresql://localhost:5432/postgres spring.datasource.username=phi spring.datasource.password=kalkoen spring.datasource.driver-class-name=org.postgresql.Driver spring.jpa.hibernate.ddl-auto=update spring.jpa.show-sql=true spring.jpa.properties.hibernate.format_sql=true spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQL81Dialect my security config: @Configuration @EnableWebSecurity public class SecurityConfig { @Autowired private DataSource … Read more