How to Implement Distributed Caching in Java Microservices using Redis Cluster? Actually, in the microservice world, there are different ways in which we can introduce caching into an application architecture. The databases, caches, or the use cases, which I have explained here in this blog, are...
How can I implement access tokens for a public Spring Boot API? I have a public facing API created with Spring Boot. I want users of the API to include a token with requests so that I can ensure they are allowed to access it and also track how many requests are made within a certain...
springbootreact.model.ApiResponse; import lombok.extern.java.Log; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.Date; /** * Ideally, this should implement an interface for AcountService * However, ignoring it here to ...
We will come back to usingdemo.locallater in this guide. (Required) Build and Run the Demo Application You can run this command to start up the application: ./mvnw clean compile spring-boot:run In the logs, you will be able to see that Jetty is used, and that HTTP/1, HTTP/2, and...
Implement the Service Registry client Add an@EnableEurekaClientannotation to theSampleServiceAApplication.javafile to configure it as a Eureka Client. Java packagecom.example.Sample.Service.A;importorg.springframework.boot.SpringApplication;importorg.springframework.boot.autoconfigure.SpringBootApplication;impo...
The second is specifically designed to demonstrate how to implement Spring Boot on Kubernetes with a fully automatic CI/CD pipeline. Note that neither of these solutions is production ready. You need to assess your availability and reliability targets as well as your security requirements before basi...
To handle Keycloak interactions, we first need to import Keycloak adapters and Spring security to manage the Oauth2 process: <dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-security</artifactId></dependency><dependency><groupId>org.keycloak</groupId>...
How to add a new font to Helix3 Template If you don't want to use Google Font in Typography section nor the default Helvetica Neue, Helvetica or Arial you can load your own font. For example, you can integrate a custom font from MyFonts.com, fontspring.com, transfonter.org or font...
However, while you can create your own custom Hibernate Types for mapping PostgreSQL arrays, you don’t need to implement your own Hibernate Type. All you need to do is use the Hypersistence Utils open-source project. Database table Considering we have the following table in our PostgreSQL dat...
I would to measure processing time for each HTTP request in Spring Boot application (like access.log). For example I could implementGenericFilterBean: doFilter(ServletRequest request, ServletResponse response, FilterChain chain){ long start = now(); try { chain.doFilter(request, response);...