rrezartprebreza/spring-boot-skills / skills/spring-boot-3/idempotency-patterns
idempotency-patterns
VerifiedUse when making retried HTTP commands or message processing safe against duplicate effects, including database-backed request keys, payload conflicts and concurrent retries. Do not apply caching as a substitute for business idempotency.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 3.9 KB |
| agents/openai.yaml | config | 261 B |
| examples/bad-idempotency.java | other | 303 B |
| examples/good-idempotency.sql | other | 964 B |
examples/good-idempotency.sql
View on GitHub-- PostgreSQL. Keep claim, business write and stored response in ONE transaction.
CREATE TABLE request_results (
tenant_id UUID NOT NULL,
operation VARCHAR(100) NOT NULL,
idempotency_key VARCHAR(200) NOT NULL,
request_hash VARCHAR(64) NOT NULL,
response_status INTEGER,
response_body TEXT,
created_at TIMESTAMPTZ NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (tenant_id, operation, idempotency_key),
CHECK (response_status IS NULL OR response_status BETWEEN 200 AND 599)
);
-- JDBC named-parameter statement, not a Flyway migration:
-- INSERT INTO request_results (tenant_id, operation, idempotency_key, request_hash)
-- VALUES (:tenant, :operation, :key, :hash)
-- ON CONFLICT (tenant_id, operation, idempotency_key) DO NOTHING
-- RETURNING idempotency_key;
-- A claimed row must be completed with the business result before committing.
-- No returned row: read existing hash/result in a NEW statement, then compare/replay.
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| deprecation-and-migrationaddyosmani/agent-skillsManages deprecation and migration. Use when removing old systems, APIs, or features. Use when migrating users from one implementation to another. Use when migrating a database schema in production, such as renaming or dropping a column without downtime (expand/contract). Use when deciding whether to maintain or sunset existing code. | Stars: 119k | Updated | Claude CodeCodex | Verified | Install |
| performance-optimizationaddyosmani/agent-skillsOptimizes application performance across frontend, backend, queries, and databases. Use when performance requirements exist, when you suspect performance regressions, when Core Web Vitals or load times need improvement, when N+1 query patterns need fixing, or when profiling reveals bottlenecks. | Stars: 119k | Updated | Claude CodeCodex | Verified | Install |
| agent-cost-reportthedotmack/claude-memBelievable agent cost report for any period, default the last 7 full days PT, not counting today. Measured tokens from Claude Code transcripts priced at OpenRouter list prices (ESTIMATED), measured provider spend when a sanctioned source exists, note-taker cost separate, Timing-style HTML/PDF plus report.json, line-items.csv, evidence.json. | Stars: 118k | Updated | Claude CodeCodex | Verified | Install |
| agent-cost-reportthedotmack/claude-memBelievable agent cost report for any period, default the last 7 full days PT, not counting today. Measured tokens from Claude Code transcripts priced at OpenRouter list prices (ESTIMATED), measured provider spend when a sanctioned source exists, note-taker cost separate, Timing-style HTML/PDF plus report.json, line-items.csv, evidence.json. | Stars: 118k | Updated | Claude CodeCodex | Verified | Install |