# assimbly/runtime architecture

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

- Interactive diagram: https://gitdiagram.com/assimbly/runtime
- Repository: https://github.com/assimbly/runtime

## Overview

##### Project type and purpose
- This is a multi-module Java runtime project (“Assimbly runtime”) that provides:
- An Integration engine built on Apache Camel (modules: integration, integrationRest)
- A Message Broker engine built on Apache ActiveMQ (modules: broker, brokerRest)
- Shared utility code (module: commons)
- A “Data Integration Language” layer for configuration (module: dil)
- The “Rest” modules expose management and lifecycle APIs over HTTP; the core modules expose Java APIs.

##### High-level component breakdown
- Java-client tier
– Your own Java application (or Assimbly Gateway) invoking the Java API modules
- REST-client tier
– Any HTTP client (e.g. the Assimbly Gateway UI) calling the integrationRest and brokerRest endpoints
- Service tier
– integrationRest: REST controllers → FlowManagerRuntime, ValidationRuntime, etc.
– brokerRest: REST controllers → BrokerManagerRuntime, QueueManagerRuntime, etc.
– integration: Java API (Integration, CamelIntegration) → Apache Camel engine → routes/flows
– broker: Java API (Broker) → ActiveMQ engine (classic or Artemis) → message broker endpoints
– dil: DIL parser/transpiler → generates Camel route definitions from XML/JSON/YAML → used by integration
– commons: shared utilities (HTTP, assertions, generic helpers)
- Infrastructure & external systems
– Apache Camel (embedded)
– ActiveMQ broker (embedded or external)
– File system (for DIL files, kamelet YAMLs, configurations)
– Optional databases (JDBC, H2, Mongo etc. for persistence in REST modules or event stores)
– Certificate stores / keystores for TLS in REST and DIL validators

##### Interaction & data flow
- Java client “new CamelIntegration()” → calls into integration module → DIL loader (if configured) → builds CamelContext → starts Camel routes
- REST client → HTTP POST/GET → integrationRest controllers → invoke the Java API (IntegrationRuntime) under the covers → manage flows
- Java client “new Broker()” → broker module starts ActiveMQ engine → configure endpoints
- REST client → brokerRest controllers → invoke Broker API → create/delete queues, topics, health checks
- DIL module processes XML/JSON/YAML flow definitions → uses transpiler → outputs Camel DSL → handed to CamelIntegration

##### Architectural patterns & design principles
- Layered architecture:
– API layer (Java API vs REST API)
– Service/Runtime layer (integration, broker logic)
– Infrastructure layer (Camel, ActiveMQ, DB, file system)
- Plugin/extension: dil uses “blocks” and “kamelets” to extend available steps
- Separation of concerns:
– “dil” solely for config parsing, “integration” solely for runtime execution, “integrationRest” solely for HTTP exposure
- Modularization via Maven multi-module: each concern in its own artifact

##### Essential elements
- Clear labels: module names (integration, broker, integrationRest, brokerRest, dil, commons)
- Modules in logical layers: Client, API, Service, Infra, External
- Important frameworks under each module (e.g. Camel under integration, ActiveMQ under broker)

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Client Tier
    subgraph "Client Tier"
        direction TB
        JavaClient["Java Client"]:::external
        RESTClient["REST Client"]:::external
    end

    %% API Layer
    subgraph "API Layer"
        direction TB
        IntegrationAPI["Integration API (Java)"]:::api
        IntegrationRest["Integration REST API"]:::api
        BrokerAPI["Broker API (Java)"]:::api
        BrokerRest["Broker REST API"]:::api
    end

    %% Service/Runtime Layer
    subgraph "Service Tier"
        direction TB
        Commons["commons (Shared Utilities)"]:::util
        DIL["dil (Data Integration Language)"]:::util
        ApacheCamel["Apache Camel Engine"]:::service
        ActiveMQ["ActiveMQ Engine"]:::service
    end

    %% Infrastructure Layer
    subgraph "Infrastructure Layer"
        direction TB
        FileSystem["File System"]:::external
        DB["Databases (JDBC/H2/Mongo)"]:::external
        CertStore["Certificate/Keystore"]:::external
    end

    %% External Systems
    subgraph "External Systems"
        direction TB
        JMS["JMS Endpoints"]:::external
        HTTPEndpoints["HTTP Endpoints"]:::external
    end

    %% Connections
    JavaClient -->|"Java Method"| IntegrationAPI
    JavaClient -->|"Java Method"| BrokerAPI
    RESTClient -->|"HTTP"| IntegrationRest
    RESTClient -->|"HTTP"| BrokerRest

    IntegrationRest -->|"calls Java API"| IntegrationAPI
    BrokerRest -->|"calls Java API"| BrokerAPI

    IntegrationAPI -->|"uses"| DIL
    IntegrationAPI -->|"uses"| Commons
    BrokerAPI -->|"uses"| Commons

    DIL -->|"generates routes"| ApacheCamel
    IntegrationAPI -->|"manages routes"| ApacheCamel
    BrokerAPI -->|"manages broker"| ActiveMQ

    ApacheCamel -->|"reads/writes"| FileSystem
    ApacheCamel -->|"connects"| HTTPEndpoints
    ApacheCamel -->|"connects"| JMS

    ActiveMQ -->|"stores data"| DB
    ActiveMQ -->|"secures"| CertStore
    ActiveMQ -->|"provides"| JMS

    %% Click Events
    click IntegrationAPI "https://github.com/assimbly/runtime/tree/develop/integration/src/main/java/org/assimbly/integration"
    click IntegrationRest "https://github.com/assimbly/runtime/tree/develop/integrationRest/src/main/java/org/assimbly/integrationrest"
    click BrokerAPI "https://github.com/assimbly/runtime/tree/develop/broker/src/main/java/org/assimbly/broker"
    click BrokerRest "https://github.com/assimbly/runtime/tree/develop/brokerRest/src/main/java/org/assimbly/brokerrest"
    click Commons "https://github.com/assimbly/runtime/tree/develop/commons/src/main/java/org/assimbly/commons/utils"
    click DIL "https://github.com/assimbly/runtime/tree/develop/dil/src/main/java/org/assimbly/dil"

    %% Styles
    classDef api fill:#cce5ff,stroke:#004085,color:#004085,stroke-width:1px;
    classDef service fill:#d4edda,stroke:#155724,color:#155724,stroke-width:1px;
    classDef util fill:#fff3cd,stroke:#856404,color:#856404,stroke-width:1px;
    classDef external fill:#e2e3e5,stroke:#6c757d,color:#6c757d,stroke-width:1px;
```
