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 orchestration engine
- 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, orchestration engine 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
- Orchestration Support: Saga, TCC, and Workflow patterns via fireflyframework-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.07</version>
</dependency>This starter transitively includes:
fireflyframework-cqrsfor command/query handlingfireflyframework-edafor event publishingfireflyframework-clientfor service communicationfireflyframework-orchestrationfor Saga, TCC, and Workflow orchestrationfireflyframework-observabilityfor metrics and tracing
@Service
@Saga(name = "create-account")
public class AccountSaga {
@SagaStep(id = "validate", compensate = "rollbackValidation")
public Mono<ValidationResult> validate(@Input CreateAccountRequest request) {
return validateRequest(request);
}
@SagaStep(id = "persist", dependsOn = "validate", compensate = "deleteAccount")
public Mono<Account> persist(@FromStep("validate") ValidationResult result) {
return persistAccount(result);
}
public Mono<Void> deleteAccount(@FromStep("persist") Account account) {
return removeAccount(account.getId());
}
}firefly:
domain:
json-logging:
enabled: true
orchestration:
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 Foundation.
Licensed under the Apache License, Version 2.0. See LICENSE for details.