Spring Cloud Concepts

../../_images/SpringCloud01.svg

The collection of Spring Cloud tools

Spring Cloud is a collection of tools that wraps a number of open source projects, simplifying the setup and configuration of micro-services projects. It provides solutions to the most commonly encountered patterns into the Spring application.

This allows the developer to focus on writing code.

For logging, the ELK Stack is the acronym for the following three open source projects:

Cloud Micro-Services

There are several levels of cloud applications. Here we focus on just the main two types of cloud applications.

Cloud Ready

  • A cloud ready application is an application that was once used on an onsite server. With the availability of the cloud, these types of applications have moved from a static to dynamic environments, with the aim of running in the cloud.

  • In order to make an on-premise application cloud ready, we need to externalize the applications configuration so that it can adapt to different deployment environments.

Cloud Native

  • A cloud native application is designed specifically for a cloud computing architecture, taking advantage of all of the cloud’s benefits and services.

  • When creating this type of application, the architect divides the functions into microservices with scalable components like containers, enabling them to run multiple instances concurrently. These services are then managed by virtual infrastructures through DevOps processes with continuous delivery workflows.

Spring Actuator

Maven Dependency

The Spring Boot Actuator provides out of the box operational endpoints providing visibility on the health of your application instance. To use Spring Actuator, you need to include the following dependencies in your Maven build file:

<dependency>
  <groupId>org.springframework.boot</groupId>
  <artifactId>spring-boot-starter-actuator</artifactId>
</dependency>

Out of Box Health Info

../../_images/SpringActuator.png

Out of box health request and response using Spring Actuator

application.properties entries

management.endpoints.web.base-path=/
management.endpoints.enabled-by-default=false
management.endpoint.health.enabled=true
management.endpoint.health.show-details=always
management.health.db.enabled=false
management.health.diskspace.enabled=true