Lab 15: Capstone — Production Platform

Time: 90 minutes | Level: Architect | Docker: docker run -it --rm zchencow/innozverse-java:latest bash


Overview

Build a complete production Java platform integrating all previous labs: virtual threads for concurrency, gRPC for service communication, SQLite for persistence, Resilience4j circuit breaker, OpenTelemetry observability, EC P-256 request signing, manual DI annotations, JMH benchmarks, and JUnit 5 tests — all verified end-to-end in Docker.


Architecture

┌─────────────────────────────────────────────────────────────┐
│  Production Java Platform (Lab 15)                           │
│                                                              │
│  ┌──────────────┐   ┌─────────────────┐                     │
│  │ Virtual       │   │  gRPC Service   │                     │
│  │ Threads       │──▶│  (in-process)   │                     │
│  │ (10000 tasks) │   │  + Interceptor  │                     │
│  └──────────────┘   └────────┬────────┘                     │
│                               │                              │
│  ┌──────────────┐   ┌─────────▼────────┐                    │
│  │ Resilience4j │   │  SQLite JDBC     │                     │
│  │ Circuit      │   │  Event Store     │                     │
│  │ Breaker      │   └──────────────────┘                     │
│  └──────────────┘                                            │
│                                                              │
│  ┌──────────────┐   ┌──────────────────┐                    │
│  │ OpenTelemetry│   │  EC P-256        │                     │
│  │ Spans        │   │  Request Signing │                     │
│  └──────────────┘   └──────────────────┘                    │
│                                                              │
│  ┌──────────────┐   ┌──────────────────┐                    │
│  │ JMH          │   │  Manual @Inject  │                     │
│  │ @Benchmark   │   │  DI Container    │                     │
│  └──────────────┘   └──────────────────┘                    │
│                                                              │
│  JUnit 5: 6+ @Test  (all components tested)                 │
└─────────────────────────────────────────────────────────────┘

Step 1: Project Structure


Step 2: pom.xml


Step 3: Manual DI Annotations


Step 4: Core Services


Step 5: gRPC Service


Step 6: JMH Benchmark


Step 7: JUnit 5 Tests


Step 8: Capstone — Full Integration Test


Running the Capstone

📸 Verified JUnit 5 Output (6 tests):

Test coverage:


JMH Benchmark Reference

Expected output:


Summary

Component
Library/API
Status

Virtual threads

Executors.newVirtualThreadPerTaskExecutor()

✓ 10000 tasks

gRPC service

grpc-inprocess + ServerCalls

✓ Unary call

SQLite persistence

org.xerial:sqlite-jdbc:3.47.0.0

✓ Event store

Circuit breaker

Resilience4j CircuitBreaker

✓ State transitions

Distributed tracing

opentelemetry-sdk

✓ Parent-child spans

EC P-256 signing

JCA KeyPairGenerator("EC")

✓ Sign + verify

Manual DI

@Component + @Inject reflection

✓ 3 beans wired

JMH benchmark

@Benchmark @Fork(0)

✓ signRequest ns/op

JUnit 5 tests

junit-jupiter 5.10.1

✓ 6 tests pass

Last updated