# jwcjlu/oannes-parent architecture

> Architecture diagram of the GitHub repository jwcjlu/oannes-parent, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/jwcjlu/oannes-parent
- Repository: https://github.com/jwcjlu/oannes-parent

## Overview

##### Project’s Main Components
- RPC FRAMEWORK CORE: Encompasses the primary modules that implement the RPC logic. This includes:
- oannes-common: Contains general utilities, serialization, logging, service definitions, protocol abstractions, and helpful utilities.
- oannes-cluster: Implements clustering functionality with multiple strategies (failover, fast-fail, load balancing).
- oannes-rpc: Contains the invocation mechanism, proxies, and protocol implementations specifically for the RPC call handling.
- oannes-transport: Provides the underlying network transport via Netty. It also includes the codec implementations, client pool mechanisms, and exchange protocol.
- SERVICE DISCOVERY / REGISTRY: Provided via:
- oannes-registry: Split into separate modules for the API and a Zookeeper-based implementation.
- CONFIGURATION & SPRING INTEGRATION:
- oannes-config: Manages configurable beans, annotation scanning, custom XML schemas, and proper integration with Spring.
- FILTER CHAIN/MIDDLEWARE:
- oannes-filter: Implements the filtering mechanism (e.g., metrics, timeouts, TPS limiting) that intercept RPC calls.
- DEMO APPLICATIONS:
- oannes-demo: Contains examples (demo-service, demo-consumer, demo-api) that demonstrate usage and integration of the entire framework.

##### Relationships and Interactions
- The core modules (common, cluster, rpc, transport) interact closely:
- The rpc module calls into the common utilities for protocol handling and error handling.
- The transport module (built on Netty) is used by the rpc module to handle the underlying network communication.
- The cluster module builds on the basic RPC functions (via common and rpc) and adds load balancing and failover capability.
- The oannes-config module integrates with Spring, enabling seamless Spring configuration. It scans for annotated components in the other modules (especially consumers and service providers) and initializes them.
- The oannes-registry module supports service registration and discovery, which is core for distributed communication.
- The filter module establishes a pipeline (filter chain) that can process requests/responses, and is likely applied within the rpc invocation or transport layers.
- Demo applications reference the API (and sometimes Spring configurations) to start a service provider (demo-service) and a consumer (demo-consumer).

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "RPC FRAMEWORK CORE"
        common["oannes-common"]:::core
        cluster["oannes-cluster"]:::core
        rpc["oannes-rpc"]:::core
        transport["oannes-transport"]:::core
    end

    registry["oannes-registry"]:::service
    config["oannes-config"]:::integration
    filter["oannes-filter"]:::middleware
    demo["oannes-demo"]:::demo

    rpc -->|"uses"| common
    rpc -->|"network"| transport
    cluster -->|"builds_on"| common
    cluster -->|"builds_on"| rpc
    rpc -->|"applies"| filter
    demo -->|"invokes"| rpc
    demo -->|"discovers"| registry
    config -->|"integrates"| demo
    config -->|"scans"| rpc

    click common "https://github.com/jwcjlu/oannes-parent/tree/master/oannes-common/"
    click cluster "https://github.com/jwcjlu/oannes-parent/tree/master/oannes-cluster/"
    click rpc "https://github.com/jwcjlu/oannes-parent/tree/master/oannes-rpc/"
    click transport "https://github.com/jwcjlu/oannes-parent/tree/master/oannes-transport/"
    click registry "https://github.com/jwcjlu/oannes-parent/tree/master/oannes-registry/"
    click config "https://github.com/jwcjlu/oannes-parent/tree/master/oannes-config/"
    click filter "https://github.com/jwcjlu/oannes-parent/tree/master/oannes-filter/"
    click demo "https://github.com/jwcjlu/oannes-parent/tree/master/oannes-demo/"

    classDef core fill:#f9f,stroke:#333,stroke-width:2px;
    classDef integration fill:#bbf,stroke:#333,stroke-width:2px;
    classDef service fill:#ff9,stroke:#333,stroke-width:2px;
    classDef middleware fill:#9f9,stroke:#333,stroke-width:2px;
    classDef demo fill:#fcc,stroke:#333,stroke-width:2px;
```
