Opinionated starter for domain-layer microservices — DDD patterns, CQRS, SAGA orchestration, and reactive event-driven architecture.
- Overview
- Features
- Requirements
- Installation
- Quick Start
- Configuration
- Documentation
- Contributing
- License
Firefly Framework Domain Starter is an opinionated Spring Boot starter for building domain-layer microservices following Domain-Driven Design (DDD) principles. This starter brings together the essential capabilities needed for implementing business logic in a reactive, event-driven architecture.
Unlike a traditional library, this starter is designed to bootstrap domain-tier microservices with pre-configured integrations for:
- Domain-Driven Design (DDD): Aggregate roots, value objects, domain events, and repository patterns
- CQRS: Command/query separation with handler auto-discovery and execution context propagation
- SAGA Orchestration: Distributed transactions via the transactional engine with step event publishing
- Event-Driven Architecture: Reactive domain event publishing through Kafka, RabbitMQ, or other adapters
- Service Communication: Resilient inter-service communication with circuit breakers and retries
This starter automatically wires up JSON structured logging, step event bridges for SAGA integration, and observability infrastructure. It serves as the architectural foundation for domain microservices that implement core business logic while participating in distributed workflows and event streams.
When to use this starter: Building domain-layer microservices that encapsulate business rules, coordinate distributed transactions, and emit domain events to drive downstream processing.
- DDD Building Blocks: Domain entities, aggregates, value objects, and repository abstractions
- CQRS Integration: Automatic command/query bus wiring with fireflyframework-cqrs
- SAGA Support: Step event publisher bridge for distributed transaction orchestration
- Event-Driven Architecture: Seamless integration with fireflyframework-eda for domain event publishing
- Service Client Framework: Reactive inter-service communication with resilience patterns
- Observability: JSON structured logging, metrics, and distributed tracing auto-configuration
- Reactive-First: Built on Project Reactor for non-blocking I/O and backpressure handling
- Clean Architecture: Enforces separation between domain logic and infrastructure concerns
- Java 21+
- Spring Boot 3.x
- Maven 3.9+
<dependency>
<groupId>org.fireflyframework</groupId>
<artifactId>fireflyframework-starter-domain</artifactId>
<version>26.02.06</version>
</dependency>This starter transitively includes:
fireflyframework-cqrsfor command/query handlingfireflyframework-edafor event publishingfireflyframework-clientfor service communicationlib-transactional-engineintegration for SAGA orchestrationfireflyframework-observabilityfor metrics and tracing
@Service
public class AccountDomainService {
private final StepEventPublisherBridge stepEvents;
public AccountDomainService(StepEventPublisherBridge stepEvents) {
this.stepEvents = stepEvents;
}
public Mono<Account> createAccount(CreateAccountRequest request) {
return validateRequest(request)
.flatMap(this::persistAccount)
.flatMap(account -> stepEvents.publish("account-created", account)
.thenReturn(account));
}
}firefly:
domain:
json-logging:
enabled: true
step-events:
enabled: trueNo additional documentation available for this project.
Contributions are welcome. Please read the CONTRIBUTING.md guide for details on our code of conduct, development process, and how to submit pull requests.
Copyright 2024-2026 Firefly Software Solutions Inc.
Licensed under the Apache License, Version 2.0. See LICENSE for details.