giuseppe-trisciuoglio/developer-kit / plugins/developer-kit-java/skills/spring-boot-event-driven-patterns
spring-boot-event-driven-patterns
VerifiedProvides Event-Driven Architecture (EDA) patterns for Spring Boot — creates domain events, configures ApplicationEvent and @TransactionalEventListener, sets up Kafka producers and consumers, and implements the transactional outbox pattern for reliable distributed messaging. Use when implementing event-driven systems in Spring Boot, setting up async messaging with Kafka, publishing domain events from DDD aggregates, or needing reliable event publishing with the outbox pattern.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 9.0 KB |
| references/aggregate-root-patterns.md | markdown | 8.4 KB |
| references/configuration.md | markdown | 2.8 KB |
| references/dependency-setup.md | markdown | 2.1 KB |
| references/domain-events-design.md | markdown | 7.1 KB |
| references/event-driven-patterns-reference.md | markdown | 12.5 KB |
| references/event-handling.md | markdown | 11.3 KB |
| references/event-publishing.md | markdown | 8.2 KB |
| references/examples.md | markdown | 14.5 KB |
| references/outbox-pattern.md | markdown | 10.9 KB |
| references/testing-strategies.md | markdown | 12.3 KB |
references/configuration.md
View on GitHub# Event-Driven Architecture Configuration
## Basic Configuration
### application.properties
```properties
# Server Configuration
server.port=8080
# Kafka Configuration
spring.kafka.bootstrap-servers=localhost:9092
spring.kafka.producer.key-serializer=org.apache.kafka.common.serialization.StringSerializer
spring.kafka.producer.value-serializer=org.springframework.kafka.support.serializer.JsonSerializer
# Spring Cloud Stream Configuration
spring.cloud.stream.kafka.binder.brokers=localhost:9092
```
### application.yml
```yaml
server:
port: 8080
spring:
kafka:
bootstrap-servers: localhost:9092
producer:
key-serializer: org.apache.kafka.common.serialization.StringSerializer
value-serializer: org.springframework.kafka.support.serializer.JsonSerializer
consumer:
key-deserializer: org.apache.kafka.common.serialization.StringDeserializer
value-deserializer: org.springframework.kafka.support.serializer.JsonDeserializer
properties:
spring.json.trusted.packages: "*"
cloud:
stream:
kafka:
binder:
brokers: localhost:9092
bindings:
productCreated-in-0:
destination: product-events
group: order-service
```
## Advanced Configuration
### Kafka Producer Configuration
```yaml
spring:
kafka:
producer:
acks: all
retries: 3
properties:
retry.backoff.ms: 1000
enable.idempotence: true
compression-type: snappy
```
### Kafka Consumer Configuration
```yaml
spring:
kafka:
consumer:
auto-offset-reset: earliest
enable-auto-commit: false
max-poll-records: 100
listener:
ack-mode: manual_immediate
```
### Error Handling Configuration
```yaml
spring:
kafka:
producer:
properties:
retries: 3
retry.backoff.ms: 1000
consumer:
properties:
max.poll.interval.ms: 300000
```
## Spring Cloud Stream Bindings
### Producer Binding
```yaml
spring:
cloud:
stream:
bindings:
productCreated-out-0:
destination: product-events
producer:
partition-count: 3
```
### Consumer Binding
```yaml
spring:
cloud:
stream:
bindings:
productCreated-in-0:
destination: product-events
group: order-service
consumer:
max-attempts: 3
back-off-initial-interval: 1000
```
## Environment-Specific Configuration
### Development
```yaml
spring:
kafka:
bootstrap-servers: localhost:9092
```
### Production
```yaml
spring:
kafka:
bootstrap-servers: kafka1.prod.example.com:9092,kafka2.prod.example.com:9092,kafka3.prod.example.com:9092
properties:
security.protocol: SSL
ssl.truststore.location: /etc/kafka/truststore.jks
ssl.keystore.location: /etc/kafka/keystore.jks
```
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack." | Stars: 197k | Updated | Claude CodeCodex | Verified | Install |
| ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |