Skip to content

Dani Velasco Solution - #62

Open
daniivelascoo wants to merge 2 commits into
dalogax:mainfrom
daniivelascoo:feat/similar-products-service
Open

Dani Velasco Solution#62
daniivelascoo wants to merge 2 commits into
dalogax:mainfrom
daniivelascoo:feat/similar-products-service

Conversation

@daniivelascoo

Copy link
Copy Markdown

Reactive Spring Boot (WebFlux) service exposing GET /product/{id}/similar, aggregating the existing similarids + product-detail upstream APIs.

  • Parallel, order-preserving fan-out with flatMapSequential
  • Resilience: per-product and similarids timeouts; skip on 404/500/timeout
  • Explicit, tuned Reactor Netty connection pool (measured throughput vs result-completeness tradeoff, documented in app/README.md)
  • Dockerfile + docker-compose "yourapp" service
  • .claude tooling (skills, agents, hooks, commands) for dev and maintenance

Reactive Spring Boot (WebFlux) service exposing GET /product/{id}/similar,
aggregating the existing similarids + product-detail upstream APIs.

- Parallel, order-preserving fan-out with flatMapSequential
- Resilience: per-product and similarids timeouts; skip on 404/500/timeout
- Explicit, tuned Reactor Netty connection pool (measured throughput vs
  result-completeness tradeoff, documented in app/README.md)
- Dockerfile + docker-compose "yourapp" service
- .claude tooling (skills, agents, hooks, commands) for dev and maintenance
Cover the service contract with 36 tests and add logging that stays
silent on the hot path.

Tests (MockWebServer stubs the upstream in-process; no Docker or
Simulado needed, ~25s):
- ProductClientTest: both timeouts, 404/500/malformed-body skipping,
  numeric id coercion
- SimilarProductsServiceTest: similarity order preserved when an earlier
  product answers last, parallel fan-out asserted with virtual time,
  dropping of unresolvable products
- SimilarProductsControllerTest: 200 / empty array / 404 / 5xx mapping
- SimilarProductsIntegrationTest: the five mock scenarios end to end
- ProductClientLoggingTest: pins the log levels

Logging: WARN for what makes a request fail, DEBUG for what the design
deliberately tolerates. Skipping a product runs on nearly every request
under load, so it stays at DEBUG; at the default INFO the full scenario
set produces zero per-request lines. Level is env-overridable via
LOG_LEVEL, and the effective client config is logged once at startup.

Also:
- Fix a PreToolUse hook that used a non-existent "if" config field and
  therefore blocked every Bash command instead of just the k6 run.
- Correct docs claiming mvn cannot build locally: Maven runs on JDK 21
  even though java on the PATH is 17.
- Narrow the readme deny rule, which was unintentionally matching
  app/README.md at any depth.
@daniivelascoo
daniivelascoo force-pushed the feat/similar-products-service branch from e5ac4e8 to 4e639e0 Compare August 13, 2026 09:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant