# packtpublishing/microservices-with-spring-boot-and-spring-cloud-third-edition architecture

> Architecture diagram of the GitHub repository packtpublishing/microservices-with-spring-boot-and-spring-cloud-third-edition, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-10). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/packtpublishing/microservices-with-spring-boot-and-spring-cloud-third-edition
- Repository: https://github.com/packtpublishing/microservices-with-spring-boot-and-spring-cloud-third-edition

## Overview

This repository accompanies a book on building production-ready Spring Boot and Spring Cloud microservices; the tree shows successive chapter snapshots of a product system. The principal workflow is a client requesting a product aggregate, with product, recommendation, and review services supplying domain data; later chapters add persistence and reactive/event-driven behavior. The README documents broader deployment, security, discovery, resilience, and observability topics, but their implementation files are not in the supplied tree. Edges without shown call sites are dashed and unverified.

Main entry points: [`Chapter06/microservices/product-composite-service/src/main/java/se/magnus/microservices/composite/product/services/ProductCompositeIntegration.java`](https://github.com/packtpublishing/microservices-with-spring-boot-and-spring-cloud-third-edition/blob/main/Chapter06/microservices/product-composite-service/src/main/java/se/magnus/microservices/composite/product/services/ProductCompositeIntegration.java) (Core integration), [`Chapter07/microservices/product-service/src/main/java/se/magnus/microservices/core/product/services/ProductServiceImpl.java`](https://github.com/packtpublishing/microservices-with-spring-boot-and-spring-cloud-third-edition/blob/main/Chapter07/microservices/product-service/src/main/java/se/magnus/microservices/core/product/services/ProductServiceImpl.java) (Product service), [`Chapter07/microservices/recommendation-service/src/main/java/se/magnus/microservices/core/recommendation/services/RecommendationServiceImpl.java`](https://github.com/packtpublishing/microservices-with-spring-boot-and-spring-cloud-third-edition/blob/main/Chapter07/microservices/recommendation-service/src/main/java/se/magnus/microservices/core/recommendation/services/RecommendationServiceImpl.java) (Recommendation service), [`Chapter23/microservices/review-service/src/main/java/se/magnus/microservices/core/review/services/ReviewServiceImpl.java`](https://github.com/packtpublishing/microservices-with-spring-boot-and-spring-cloud-third-edition/blob/main/Chapter23/microservices/review-service/src/main/java/se/magnus/microservices/core/review/services/ReviewServiceImpl.java) (Review service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_composition["API composition"]
  node_composite["Product composite"]
  node_integration["Core integration"]
  node_contracts["Service contracts"]
end

subgraph group_domain["Domain services"]
  node_product["Product service"]
  node_recommendation["Recommendation service"]
  node_review["Review service"]
end

subgraph group_storage["Persistence"]
  node_productstore[("Product repository")]
  node_recommendationstore[("Recommendation repository")]
  node_reviewstore[("Review repository")]
end

subgraph group_messaging["Reactive messaging"]
  node_event["Event envelope<br/>[Event.java]"]
  node_broker["Message broker"]
end

node_client(("API client"))
node_gateway["Edge gateway"]
node_discovery["Service discovery"]
node_security["API security"]
node_deployment["Container orchestration"]
node_observability["Tracing and monitoring"]

node_client -.->|"requests aggregate"| node_composite
node_composite -.->|"delegates calls"| node_integration
node_integration -.->|"calls product"| node_product
node_integration -.->|"calls recommendations"| node_recommendation
node_integration -.->|"calls reviews"| node_review
node_product -.->|"reads and writes"| node_productstore
node_recommendation -.->|"reads and writes"| node_recommendationstore
node_review -.->|"reads and writes"| node_reviewstore
node_product -.->|"publishes events"| node_broker
node_recommendation -.->|"consumes events"| node_broker
node_review -.->|"consumes events"| node_broker
node_event -.->|"encodes messages"| node_broker
node_client -.->|"enters through"| node_gateway
node_gateway -.->|"uses discovery"| node_discovery
node_deployment -.->|"supports operations"| node_observability

click node_composite "https://github.com/packtpublishing/microservices-with-spring-boot-and-spring-cloud-third-edition/blob/main/Chapter06/microservices/product-composite-service/src/main/java/se/magnus/microservices/composite/product/services/ProductCompositeServiceImpl.java"
click node_integration "https://github.com/packtpublishing/microservices-with-spring-boot-and-spring-cloud-third-edition/blob/main/Chapter06/microservices/product-composite-service/src/main/java/se/magnus/microservices/composite/product/services/ProductCompositeIntegration.java"
click node_contracts "https://github.com/packtpublishing/microservices-with-spring-boot-and-spring-cloud-third-edition/blob/main/Chapter07/api/src/main/java/se/magnus/api/composite/product/ProductCompositeService.java"
click node_product "https://github.com/packtpublishing/microservices-with-spring-boot-and-spring-cloud-third-edition/blob/main/Chapter07/microservices/product-service/src/main/java/se/magnus/microservices/core/product/services/ProductServiceImpl.java"
click node_recommendation "https://github.com/packtpublishing/microservices-with-spring-boot-and-spring-cloud-third-edition/blob/main/Chapter07/microservices/recommendation-service/src/main/java/se/magnus/microservices/core/recommendation/services/RecommendationServiceImpl.java"
click node_review "https://github.com/packtpublishing/microservices-with-spring-boot-and-spring-cloud-third-edition/blob/main/Chapter23/microservices/review-service/src/main/java/se/magnus/microservices/core/review/services/ReviewServiceImpl.java"
click node_productstore "https://github.com/packtpublishing/microservices-with-spring-boot-and-spring-cloud-third-edition/blob/main/Chapter07/microservices/product-service/src/main/java/se/magnus/microservices/core/product/persistence/ProductRepository.java"
click node_recommendationstore "https://github.com/packtpublishing/microservices-with-spring-boot-and-spring-cloud-third-edition/blob/main/Chapter07/microservices/recommendation-service/src/main/java/se/magnus/microservices/core/recommendation/persistence/RecommendationRepository.java"
click node_reviewstore "https://github.com/packtpublishing/microservices-with-spring-boot-and-spring-cloud-third-edition/blob/main/Chapter07/microservices/review-service/src/main/java/se/magnus/microservices/core/review/persistence/ReviewRepository.java"
click node_event "https://github.com/packtpublishing/microservices-with-spring-boot-and-spring-cloud-third-edition/blob/main/Chapter07/api/src/main/java/se/magnus/api/event/Event.java"
click node_gateway "https://github.com/packtpublishing/microservices-with-spring-boot-and-spring-cloud-third-edition/tree/main/Chapter10"
click node_discovery "https://github.com/packtpublishing/microservices-with-spring-boot-and-spring-cloud-third-edition/tree/main/Chapter09"
click node_security "https://github.com/packtpublishing/microservices-with-spring-boot-and-spring-cloud-third-edition/tree/main/Chapter11"
click node_deployment "https://github.com/packtpublishing/microservices-with-spring-boot-and-spring-cloud-third-edition/tree/main/Chapter04"
click node_observability "https://github.com/packtpublishing/microservices-with-spring-boot-and-spring-cloud-third-edition/tree/main/Chapter07"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_composite,node_integration,node_contracts,node_client toneBlue
class node_product,node_recommendation,node_review toneAmber
class node_productstore,node_recommendationstore,node_reviewstore,node_security toneMint
class node_event,node_broker toneRose
class node_gateway,node_discovery,node_deployment,node_observability toneTeal
```

## Components

### API composition

- [Product composite](https://github.com/packtpublishing/microservices-with-spring-boot-and-spring-cloud-third-edition/blob/main/Chapter06/microservices/product-composite-service/src/main/java/se/magnus/microservices/composite/product/services/ProductCompositeServiceImpl.java): `Chapter06/microservices/product-composite-service/src/main/java/se/magnus/microservices/composite/product/services/ProductCompositeServiceImpl.java`
- [Core integration](https://github.com/packtpublishing/microservices-with-spring-boot-and-spring-cloud-third-edition/blob/main/Chapter06/microservices/product-composite-service/src/main/java/se/magnus/microservices/composite/product/services/ProductCompositeIntegration.java): `Chapter06/microservices/product-composite-service/src/main/java/se/magnus/microservices/composite/product/services/ProductCompositeIntegration.java`
- [Service contracts](https://github.com/packtpublishing/microservices-with-spring-boot-and-spring-cloud-third-edition/blob/main/Chapter07/api/src/main/java/se/magnus/api/composite/product/ProductCompositeService.java): `Chapter07/api/src/main/java/se/magnus/api/composite/product/ProductCompositeService.java`

### Domain services

- [Product service](https://github.com/packtpublishing/microservices-with-spring-boot-and-spring-cloud-third-edition/blob/main/Chapter07/microservices/product-service/src/main/java/se/magnus/microservices/core/product/services/ProductServiceImpl.java): `Chapter07/microservices/product-service/src/main/java/se/magnus/microservices/core/product/services/ProductServiceImpl.java`
- [Recommendation service](https://github.com/packtpublishing/microservices-with-spring-boot-and-spring-cloud-third-edition/blob/main/Chapter07/microservices/recommendation-service/src/main/java/se/magnus/microservices/core/recommendation/services/RecommendationServiceImpl.java): `Chapter07/microservices/recommendation-service/src/main/java/se/magnus/microservices/core/recommendation/services/RecommendationServiceImpl.java`
- [Review service](https://github.com/packtpublishing/microservices-with-spring-boot-and-spring-cloud-third-edition/blob/main/Chapter23/microservices/review-service/src/main/java/se/magnus/microservices/core/review/services/ReviewServiceImpl.java): `Chapter23/microservices/review-service/src/main/java/se/magnus/microservices/core/review/services/ReviewServiceImpl.java`

### Persistence

- [Product repository](https://github.com/packtpublishing/microservices-with-spring-boot-and-spring-cloud-third-edition/blob/main/Chapter07/microservices/product-service/src/main/java/se/magnus/microservices/core/product/persistence/ProductRepository.java): `Chapter07/microservices/product-service/src/main/java/se/magnus/microservices/core/product/persistence/ProductRepository.java`
- [Recommendation repository](https://github.com/packtpublishing/microservices-with-spring-boot-and-spring-cloud-third-edition/blob/main/Chapter07/microservices/recommendation-service/src/main/java/se/magnus/microservices/core/recommendation/persistence/RecommendationRepository.java): `Chapter07/microservices/recommendation-service/src/main/java/se/magnus/microservices/core/recommendation/persistence/RecommendationRepository.java`
- [Review repository](https://github.com/packtpublishing/microservices-with-spring-boot-and-spring-cloud-third-edition/blob/main/Chapter07/microservices/review-service/src/main/java/se/magnus/microservices/core/review/persistence/ReviewRepository.java): `Chapter07/microservices/review-service/src/main/java/se/magnus/microservices/core/review/persistence/ReviewRepository.java`

### Reactive messaging

- [Event envelope](https://github.com/packtpublishing/microservices-with-spring-boot-and-spring-cloud-third-edition/blob/main/Chapter07/api/src/main/java/se/magnus/api/event/Event.java): `Chapter07/api/src/main/java/se/magnus/api/event/Event.java`
- **Message broker**

### Other components

- **API client**
- [Edge gateway](https://github.com/packtpublishing/microservices-with-spring-boot-and-spring-cloud-third-edition/tree/main/Chapter10): `Chapter10`
- [Service discovery](https://github.com/packtpublishing/microservices-with-spring-boot-and-spring-cloud-third-edition/tree/main/Chapter09): `Chapter09`
- [API security](https://github.com/packtpublishing/microservices-with-spring-boot-and-spring-cloud-third-edition/tree/main/Chapter11): `Chapter11`
- [Container orchestration](https://github.com/packtpublishing/microservices-with-spring-boot-and-spring-cloud-third-edition/tree/main/Chapter04): `Chapter04`
- [Tracing and monitoring](https://github.com/packtpublishing/microservices-with-spring-boot-and-spring-cloud-third-edition/tree/main/Chapter07): `Chapter07`

## Connections

- API client → Product composite: requests aggregate
- Product composite → Core integration: delegates calls
- Core integration → Product service: calls product
- Core integration → Recommendation service: calls recommendations
- Core integration → Review service: calls reviews
- Product service → Product repository: reads and writes
- Recommendation service → Recommendation repository: reads and writes
- Review service → Review repository: reads and writes
- Product service → Message broker: publishes events
- Recommendation service → Message broker: consumes events
- Review service → Message broker: consumes events
- Event envelope → Message broker: encodes messages
- API client → Edge gateway: enters through
- Edge gateway → Service discovery: uses discovery
- Container orchestration → Tracing and monitoring: supports operations
