- Home
- Skills
- APIs & Backend
- Spring Boot reliable messaging
Spring Boot reliable messaging
Teach your coding agent to build consumers and publishers that survive redelivery, poison messages and broker outages.
$8
Works with the AI Agents you already use
Spring Boot reliable messaging
Example session with this skill installed
When we save a ticket we also publish an event to RabbitMQ, but sometimes the event is lost, and a bad message makes our consumer retry forever. Make publishing and consuming reliable and test it against a real broker.
- Read your context and instructions
- Compiled the spring boot reliable
Summary. Events now go through a transactional outbox, with a relay that publishes them using publisher confirms. The consumer is idempotent, dead-letters poison messages, and retries only transient failures. The full build passed twice in a row:
24 tests, 0 failures, 0 errors, against PostgreSQL and RabbitMQ in containers. No dependencies were added. Consumer retry uses the framework's own retry policy.
| Concern | Decision |
|---|---|
| Lost events | Outbox row written in the same transaction as the state change; the writer refuses to run outside a transaction |
| Relay | Bounded batches claimed with FOR UPDATE SKIP LOCKED; publisher confirms with correlation, the mandatory flag and returned-message detection |
| Poison messages | Raw-bytes listener, rejected without requeue, then the dead-letter queue after one attempt |
| Transient failures | Bounded retry (a lock timeout is retried 3 times, then dead-lettered) |
| Duplicates and reordering | Processed-message record plus a version guard on the read model |
Verified by tests:
- Topology read from the broker: durable, bounded and dead-lettered queues, with a consumer attached.
- End to end: HTTP → outbox → relay → broker → consumer updates the read model.
- Seven poison variants are dead-lettered after exactly one attempt: unreadable, wrong content type, quoted JSON string, unknown type, unsupported schema, ID mismatch, missing event ID.
- A real row-lock timeout is retried 3 times, then dead-lettered, and the processed record is rolled back.
- A duplicate message ID gives one effect; stale and out-of-order events change nothing.
- Two parallel relays publish each row once; an unroutable message stays pending with its attempts counted.
- With the broker paused, rows stay pending, the oldest-pending age is reported and probes stay UP; publishing recovers afterwards.
- Rows at the attempt cap are reported as stuck; cleanup deletes only rows past retention.
Next steps. If order on the broker matters, publish each batch on one channel (the test run needed this). Choose an overflow behaviour for the dead-letter queue so it never drops messages silently. Alert on dead-letter depth and oldest-pending age.
Connects securely to your tools. The creator never sees your data.
About this skill
Message-driven code fails quietly. A consumer that assumes exactly-once delivery applies an effect twice, a poison message blocks a queue or loops forever, an event is published before its transaction commits, or a message is lost when the broker is briefly unavailable.
This skill gives Claude Code, Cursor, Codex CLI and other SKILL.md-compatible agents a version-agnostic workflow for producers and consumers. Before writing code, the agent reads the build file and records the actual framework and broker-client versions. It checks what the configured message converter does and confirms every API for those versions. Then it assesses each consumer and producer and applies a fixed set of rules.
The guidance covers durable, bounded queues with one dead-letter queue per consumer, and a message envelope with event ID, schema version and aggregate version. Messages are serialized exactly once, and consumers validate raw bytes in their own code. Retries are bounded, invalid messages go straight to the dead-letter queue, a processed-message table in the same transaction makes consumers idempotent, and version guards ignore stale events. The transactional outbox claims rows skip-locked, sends a batch and awaits all acknowledgements with one deadline, and treats unroutable messages as failures. A test plan against a real broker shows how to prove each behaviour.
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for APIs & Backend.
Requires a relational database for outbox/idempotency tables. Not for reactive WebFlux. Requires manual setup of Testcontainers for the verification suite.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 2 days ago
- Software
- Spring Boot projectMavenorGradleMessage broker (RabbitMQ)Relational database
Docker (for Testcontainers)
Integration tests use Testcontainers, so Docker must be running. On Windows, use Docker Desktop.
Permissions
File Scopes
Reads build files and source code to detect versions and assess the existing code, writes code and tests in the project, and runs the build and tests from the terminal. The build tool and Testcontainers may download dependencies and container images. No external accounts, API keys or credentials are needed.