# mcetkovicit/lazyroutingrepro architecture

> Architecture diagram of the GitHub repository mcetkovicit/lazyroutingrepro, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-21). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mcetkovicit/lazyroutingrepro
- Repository: https://github.com/mcetkovicit/lazyroutingrepro

## Overview

Lazy Routing Repro is a Spring Boot sample for checking whether read-only transactions use a reader datasource while writes use a writer. The intended workflow is an HTTP probe request, datasource routing, and a marker returned from the selected PostgreSQL database; the README also documents a standalone concurrent load-test runner. Source excerpts were not provided, so internal Java call relationships are unverified; dashed, uncited edges indicate those inferred links. The README documents the routing behavior and database markers.

Main entry points: [`src/main/java/com/example/lazyroutingrepro/probe/RoutingProbe.java`](https://github.com/mcetkovicit/lazyroutingrepro/blob/master/src/main/java/com/example/lazyroutingrepro/probe/RoutingProbe.java) (Routing probe), [`src/main/java/com/example/lazyroutingrepro/probe/RoutingProbeController.java`](https://github.com/mcetkovicit/lazyroutingrepro/blob/master/src/main/java/com/example/lazyroutingrepro/probe/RoutingProbeController.java) (Probe controller), [`src/main/java/com/example/lazyroutingrepro/probe/RoutingProbeService.java`](https://github.com/mcetkovicit/lazyroutingrepro/blob/master/src/main/java/com/example/lazyroutingrepro/probe/RoutingProbeService.java) (Probe service), [`src/main/java/com/example/lazyroutingrepro/probe/RoutingProbeRepository.java`](https://github.com/mcetkovicit/lazyroutingrepro/blob/master/src/main/java/com/example/lazyroutingrepro/probe/RoutingProbeRepository.java) (Probe repository)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_probe["HTTP probe"]
  node_app["Spring Boot app"]
  node_controller["Probe controller"]
  node_service["Probe service"]
  node_repository["Probe repository"]
  node_response["Probe response<br/>[ProbeResponse.java]"]
end

subgraph group_routing["Datasource routing"]
  node_routing_probe["Routing probe<br/>[RoutingProbe.java]"]
  node_datasource_config["Datasource config"]
end

subgraph group_stores["PostgreSQL stores"]
  node_master[("Master database<br/>[01-schema.sql]")]
  node_slave[("Slave database<br/>[01-schema.sql]")]
end

subgraph group_loadtest["Load testing"]
  node_load_runner["Load test runner"]
end

node_caller(("HTTP caller"))

node_caller -->|"sends requests"| node_controller
node_controller -.->|"delegates to"| node_service
node_service -.->|"queries through"| node_repository
node_repository -.->|"uses probe"| node_routing_probe
node_datasource_config -.->|"configures routing"| node_routing_probe
node_routing_probe -->|"routes writes"| node_master
node_routing_probe -->|"routes read-only"| node_slave
node_master -->|"returns MASTER marker"| node_response
node_slave -->|"returns SLAVE marker"| node_response
node_load_runner -->|"sends concurrent requests"| node_controller

click node_app "https://github.com/mcetkovicit/lazyroutingrepro/blob/master/src/main/java/com/example/lazyroutingrepro/LazyRoutingReproApplication.java"
click node_controller "https://github.com/mcetkovicit/lazyroutingrepro/blob/master/src/main/java/com/example/lazyroutingrepro/probe/RoutingProbeController.java"
click node_service "https://github.com/mcetkovicit/lazyroutingrepro/blob/master/src/main/java/com/example/lazyroutingrepro/probe/RoutingProbeService.java"
click node_repository "https://github.com/mcetkovicit/lazyroutingrepro/blob/master/src/main/java/com/example/lazyroutingrepro/probe/RoutingProbeRepository.java"
click node_response "https://github.com/mcetkovicit/lazyroutingrepro/blob/master/src/main/java/com/example/lazyroutingrepro/probe/ProbeResponse.java"
click node_routing_probe "https://github.com/mcetkovicit/lazyroutingrepro/blob/master/src/main/java/com/example/lazyroutingrepro/probe/RoutingProbe.java"
click node_datasource_config "https://github.com/mcetkovicit/lazyroutingrepro/blob/master/src/main/java/com/example/lazyroutingrepro/config/DataSourceConfiguration.java"
click node_master "https://github.com/mcetkovicit/lazyroutingrepro/blob/master/docker/postgres/master-init/01-schema.sql"
click node_slave "https://github.com/mcetkovicit/lazyroutingrepro/blob/master/docker/postgres/slave-init/01-schema.sql"
click node_load_runner "https://github.com/mcetkovicit/lazyroutingrepro/blob/master/src/main/java/com/example/lazyroutingrepro/tools/LoadTestRunner.java"

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_app,node_controller,node_service,node_repository,node_response toneBlue
class node_routing_probe,node_datasource_config toneAmber
class node_master,node_slave toneMint
class node_load_runner toneRose
class node_caller toneIndigo
```

## Components

### HTTP probe

- [Spring Boot app](https://github.com/mcetkovicit/lazyroutingrepro/blob/master/src/main/java/com/example/lazyroutingrepro/LazyRoutingReproApplication.java): `src/main/java/com/example/lazyroutingrepro/LazyRoutingReproApplication.java`
- [Probe controller](https://github.com/mcetkovicit/lazyroutingrepro/blob/master/src/main/java/com/example/lazyroutingrepro/probe/RoutingProbeController.java): `src/main/java/com/example/lazyroutingrepro/probe/RoutingProbeController.java`
- [Probe service](https://github.com/mcetkovicit/lazyroutingrepro/blob/master/src/main/java/com/example/lazyroutingrepro/probe/RoutingProbeService.java): `src/main/java/com/example/lazyroutingrepro/probe/RoutingProbeService.java`
- [Probe repository](https://github.com/mcetkovicit/lazyroutingrepro/blob/master/src/main/java/com/example/lazyroutingrepro/probe/RoutingProbeRepository.java): `src/main/java/com/example/lazyroutingrepro/probe/RoutingProbeRepository.java`
- [Probe response](https://github.com/mcetkovicit/lazyroutingrepro/blob/master/src/main/java/com/example/lazyroutingrepro/probe/ProbeResponse.java): `src/main/java/com/example/lazyroutingrepro/probe/ProbeResponse.java`

### Datasource routing

- [Routing probe](https://github.com/mcetkovicit/lazyroutingrepro/blob/master/src/main/java/com/example/lazyroutingrepro/probe/RoutingProbe.java): `src/main/java/com/example/lazyroutingrepro/probe/RoutingProbe.java`
- [Datasource config](https://github.com/mcetkovicit/lazyroutingrepro/blob/master/src/main/java/com/example/lazyroutingrepro/config/DataSourceConfiguration.java): `src/main/java/com/example/lazyroutingrepro/config/DataSourceConfiguration.java`

### PostgreSQL stores

- [Master database](https://github.com/mcetkovicit/lazyroutingrepro/blob/master/docker/postgres/master-init/01-schema.sql): `docker/postgres/master-init/01-schema.sql`
- [Slave database](https://github.com/mcetkovicit/lazyroutingrepro/blob/master/docker/postgres/slave-init/01-schema.sql): `docker/postgres/slave-init/01-schema.sql`

### Load testing

- [Load test runner](https://github.com/mcetkovicit/lazyroutingrepro/blob/master/src/main/java/com/example/lazyroutingrepro/tools/LoadTestRunner.java): `src/main/java/com/example/lazyroutingrepro/tools/LoadTestRunner.java`

### Other components

- **HTTP caller**

## Connections

- HTTP caller → Probe controller: sends requests (evidence: `README.md`)
- Probe controller → Probe service: delegates to
- Probe service → Probe repository: queries through
- Probe repository → Routing probe: uses probe
- Datasource config → Routing probe: configures routing
- Routing probe → Master database: routes writes (evidence: `README.md`)
- Routing probe → Slave database: routes read-only (evidence: `README.md`)
- Master database → Probe response: returns MASTER marker (evidence: `README.md`)
- Slave database → Probe response: returns SLAVE marker (evidence: `README.md`)
- Load test runner → Probe controller: sends concurrent requests (evidence: `README.md`)
