What is Spring? The Spring Framework (short Spring) is an open source framework for the Java platform. The goal of the Spring Framework is to simplify development with Java/Java EE and promote good programming practices. Spring provides a holistic solution for building applications and their business logic with a wide range of functionality; decoupling of application components is the focus. [wikipedia]
The main projects of Spring include:
- Spring Boot
- Spring Framework
- Spring Cloud Date Flow
- Spring Cloud
- Spring Data
- Spring Integration
- Spring Batch
- Spring Security
- Spring HATEOAS
- spring REST Docs
- Spring AMQP
- Spring Mobile
- Spring for Android
- Spring Web Flow
- Spring Web Services
- Spring LDAP
- Spring Session
- Spring Shell
- Spring Flo
- Spring Kafka
- Spring Statemachine
- Sprin IO Platform
In addition Spring includes the two community projects:
- Spring Roo
- Spring SCALA
The individual Spring projects, e.g. Spring Cloud, also consist of individual subprojects:
- Spring Cloud Config
- Spring Cloud Netflix
- Spring Cloud Bus
- Spring Cloud for Cloud Foundry
- Spring Cloud Open Service Broker
- Spring Cloud Cluster
- Spring Cloud Consul
- Spring Cloud Security
- Spring Cloud Sleuth
- Spring Cloud Data Flow
- Spring Cloud Stream
- Spring Cloud Stream App Starters
- Spring Cloud Task
- Spring Cloud Task App Starters
- Spring Cloud Zookeeper
- Spring Cloud for Amazon Web Services
- Spring Cloud Connectors
- Spring Cloud Starters
- Spring Cloud CLI
- Spring Cloud Contract
- Spring Cloud Gateway
- Spring Cloud OpenFeign
- Spring Cloud Pipelines
- Spring Cloud Function
In Spring Cloud all projects are based on Spring Boot.
Spring Cloud Config If you want to use configuration within the application, there are different options:
- Use configuration in environment variables. Disadvantage: treated differently on different systems.
- Use configuration within the application. Disadvantage: after every change the application has to be rebuilt and restarted.
- Use configuration on the file system. Disadvantage: not reachable from outside for cloud applications.
- Use configuration within a cloud provider’s infrastructure. Disadvantage: dependency on a cloud provider.
An alternative solution is therefore provided by Spring Cloud Config.

The management of configuration files of the individual microservices is handled via the central Spring Cloud microservice. Persistence can occur within a versioning system such as Git. Access to the config files by the microservices (clients) is via REST. The transfer of parameters can be encrypted symmetrically or asymmetrically.
Spring Cloud Netflix (Eureka) Eureka is a service discovery server.
Service discovery refers to the automatic detection of services in a computer network. Communication protocols are used for this, describing how services find each other to communicate. Basically there are two groups of service discovery protocols (SDPs):
- Services register themselves with a central service (a registry) and can be found through it.
- Services query the entire network for a specific service by broadcasting and the requested service or a registry responds.
[Source: Wikipedia]

Within a region (e.g. Eureka Cluster DE) microservices can register with the Eureka server (register). Eureka then knows all services within its region. After registration the services send a ‘heartbeat’ to Eureka (renew) at an interval of x seconds. In case Eureka does not receive a ‘renew’, it removes the corresponding service from the registry. The Eureka servers replicate the (registry) and (renew) information among each other. Thus services can query information about other services from a remote region and initiate a corresponding request to the remote service (remote call).
In contrast to Eureka the Spring Cloud Config Server is a client.
Spring Cloud Netflix (Ribbon) Ribbon is, in contrast to traditional server load balancers, a client-side load balancer that handles communication with the servers or server-side load balancer according to Round Robin and other parameters. 
Spring Cloud Netflix (Feign) Feign aims to simplify the creation of HTTP API clients. For this an interface only needs to be declared and annotated. When using Feign Ribbon and Eureka are automatically imported.
Spring Cloud Netflix (Hystrix) Hystrix is a ‘circuit breaker’.
A circuit breaker is a design pattern in software development. It is used to detect recurring connection failures to a resource, such as a database or a web service, and to block access to the resource for a predefined period.
Suppose a database is overloaded due to too many requests and timeouts occur. This leads to users, for psychological reasons, trying the last action again. Since the application without a circuit breaker waits for each request to the database in its own task until a timeout occurs, the thread pool is exhausted and the application also fails.
To prevent this, a circuit breaker is built into the application. It detects when a large number of connection failures occur and prevents access to the database. Instead of waiting for the database until a timeout, the application can immediately return an error or disable parts of the application, thereby using no additional threads from the pool. The application can thus continue running with limited functionality even without the database. In addition the database is given a chance to recover.
After a specified time the circuit breaker closes again and the connection to the database is attempted. If this attempt fails, the circuit breaker opens immediately again. Otherwise the functionality of the application is restored. [Source: Wikipedia]
The above figure first shows a successful request by the client, which is forwarded to the server or database via the ‘circuit breaker’ or Hystrix. The second request leads to a timeout, for example because the DB is not reachable. The following two requests are intercepted and answered by Hystrix. Here an alternative route can also be used. For the last query there are no connection problems to the server, so the request is forwarded to the server again.
Spring Cloud Netflix (Zuul) Zuul is an API gateway. To understand Zuul the following terms SOP and CORS should be known.
SOP The Same-Origin Policy (SOP; German “Gleiche-Herkunft-Richtlinie”) is a security concept that prohibits client-side scripting languages like JavaScript and ActionScript, but also cascading style sheets, from accessing objects (for example images) that originate from another website or whose location does not match the origin. It is an essential security element in all modern browsers and web applications for protection against attacks. [Source: Wikipedia]
CORS Cross-origin requests refer to accesses by a website or web application to resources on another server or another domain. Such accesses have been blocked by web browsers since 1996 through the Same-Origin Policy (SOP). However, the W3C defines the method of Cross-Origin Resource Sharing (CORS), which allows browsers and clients to access resources from other origins again. [Source: Wikipedia]
One way to enable access by external clients to internal resources without CORS is to provide internal access via an API gateway (Zuul). 
Zuul performs, among other things, the following tasks:
- Authentication and Security: authentication of a client when accessing the individual resources
- Insights and Monitoring: tracking and creation of statistics on data usage.
- Dynamic Routing: dynamic routing of requests to the different backend services
- Stress Testing: gradually increases the traffic to a system to measure performance.
- Load Shedding: management of requests by reserving corresponding resources for each request and rejecting requests in case of a timeout.
- Static Response handling: certain responses are answered directly from the edge instead of being forwarded to the cluster for processing.
- Multiregion Resiliency: ….
Spring Cloud Bus This feature is mainly used to broadcast central configuration and management information. As described under ‘Cloud Config Server’, configuration information can be requested by the individual services. Since configuration rarely changes, unnecessary network traffic can result. Spring Cloud Bus uses a message broker to publish all changes it receives from the ‘Cloud Config Server’. All registered services (subscribers) are then informed of a change and can only then request the changed configuration from the ‘Cloud Config Server’. Out of the box the AMQP broker is supported. However other brokers such as Apache Kafka or RabbitMQ can also be used.
The above figure shows how microservice 1 and 3 are informed of a change by the Spring Cloud Bus (broker) after subscription.
