Category: Microservices with Spring
-
Setup Service Discovery using Eureka server
1. Introduction In this tutorial we’ll discuss how to implement client side service discovery. Spring Cloud project makes Service Discovery setup very easy with the help of following components: 2. Setup Eureka server Following is the main dependency we need to add for eureka server. Here is the complete pom.xml: Add @EnableEurekaServer annotation to the…
-
Introduction to Service Discovery and Service Registration in microservices
1. Introduction In this tutorial, we’ll discuss why we need service discovery and service registration in microservices. Let us first understand the problem which service discovery and service registration tries to solve. Suppose we have three microservices: ‘Product’, ‘Order’ and ‘Delivery’. These microservices handle storing, fetching, and processing data, executing business logic, and responding to…
-
Liveness and Readiness probe in microservices
1. Introduction A liveness probe determines whether the container or application is operational. If it’s healthy, no intervention is needed as everything is running smoothly. If it’s unresponsive or unhealthy, corrective action, such as restarting the container, is triggered. In essence, the liveness probe verifies: “Is the container alive or not?” A readiness probe checks…
-
Refresh configurations at runtime using Spring Cloud Bus
1. Introduction If you have followed the tutorials till now, we set up our microservices with config server. But the problem with this approach. Whenever we want to refresh the configurations at runtime without restart, we have to invoke the refresh API for each microservice instance. To oversome this challenge we can use Spring Cloud…
-
Generate Docker image of Spring Boot application with Google Jib
1. Introduction In this tutorial, we’ll generate a Docker image of Spring Boot application with Google Jib. 2. What is Google Jib? Google Jib is an open-source Java containerization tool that allows developers to build Docker and OCI (Open Container Initiative) images for Java applications without needing a Docker daemon or writing a Dockerfile. Jib…
-
Refresh configurations at runtime using refresh actuator path
1. Introduction In real world applications, most often the requirement is to change the configuration properties. New changes can be committed to the Git repository supporting the Config service. In our earlier tutorial, we discussed how to read configuration properties from GitHub. Whenever properties are changed in Git, Spring Cloud Config Server can read the…
-
Encryption and Decryption of Properties in Spring Cloud Config Server
1. Introduction In previous tutorials, we have kept properties in plain text. But this is not always desirable. If you have sensitive information, you should keep such information in encrypted format not as plain text.In this tutorial, we’ll see how to encrypt and decrypt properties in Spring Cloud Config Server. 2. Provide encryption key To…
-
Reading configurations from the Git in Spring Cloud Config Server
1. Introduction In this tutorial we’ll discuss reading configurations from the Git in Spring Cloud Config Server. This is the default implementation. Using Git makes it very convenient for managing upgrades and physical environments and auditing changes done over time. You can configure the location of the repository in your Config server configuration (for example…
-
Reading configurations from the filesystem location of Spring Cloud Config Server
1. Introduction In the previous tutorial, we discussed how to read properties from Spring Cloud Config Server using Spring Cloud Config Client. In that example, we kept configurations in the classpath. In this tutorial, we’ll discuss reading configurations from the filesystem of the server. Storing configurations in the filesystem is usually not used in production…
-
Read properties from Spring Cloud Config Server Using Spring Cloud Config Client
1. Introduction to Spring Boot Config Client In this tutorial, we’ll discuss the Spring Cloud Config Client and will explore how to read properties from Spring Cloud Config Server. In the previous tutorial, we created a Spring Cloud Config Server. Once the Spring Cloud Config Server is created, the Spring Boot application can access these…
