本文へ移動
cccskills
無料GitHub で公開

event-driven-messaging

Use when implementing Kafka, RabbitMQ, Pulsar, or JMS producers and consumers in Spring Boot 3. Covers event contracts, idempotency, retries, dead-letter handling, ordering, and outbox delivery.

インストール方法を見る

含まれるファイル(4)

  • SKILL.md2.2 KB
  • agents/openai.yaml207 B
  • examples/bad-consumer.java162 B
  • examples/good-consumer.java1.2 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

Event-Driven Messaging

Design for at-least-once delivery unless the complete system proves stronger semantics.

Event contract

  • Use an immutable event envelope with eventId, eventType, occurredAt, schemaVersion, and payload.
  • Treat published schemas as APIs. Add fields compatibly and never silently change meaning.
  • Put correlation and causation IDs in headers or the envelope.
  • Do not publish JPA entities or framework-specific serialization shapes.

Producer rules

  • Publish only after the originating state change is durable.
  • Use a transactional outbox when database state and broker publication must agree.
  • Use deterministic partition keys when per-aggregate ordering matters.
  • Configure delivery timeout and acknowledgements explicitly.

Consumer rules

  • Make handlers idempotent with a durable processed-event record or naturally idempotent write.
  • Keep the transaction boundary around the state change and idempotency marker.
  • Classify transient and permanent failures before configuring retries.
  • Bound retries with backoff, then route poison messages to a dead-letter destination.
  • Preserve the original event, failure reason, and attempt count for replay.

Testing

  • Test serialization compatibility and handler idempotency.
  • Use Testcontainers for broker integration tests.
  • Test duplicate, reordered, delayed, and poison messages.

Examples

  • See examples/good-consumer.java and examples/bad-consumer.java.

Gotchas

  • Agent assumes exactly-once delivery because the broker supports transactions - end-to-end side effects still need idempotency.
  • Agent retries validation failures forever - dead-letter permanent failures promptly.
  • Agent publishes inside a database transaction without an outbox - a crash can split state and event delivery.
  • Agent uses a random partition key - ordering for one aggregate is then lost.
  • Agent deserializes directly into a JPA entity - use a versioned event contract.

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

Use when adding Spring AI-specific model observations, token usage, latency, externally configured cost attribution, advisor telemetry, or protected prompt and completion logging. Use production-observability for general service metrics, health, logs, and OTLP setup.

日本語の概要は準備中です。原文の説明を表示しています。

rrezartprebreza/spring-boot-skills3052026年9月21日 更新

Use when versioning Spring MVC or WebFlux APIs in Spring Boot 3 / Spring Framework 6. Covers explicit URL, header, and media-type strategies, compatibility rules, and deprecation handling.

日本語の概要は準備中です。原文の説明を表示しています。

rrezartprebreza/spring-boot-skills3052026年9月21日 更新

Use when versioning Spring MVC or WebFlux APIs in Spring Boot 4 / Spring Framework 7. Covers built-in mapping versions, request version resolution, defaults, supported versions, and deprecation headers.

日本語の概要は準備中です。原文の説明を表示しています。

rrezartprebreza/spring-boot-skills3052026年9月21日 更新

Use when introducing or correcting grouped Spring Boot configuration, typed property binding, validation, profiles or secret injection. Do not rewrite unrelated single-value configuration.

日本語の概要は準備中です。原文の説明を表示しています。

rrezartprebreza/spring-boot-skills3052026年9月21日 更新

Use when packaging Spring Boot 4 as an OCI image, JVM container, AOT application, or GraalVM native executable. Covers buildpacks, layers, runtime hints, probes, security, and verification.

日本語の概要は準備中です。原文の説明を表示しています。

rrezartprebreza/spring-boot-skills3052026年9月21日 更新

Use when packaging a Spring Boot 3 application as an OCI image or GraalVM native executable. Covers buildpacks, layered images, JVM containers, AOT hints, probes, security, and verification.

日本語の概要は準備中です。原文の説明を表示しています。

rrezartprebreza/spring-boot-skills3052026年9月21日 更新

rrezartprebreza のスキルをすべて見る

このスキルの問題を報告する