Add spring-boot-microservices-project: config server, Eureka, gateway and three services on Boot 4.1.1 + Spring Cloud 2025.1.3

Product, order and inventory services behind Spring Cloud Gateway (WebMVC), configuration from a Config Server,
discovery with Eureka, a Resilience4j circuit breaker on order -> inventory and Brave tracing. Run as six plain jars;
output/ holds real transcripts (config, registry, requests, trace propagation, circuit breaker, startup race and the
load-balanced RestClient.Builder trap). Dockerfile and docker-compose.yml are included but were not run.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01HhW8LD8r3EigoBaCGrQZx5
This commit is contained in:
Claude
2026-10-21 17:08:42 +00:00
commit def73fa1c4
49 changed files with 1419 additions and 0 deletions
@@ -0,0 +1,14 @@
package com.ankurm.shop.config;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.config.server.EnableConfigServer;
/** Serves the files under src/main/resources/config to every other service. Start this one first. */
@SpringBootApplication
@EnableConfigServer
public class ConfigServerApplication {
public static void main(String[] args) {
SpringApplication.run(ConfigServerApplication.class, args);
}
}
@@ -0,0 +1,12 @@
spring:
application:
name: config-server
profiles:
active: native
cloud:
config:
server:
native:
search-locations: classpath:/config
server:
port: 8888
@@ -0,0 +1,9 @@
# Served to EVERY service that asks the config server (the "application" file is the shared default).
management:
endpoints:
web:
exposure:
include: health,info,circuitbreakers
tracing:
sampling:
probability: 1.0
@@ -0,0 +1,25 @@
# Routes live here, not in the gateway jar: change a route, restart the gateway, no rebuild.
spring:
cloud:
gateway:
server:
webmvc:
routes:
- id: products
uri: lb://product-service
predicates:
- Path=/api/products/**
filters:
- StripPrefix=1
- id: orders
uri: lb://order-service
predicates:
- Path=/api/orders/**
filters:
- StripPrefix=1
- id: inventory
uri: lb://inventory-service
predicates:
- Path=/api/inventory/**
filters:
- StripPrefix=1
@@ -0,0 +1,3 @@
shop:
inventory:
low-stock-threshold: 5
@@ -0,0 +1,4 @@
shop:
order:
currency: EUR
max-quantity: 10