# santanusinha/dropwizard-rabbitmq-actors architecture

> Architecture diagram of the GitHub repository santanusinha/dropwizard-rabbitmq-actors, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-03-31). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/santanusinha/dropwizard-rabbitmq-actors
- Repository: https://github.com/santanusinha/dropwizard-rabbitmq-actors

## Overview

- Actor Abstraction – Represent the core actor concept. This includes interfaces and base classes (e.g. Actor, BaseActor, UnmanagedBaseActor, and ActorConfig) which define messaging behaviors.
- RabbitMQ Connectivity – This module manages the connection configuration and management. Include components such as RMQConnection, ConnectionRegistry, ConnectionConfig, and the connection strategy classes (e.g. DefaultConnectionStrategy, SharedConnectionStrategy).
- Configuration and Metrics – Highlight modules that manage runtime configuration, metric collection and reporting. Components to include are configuration classes (e.g. RMQConfig, Broker, MetricConfig) and metrics classes (e.g. MetricData, RMQMetricObserver).
- Retry Strategies – Show the retry mechanism which is implemented with different strategies (e.g., NoRetryStrategy, CountLimited and TimeLimited Retry Strategies).
- Utility and Common Modules – Don’t forget helper utilities like NamingUtils and CommonUtils that support the overall functioning.

##### Establish Relationships and Data Flow
- Bidirectional communication between the Actors and the Exception Handling components, which intercept and process errors.
- Connection strategies and retry components connected to the RabbitMQ Connectivity module, showing how message delivery is retried upon failure.
- That the configuration modules feed settings to almost every other component (actors, connectivity, exception handling, and retry logic).

##### Important Architectural Patterns and Design Principles
- Modularity – The structure segregates core functionalities (actors, connectivity, metrics, etc.) into distinct packages. Emphasize loose-coupling by showing how each module interfaces with others through well-defined contracts.
- Abstraction and Extensibility – The actor abstraction and plug-in style for retry, exception handling, and connectivity strategies indicate a design focused on extensibility.
- Integration with Dropwizard – Stress that this bundle is intended to be plugged into a Dropwizard project, so there is a clear boundary between the bundle (library) and the application itself.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Library Integration Layer"
        LI1["RabbitmqActorBundle"]:::library
        LI2["RabbitmqActorBundleConfiguration"]:::library
    end

    subgraph "Actor Abstraction (Interfaces & Base Classes)"
        AA1["Actor Abstraction"]:::abstraction
    end

    subgraph "RabbitMQ Connectivity (Connections & Strategies)"
        RC1["RMQ Connectivity"]:::connectivity
        RC2["Connection Strategies"]:::connectivity
    end

    subgraph "Configuration & Metrics"
        CM1["Configuration"]:::config
        CM2["Metrics"]:::config
    end

    subgraph "Exception Handling"
        EH1["Exception Handling"]:::exception
    end

    subgraph "Retry Strategies"
        RS1["Retry Strategies Base"]:::retry
        RS2["Retry Implementations"]:::retry
    end

    subgraph "Utility & Common Modules"
        UC1["Common Modules"]:::utility
        UC2["NamingUtils (Base Utils)"]:::utility
        UC3["CommonUtils (Utils)"]:::utility
    end

    subgraph "External Systems"
        DW["Dropwizard Framework"]:::external
        RABBIT["RabbitMQ Server"]:::external
    end

    %% Relationships
    LI1 -->|"integrates_with"| DW
    LI2 -->|"configures"| DW

    LI1 -->|"initializes"| AA1
    LI1 -->|"supports_connectivity"| RC1

    AA1 -->|"sends_messages_to"| RC1
    AA1 -->|"reports_metrics_to"| CM2
    AA1 -->|"error_handling_bridge"| EH1
    EH1 -->|"error_handling_bridge"| AA1

    RC1 -->|"retry_on_failure"| RS1
    RC1 -->|"employs_strategies"| RC2
    RC1 -->|"connects_to"| RABBIT
    RC1 -->|"reports_metrics_to"| CM2

    CM1 -->|"configures"| AA1
    CM1 -->|"configures"| RC1
    CM1 -->|"configures"| EH1
    CM1 -->|"configures"| RS1

    RS1 -->|"leads_to"| RS2

    EH1 -->|"reports_errors_to"| CM2

    UC1 -->|"supports"| AA1
    UC1 -->|"supports"| RC1
    UC1 -->|"supports"| EH1
    UC1 -->|"supports"| RS1
    UC1 --> UC2
    UC1 --> UC3

    %% Click Events
    click LI1 "https://github.com/santanusinha/dropwizard-rabbitmq-actors/blob/master/src/main/java/io/appform/dropwizard/actors/RabbitmqActorBundle.java"
    click LI2 "https://github.com/santanusinha/dropwizard-rabbitmq-actors/blob/master/src/main/java/io/appform/dropwizard/actors/RabbitmqActorBundleConfiguration.java"
    click AA1 "https://github.com/santanusinha/dropwizard-rabbitmq-actors/tree/master/src/main/java/io/appform/dropwizard/actors/actor"
    click RC1 "https://github.com/santanusinha/dropwizard-rabbitmq-actors/tree/master/src/main/java/io/appform/dropwizard/actors/connectivity"
    click RC2 "https://github.com/santanusinha/dropwizard-rabbitmq-actors/tree/master/src/main/java/io/appform/dropwizard/actors/connectivity/strategy"
    click CM1 "https://github.com/santanusinha/dropwizard-rabbitmq-actors/tree/master/src/main/java/io/appform/dropwizard/actors/config"
    click CM2 "https://github.com/santanusinha/dropwizard-rabbitmq-actors/tree/master/src/main/java/io/appform/dropwizard/actors/metrics"
    click EH1 "https://github.com/santanusinha/dropwizard-rabbitmq-actors/tree/master/src/main/java/io/appform/dropwizard/actors/exceptionhandler"
    click RS1 "https://github.com/santanusinha/dropwizard-rabbitmq-actors/tree/master/src/main/java/io/appform/dropwizard/actors/retry"
    click RS2 "https://github.com/santanusinha/dropwizard-rabbitmq-actors/tree/master/src/main/java/io/appform/dropwizard/actors/retry/impl"
    click UC1 "https://github.com/santanusinha/dropwizard-rabbitmq-actors/tree/master/src/main/java/io/appform/dropwizard/actors/common"
    click UC2 "https://github.com/santanusinha/dropwizard-rabbitmq-actors/tree/master/src/main/java/io/appform/dropwizard/actors/base/utils"
    click UC3 "https://github.com/santanusinha/dropwizard-rabbitmq-actors/tree/master/src/main/java/io/appform/dropwizard/actors/utils"

    %% Styles
    classDef library fill:#f9e79f,stroke:#7d6608,stroke-width:2px;
    classDef abstraction fill:#aed6f1,stroke:#2471a3,stroke-width:2px;
    classDef connectivity fill:#a9dfbf,stroke:#196f3d,stroke-width:2px;
    classDef config fill:#fad7a0,stroke:#d68910,stroke-width:2px;
    classDef exception fill:#f5b7b1,stroke:#922b21,stroke-width:2px;
    classDef retry fill:#d2b4de,stroke:#6c3483,stroke-width:2px;
    classDef utility fill:#f9e79f,stroke:#7d6608,stroke-width:2px;
    classDef external fill:#d6eaf8,stroke:#2874a6,stroke-width:2px;
```
