Add batch-llm module: 100,000 synthetic tickets classified by a ChatClient in a Spring Batch 6 chunk step with Resilience4j rate limiting and retry, skip-and-record for malformed JSON, restart after kill -9 in a second JVM, and a per-chunk cost ledger. The model is a deterministic simulated ChatModel; prices are configurable placeholders. No provider called.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017ic4b4VQVEJWetTT1dYzyJ
This commit is contained in:
2026-10-29 06:10:22 +00:00
co-authored by Claude Sonnet 5.5
parent aa8b1604ed
commit 6d792f00e0
48 changed files with 2093 additions and 0 deletions
+30
View File
@@ -0,0 +1,30 @@
# Crash and restart, 100000 tickets: JVM 1 killed with kill -9 after 400 committed chunks, JVM 2 resumes
## JVM 1 (progress lines, then SIGKILL)
PROGRESS committed-chunks-this-jvm=250 last-ticket=25000
PROGRESS committed-chunks-this-jvm=300 last-ticket=30000
PROGRESS committed-chunks-this-jvm=350 last-ticket=35000
PROGRESS committed-chunks-this-jvm=400 last-ticket=40000
(process killed by SIGKILL; no shutdown hook ran)
## JVM 2
RECOVER: execution 1 is STARTED but its JVM is gone; marking it FAILED so the instance can restart
START run.id=crash-demo tickets=100000 chunk=100
JOB FINISHED: executionId=33 status=COMPLETED seconds=34.2
---- REPORT ----
tickets total=100000 classified=99691 skipped=309 unaccounted=0
step executions:
{ID=1, JOB=1, STATUS=FAILED, READS=39600, WRITES=39493, SKIPS=107, COMMITS=396, ROLLBACKS=0}
{ID=33, JOB=33, STATUS=COMPLETED, READS=60400, WRITES=60198, SKIPS=202, COMMITS=604, ROLLBACKS=0}
ledger (committed chunks only): {ROWS_=1000, WRITTEN=99691, SKIPPED=309, ATTEMPTS=103519, R429=1531, U503=458, RETRIES=1989, BILLED=101530, BAD=1839, PT=10809111, CT=1467192, COST=7.605343500}
price table 'EXAMPLE-NOT-A-REAL-PRICE': input 0.50 / output 1.50 per million tokens (configurable placeholder)
provider's own meter (survives kill -9):
received 104,350
rejected_429 1,543
window_429 0
unavailable_503 462
billed 102,302
prompt_tokens 10,891,290
completion_tokens 1,478,281
billed calls the ledger does not know about (work lost in a crash or rollback): 772
results checksum (sha-256 over ordered rows): 98bdd29feb6d6f8d