System components

AI-generated

Cloud-native system componentsGateway, discovery, configuration, and application-service components in the legacy Spring Cloud example.Components of the legacy Spring Cloud Netflix example Gateway, discovery, configuration, and two application services with registration, startup configuration, and request dependencies. {"provenance": "AI-generated", "sourceAssets": ["archive/original-images/book/spring/images/parts-of-system.png"]} Cloud-native system components Gateway(two instances) Discovery(two instances) Config(two instances) Service A(two instances) Service B(two instances) request dependency register startup config

Startup sequence

Fetch configuration

AI-generated

Startup configuration phaseGateway and application services fetch external configuration from the Config Server.Spring Cloud startup configuration phase Gateway and application services fetch external configuration from the Config Server during startup. {"provenance": "AI-generated", "sourceAssets": ["archive/original-images/book/spring/images/system-on-startup-1.png"]} Startup phase 1: fetch external configuration Config server Gateway Service A GET configuration Service B Each component starts with environment-specific settings before serving traffic.

Register instances

AI-generated

Startup registration phaseGateway and service instances register their locations and health with the discovery server.Spring Cloud service-registration phase Gateway and service instances register their network locations and health with the discovery server. {"provenance": "AI-generated", "sourceAssets": ["archive/original-images/book/spring/images/system-on-startup-2.png"]} Startup phase 2: register discoverable instances Discovery server Gateway Service A register + heartbeat Service B The registry can return only instances that have registered and remain healthy.

Request flow

Example request to service A:

  1. Request starts with the gateway (Zuul)
  2. Gateway utilises already cached location of services A <> or asks Discovery server for Service A’s location.
  3. Makes “hystrix-protected” call to service A.
  4. Service A’s Response depends upon Service B, then same (if location cached then use it otherwise ask Discovery Server for it).
  5. Makes “hystrix-protected” call to Service B.
  6. Service B responds -> Service A responds -> Gateway Responds.

There are other Spring Cloud projects as well (apart from the Netflix projects) e.g., Spring Cloud Bus, etc