# andersonlopez98/dyas-rabbitmq architecture

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

- Interactive diagram: https://gitdiagram.com/andersonlopez98/dyas-rabbitmq
- Repository: https://github.com/andersonlopez98/dyas-rabbitmq

## Overview

##### Main Components
- RabbitMQ Server – This is the external messaging broker that handles the asynchronous message queue.
- Java Producer and Consumer – Under the “demo” directory, the Java implementations (com.example.Producer.java and com.example.Consumer.java) act as a producer to send messages and a consumer to receive them.
- Python Producer and Consumer – In the “demoPy” directory, similar roles are played by the Python scripts (Producer.py and Consumer.py).
- Testing and Build Infrastructure – The “pom.xml” for Maven in the Java project indicates that the Java components are built and managed as a Maven project, and the tests under demo/src/test provide a testing layer.
- External Dependencies – The README indicates reliance on RabbitMQ’s AMQP protocol (via Java’s amqp-client dependency and Python’s pika library).

##### Relationships and Interactions
- Producers initiate outgoing communication by connecting to the RabbitMQ server and publishing messages to a designated queue (for instance, the “hello” queue in the given examples, or a “notifications” queue in the additional example).
- Consumers connect to the RabbitMQ server as well and “listen” on the same queue to process incoming messages.

##### Architectural Patterns and Design Principles
- Asynchronous Messaging – The architecture leverages asynchronous communication through RabbitMQ, decoupling producers and consumers.
- Separation of Concerns – The clear division between Java and Python example implementations (different directories) emphasizes technology-agnostic design for messaging.
- Minimal Coupling with External Broker – Both implementations encapsulate their interactions with the RabbitMQ service through standardized libraries (amqp-client and pika).

##### Relevant Technologies and Frameworks
- Java: Maven for build automation, and the RabbitMQ Java client (amqp-client).
- Python: Use of the Pika library to interact with RabbitMQ.
- RabbitMQ: Serves as the backbone to demonstrate message queuing.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Java Implementation"
        JP["Java Producer"]:::java
        JC["Java Consumer"]:::java
        subgraph "Build & Test Infrastructure"
            POM["pom.xml"]:::infra
            Tests["Tests (demo/src/test)"]:::infra
        end
    end

    subgraph "Python Implementation"
        PP["Python Producer"]:::python
        PC["Python Consumer"]:::python
    end

    RQ["RabbitMQ Server"]:::external

    JP -->|"publishes"| RQ
    PP -->|"publishes"| RQ
    RQ -->|"delivers"| JC
    RQ -->|"delivers"| PC

    click JP "https://github.com/andersonlopez98/dyas-rabbitmq/blob/main/demo/src/main/java/com/example/Producer.java"
    click JC "https://github.com/andersonlopez98/dyas-rabbitmq/blob/main/demo/src/main/java/com/example/Consumer.java"
    click PP "https://github.com/andersonlopez98/dyas-rabbitmq/blob/main/demoPy/Producer.py"
    click PC "https://github.com/andersonlopez98/dyas-rabbitmq/blob/main/demoPy/Consumer.py"
    click POM "https://github.com/andersonlopez98/dyas-rabbitmq/blob/main/demo/pom.xml"
    click Tests "https://github.com/andersonlopez98/dyas-rabbitmq/tree/main/demo/src/test"

    classDef java fill:#E6F7FF,stroke:#1890FF,stroke-width:2px;
    classDef python fill:#FFF2E8,stroke:#FA8C16,stroke-width:2px;
    classDef external fill:#F6FFED,stroke:#52C41A,stroke-width:2px;
    classDef infra fill:#FFF1F0,stroke:#FF4D4F,stroke-width:2px;
```
