Keycloak docker KC_ variables ignored?

I have been using the `quay.io/keycloak/keycloak:19.0.3-legacy` with docker compose and JHipster. Now, JHipster application exposes UI to 8080, keycloak also exposes to 8080, so we map it to another port, say 9080. JHipster app talks to the keycloak via service name and port, like so: keycloak:8080, and all works fine until you try to login,…

Spring JPA – Delete by multiple values

After, apparently, encountering a JPA bug with delete all by in the repository, I had to figure out the best approach to run a delete by query. Using named query on the entity seems to work just as expected, so I am posting the link to the solution here as a reference: https://medium.com/the-full-stack-developer/how-to-delete-records-in-spring-data-based-on-multiple-values-563500ad51cc

Liquibase SpringBoot Multiple Data Sources

I was working on an example of how to get Liquibase with SpringBoot and multiple databases working. After some documentation and reading stackoverflow, here it is, for a future reference: https://github.com/divukman/liquibase_spring_boot_example

gRPC Spring Boot Server with Oauth2 (Keycloak)

This post will describe, in shortest steps, the configuration needed to get spring boot grpc server secured with oauth2 tokens, in my case with Keycloak. Resources: OAuth 2.0 Resource Server JWT gRPC Spring Boot Starter Server security configuration Postman gRPC My demo project can be found at github. Server code has been updated to have…

Hexagonal Architecture With SpringBoot

I have been trying to create a clean hexagonal architecture example with SpringBoot. More complex approaches are possible, by introducing the CQRS into the equation, but I believe that just over complicates the architecture and if there is no really good reason for it, I’d avoid it. There are a couple of examples out there…

Spring Boot JPA Test Splice

Here is a small example that: Uses @DataJpaTest annotation to bring in only configuration relevant for JPA tests (entities, repos etc…) Uses @TestMethodOrder(MethodOrderer.OrderAnnotation.class) and @Order annotations to enforce order of method execution Uses @ComponentScan(basePackages = {“tech.dimitar.rosdjpaint.bootstrap”}) annotation to bring in the component that bootstraps the data Uses @Commit annotation on test to enforce transaction does…

Initialize a Database Using Hibernate – profile and db based

You want to initialize a database with different data depending on the data source? Should be straight forward: https://docs.spring.io/spring-boot/docs/current/reference/html/howto.html#howto.data-initialization Spring Boot can automatically create the schema (DDL scripts) of your JDBC DataSource or R2DBC ConnectionFactory and initialize it (DML scripts). It loads SQL from the standard root classpath locations: schema.sql and data.sql, respectively. In addition,…