Unified event-driven architecture library with Kafka, RabbitMQ, and Spring Application Events support.
- Overview
- Features
- Requirements
- Installation
- Quick Start
- Configuration
- Documentation
- Contributing
- License
Firefly Framework EDA provides a standardized messaging abstraction for event-driven architectures, supporting multiple broker implementations through a unified publisher/consumer API. It enables reactive event publishing and consumption with built-in support for Apache Kafka, RabbitMQ, and Spring Application Events as transport mechanisms.
The library features annotation-driven event publishing (@EventPublisher, @PublishResult), declarative event listeners (@EventListener), and a comprehensive set of event filtering, serialization, and error handling capabilities. It includes support for JSON, Avro, and Protobuf message serialization formats.
The resilient publisher wrapper provides circuit breaker integration, while the dead letter queue handler ensures no events are lost during processing failures. Metrics collection and health indicators provide full observability into the messaging infrastructure.
- Multi-broker support: Apache Kafka, RabbitMQ, Spring Application Events
- Annotation-driven publishing:
@EventPublisher,@PublishResult - Declarative event listening:
@EventListenerwith SpEL-based filtering - Event envelope pattern with metadata propagation
- Pluggable serialization: JSON, Avro, Protobuf
- Event filtering: type-based, header-based, destination-based, composite
- Dead letter queue (DLQ) handling for failed messages
- Resilient publisher with circuit breaker support
- Dynamic event listener registration at runtime
- AMQP admin auto-configuration for RabbitMQ exchanges and queues
- Custom error handling strategies with metrics and notification handlers
- Health indicators and metrics for Actuator integration
- Spring Boot auto-configuration for Kafka and RabbitMQ
- Java 21+
- Spring Boot 3.x
- Maven 3.9+
- Apache Kafka or RabbitMQ (depending on chosen broker)
<dependency>
<groupId>org.fireflyframework</groupId>
<artifactId>fireflyframework-eda</artifactId>
<version>26.02.07</version>
</dependency>import org.fireflyframework.eda.annotation.EventPublisher;
import org.fireflyframework.eda.annotation.EventListener;
import org.fireflyframework.eda.event.EventEnvelope;
@Service
public class OrderService {
@EventPublisher(topic = "orders")
public Mono<OrderCreatedEvent> createOrder(OrderRequest request) {
// Business logic - return value is automatically published
return Mono.just(new OrderCreatedEvent(request.getId()));
}
}
@Component
public class OrderEventHandler {
@EventListener(topic = "orders")
public Mono<Void> onOrderCreated(EventEnvelope<OrderCreatedEvent> envelope) {
// Handle the event
return processOrder(envelope.getPayload());
}
}firefly:
eda:
broker: kafka # kafka, rabbitmq, spring
kafka:
bootstrap-servers: localhost:9092
consumer:
group-id: my-service
rabbitmq:
host: localhost
port: 5672Additional documentation is available in the docs/ directory:
- Quickstart
- Architecture
- Configuration
- Annotations
- Api Reference
- Publisher Types
- Dynamic Topic Selection
- Eventlistener Examples
- Custom Error Handling
- Examples
- Developer Guide
- Contributing
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.