How lowes/auditor works
Main Components
• Core Library: The core module contains shared utilities such as mappers, DTO converters, constants, and common entity definitions. This serves as a base for both the client and server modules.
• Auditor Client Library: This is provided in the “client” module that contains API and implementation details along with packages for event processing, filtering, and logging. It includes functionalities for both standalone and Spring Boot environments.
• Spring Boot Starter: Located in “client-spring-boot-starter”, this module wraps the client library to ease integration for Spring Boot applications. It provides auto-configuration and pre-initialized auditor instances.
• App Server: Found under the “app” module, this is the deployable service that listens to Kafka events and persists or logs audit data to Elasticsearch. It handles asynchronous processing, event consumption, and repository operations.
• Examples: The “client-example” and “client-example-springboot” projects demonstrate integration with both standalone and Spring Boot mode, helping users understand client usage.
Out the Relationships and Interactions
• Consumption and Persistence: The app server (in the “app” module) listens to Kafka topics. Once events are consumed, they are processed (possibly via event consumers and service layers) and then stored in Elasticsearch using configurations shown in repository modules.
• Core Dependencies: Illustrate that both the client and app modules depend on the core module for common functionality.
• External Integrations: Mark Kafka for event streaming and Elasticsearch for repository functions, as well as external libraries like Project Reactor and jackson-afterburner.
Architectural Patterns & Design Principles
• Asynchronous & Reactive Flow: Emphasize asynchronous processing, using components like separate thread pools and the reactive programming paradigm to highlight performance and scalability.
• Decoupling via Messaging: Show how Kafka decouples the sender (client) from the consumer (app server), enabling eventual consistency.
• Extension Points: Indicate points for configuration, such as auditing event decorators, filters, and runtime configurations that underline customizability.
Relevant Technologies & Frameworks
• Project Reactor: For reactive programming in the app server and client processing.
• Kafka: As the event streaming platform.
• Elasticsearch: For storing and indexing audit logs.
• Spring Boot: For simplified integration using the “client-spring-boot-starter”.
• Gradle: Used for build configuration across modules.
• Jackson-afterburner: To enhance the performance of JSON serialization.