How mytang0/brook works
Main Components
• Core Orchestration Engine – Represented by modules such as brook-core and brook-engine. This is where the main execution, flow/task management, caching, locking, and monitoring exist (e.g., FlowExecutor, TaskRegistry, Callback, ExecutorFactory, RateLimiter, etc.).
• Common Utilities – Found in brook-common. These include shared annotations, configuration classes, context management, exception definitions, metadata definitions, and various utility classes (for JSON, reflection, token handling, etc.).
• SPI and Extensions – The brook-spi and brook-spi-extensions modules provide a pluggable mechanism for computing, locking, metadata handling, tasks, and more. This layer uses SPI design patterns to allow for multiple implementations to be integrated via providers.
• Integration/Bootstrapping – The brook-spring-boot suite (starter, autoconfigure, locks, metadata, mybatis, etc.) offers easy integration with Spring Boot ecosystems, handling auto-configuration and registration of implementations. Also, the brook-demo module demonstrates how these components work within a sample Spring Boot application.
• External Flows and Configuration – The flows in brook-demo’s resources (in META-INF/flows) demonstrate how orchestration workflows are defined externally and then parsed/managed by the engine.
Relationships and Interactions
• The brook-core module sits at the heart, handling orchestration tasks. It communicates with:
• The SPI layer (brook-spi and brook-spi-extensions) for extension points, such as configuration, task execution, locking, and metadata handling.
• The brook-engine module, which provides the integration or runtime “front door” for starting flows.
• The brook-spring-boot modules then wrap these core capabilities, providing auto-configuration, dependency injection, and integration points for Spring Boot applications.
• The brook-demo module acts as a client that demonstrates the orchestration engine’s usage (e.g., REST controllers, sample callbacks, and listeners).
Architectural Patterns and Design Principles
• Separation of Concerns: Clear separation between core functionalities (execution engine, task management) and support utilities (configuration, metadata, common annotations).
• Inversion of Control / Dependency Injection: With Spring Boot integrations, much of the wiring is handled via auto-configuration and annotation scanning. Indicate how the spring-boot autoconfigure modules use bean registration (e.g., FlowAutoConfiguration, FlowSPIBeanRegister) to link with core components.
Technologies and Frameworks
• Java (core language).
• Maven (project build/tool, as demonstrated by the multiple pom.xml files).
• Spring Boot (for the integration modules and demo).
• The SPI concepts along with any reflective/extension mechanisms used in the code.