# wso2/wso2-axis2-transports architecture

> Architecture diagram of the GitHub repository wso2/wso2-axis2-transports, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-04-20). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/wso2/wso2-axis2-transports
- Repository: https://github.com/wso2/wso2-axis2-transports

## Overview

1. **Repository role and shape**
   - This is a multi-module Maven repository for **Axis2 transport implementations** used in WSO2 products.
   - The code is split into a **shared transport base layer** plus **protocol-specific transport modules** and a **test harness module**.
   - The `features/` directory packages these transports as deployable feature bundles, which matters because the project is meant to be assembled into an Axis2/WSO2 runtime, not used as a single standalone app.

2. **Core architectural center: the `base` module**
   - `modules/base` provides the common transport framework: listener/sender abstractions, polling support, datagram support, worker pools, thread cleanup, metrics, management/JMX views, and service tracking.
   - Most protocol modules inherit from or reuse these base classes rather than implementing transport lifecycle and threading from scratch.
   - This is the main boundary between **transport-agnostic infrastructure** and **protocol-specific behavior**.

3. **Canonical transport data flow**
   - Inbound flow: a protocol listener receives external data, turns it into an Axis2 message using a builder, and hands it into the Axis2 engine as a message context.
   - Outbound flow: Axis2 response or client request state is converted by a formatter into protocol-specific payload, then passed to a transport sender.
   - The shared formatter/builder layer in `base` handles common message representations such as **plain text**, **binary**, and generic text/data-source conversions.

4. **Protocol modules follow the same pattern**
   - The major transports (`jms`, `mail`, `mqtt`, `msmq`, `rabbitmq`, `sms`, `tcp`, `udp`, `xmpp`) each define their own listener, sender, endpoint/out-transport info classes, constants, and utility helpers.
   - This indicates a uniform adapter architecture: each module bridges a specific messaging/network protocol into Axis2’s message-processing model.
   - The naming is consistent enough that an architecture diagram can show each as a “protocol adapter” hanging off the common base.

5. **JMS transport**
   - `modules/jms` is the most elaborate transport module and includes connection factory management, listener/sender classes, reply handling, session wrappers, and content-type rules.
   - It has both a **legacy JMS API path** and a **`jakarta` namespace path**, showing compatibility support for different JMS package generations.
   - Its test suite includes embedded ActiveMQ/Qpid-style environments and request-response/asynchronous client flows, which suggests JMS is treated as a full duplex enterprise messaging integration point.

6. **Mail transport**
   - `modules/mail` supports SMTP/POP/IMAP-style interactions through a request-response transport, listener, sender, and polling table entry.
   - It also includes an authentication subsystem with **basic auth** and **OAuth** handlers, token cache, and OAuth client support.
   - Architecturally, mail is not just message formatting; it has a distinct authentication and polling layer because inbound mail is usually retrieved, not pushed.

7. **RabbitMQ and MQTT transports**
   - `modules/rabbitmq` and `modules/mqtt` each include connection factories/managers, listeners, senders, endpoint descriptors, and protocol-specific recovery/callback handling.
   - RabbitMQ adds channel pools, confirm channels, acknowledgement configuration, timeout handling, and inflight tracking, reflecting stronger broker interaction and delivery semantics.
   - MQTT is lighter, centered on async callbacks and connection management, with similar Axis2 bridging logic.

8. **SMS and MSMQ transports**
   - `modules/sms` is split into **GSM** and **SMPP** subpaths, with message builders/formatters and implementation managers for each delivery mechanism.
   - It also contains sample service repository content and transport configuration, showing that SMS is intended to run in a more container-like Axis2 deployment style.
   - `modules/msmq` includes both transport classes and a `native_support` path plus Camel integration classes, indicating it bridges Axis2 into a Windows-native queueing stack via JNI/native bindings and Camel abstractions.

9. **TCP, UDP, and XMPP**
   - `modules/tcp` and `modules/udp` are lower-level network transports with server/listener, worker/dispatcher, sender, endpoint, and out-transport info classes.
   - UDP additionally has a datagram-oriented path in the base module, which reflects packet-based message dispatch rather than connection-oriented sessions.
   - `modules/xmpp` uses connection factories and packet listeners/utilities, making it another protocol adapter layer, but for XMPP session semantics instead of raw sockets or brokers.

10. **Cross-cutting infrastructure**
   - Common concerns handled centrally include **thread pools**, **watermark-based queueing**, **error propagation**, **metrics collection**, **service tracking**, and **management beans**.
   - These are important boundaries: protocol modules focus on IO and protocol semantics, while the base layer handles concurrency, observability, and lifecycle management.
   - That separation is key to the repository’s architecture and should be shown as shared services feeding all transports.

11. **Testing architecture**
   - `modules/testkit` is a reusable integration-test framework rather than a simple unit-test folder.
   - It provides transport-agnostic test clients, endpoints, channels, embedded servers, Axis2 configuration helpers, message encoders/decoders, and protocol-specific test suites for async and request-response scenarios.
   - Many protocol modules use this harness with embedded external services such as Jetty, GreenMail, or message-broker test environments, which means the repo is optimized for end-to-end transport validation.

12. **Packaging and deployment**
   - The `features/` poms and `modules/testkit` resources suggest the project is built for **bundled deployment into an Axis2/OSGi-style runtime** rather than as a single executable.
   - Transport features are packaged independently, allowing downstream products to include only the protocols they need.
   - The CI workflow in `.github/workflows` and top-level Maven build support the repository as a multi-artifact platform component.

13. **How to draw the architecture diagram**
   - Put **Axis2 core/message engine** in the middle.
   - On the left or top, show the **shared transport base layer**: builders/formatters, listener/sender abstractions, thread pools, metrics, management, and polling/datagram support.
   - Around it, show each **protocol module** as a plug-in adapter: JMS, Mail, MQTT, MSMQ, RabbitMQ, SMS, TCP, UDP, XMPP.
   - On the outside, show the **external systems** they connect to: message brokers, mail servers, telecom gateways, native MSMQ, and raw network peers.
   - Show `testkit` as a separate support layer that exercises the same transport contracts using embedded servers and protocol-specific fixtures.

Main entry points: [`modules/base/src/main/java/org/apache/axis2/transport/base`](https://github.com/wso2/wso2-axis2-transports/tree/master/modules/base/src/main/java/org/apache/axis2/transport/base) (Listener/sender base), [`features`](https://github.com/wso2/wso2-axis2-transports/tree/master/features) (Features), [`modules/udp/src/main/java/org/apache/axis2/transport/udp`](https://github.com/wso2/wso2-axis2-transports/tree/master/modules/udp/src/main/java/org/apache/axis2/transport/udp) (UDP), [`modules/jms/src/main/java/org/apache/axis2/transport/jms`](https://github.com/wso2/wso2-axis2-transports/tree/master/modules/jms/src/main/java/org/apache/axis2/transport/jms) (JMS)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_core["Core runtime"]
  node_axis2_core(("Axis2 engine<br/>message engine"))
  node_base_format["Builders & formatters<br/>shared I/O codecs"]
  node_base_lifecycle["Listener/sender base<br/>transport framework"]
  node_base_concurrency["Threads & queues<br/>execution support"]
  node_base_observability["Metrics & mgmt<br/>cross-cutting support"]
  node_base_datagram["Datagram support<br/>packet transport support"]
end

subgraph group_adapters["Protocol adapters"]
  node_jms["JMS<br/>enterprise broker adapter"]
  node_mail["Mail"]
  node_mqtt["MQTT<br/>broker adapter"]
  node_msmq["MSMQ<br/>native queue adapter"]
  node_rabbitmq["RabbitMQ<br/>broker adapter"]
  node_sms["SMS<br/>telecom adapter"]
  node_tcp["TCP<br/>socket transport"]
  node_udp["UDP<br/>packet transport"]
  node_xmpp["XMPP<br/>chat transport"]
end

subgraph group_support["Support & packaging"]
  node_testkit["Testkit<br/>integration harness"]
  node_features["Features<br/>deployment bundles"]
end

subgraph group_external["External systems"]
  node_brokers[("Brokers & queues<br/>external messaging")]
  node_mail_servers[("Mail servers<br/>external messaging")]
  node_telecom_gateways[("Telecom gateways<br/>external messaging")]
  node_raw_network[("Network peers<br/>external networking")]
end

node_base_format -->|"build/format messages"| node_axis2_core
node_base_lifecycle -->|"deliver contexts"| node_axis2_core
node_base_concurrency -->|"runs IO tasks"| node_base_lifecycle
node_base_observability -->|"tracks runtime"| node_base_lifecycle
node_base_datagram -->|"shared packet flow"| node_udp
node_base_lifecycle -->|"adapter base"| node_jms
node_base_lifecycle -->|"adapter base"| node_mail
node_base_lifecycle -->|"adapter base"| node_mqtt
node_base_lifecycle -->|"adapter base"| node_msmq
node_base_lifecycle -->|"adapter base"| node_rabbitmq
node_base_lifecycle -->|"adapter base"| node_sms
node_base_lifecycle -->|"adapter base"| node_tcp
node_base_lifecycle -->|"adapter base"| node_udp
node_base_lifecycle -->|"adapter base"| node_xmpp
node_jms -->|"connects to"| node_brokers
node_mail -->|"connects to"| node_mail_servers
node_mqtt -->|"connects to"| node_brokers
node_rabbitmq -->|"connects to"| node_brokers
node_msmq -->|"connects to"| node_brokers
node_sms -->|"connects to"| node_telecom_gateways
node_tcp -->|"connects to"| node_raw_network
node_udp -->|"connects to"| node_raw_network
node_xmpp -->|"connects to"| node_raw_network
node_testkit -->|"exercises"| node_axis2_core
node_testkit -->|"validates contracts"| node_base_lifecycle
node_features -->|"packages"| node_jms
node_features -->|"packages"| node_mail
node_features -->|"packages"| node_mqtt
node_features -->|"packages"| node_rabbitmq
node_features -->|"packages"| node_sms
node_features -->|"packages"| node_tcp
node_features -->|"packages"| node_udp
node_features -->|"packages"| node_xmpp

click node_base_format "https://github.com/wso2/wso2-axis2-transports/tree/master/modules/base/src/main/java/org/apache/axis2/format"
click node_base_lifecycle "https://github.com/wso2/wso2-axis2-transports/tree/master/modules/base/src/main/java/org/apache/axis2/transport/base"
click node_base_concurrency "https://github.com/wso2/wso2-axis2-transports/tree/master/modules/base/src/main/java/org/apache/axis2/transport/base/threads"
click node_base_observability "https://github.com/wso2/wso2-axis2-transports/tree/master/modules/base/src/main/java/org/apache/axis2/transport/base"
click node_base_datagram "https://github.com/wso2/wso2-axis2-transports/tree/master/modules/base/src/main/java/org/apache/axis2/transport/base/datagram"
click node_jms "https://github.com/wso2/wso2-axis2-transports/tree/master/modules/jms/src/main/java/org/apache/axis2/transport/jms"
click node_mail "https://github.com/wso2/wso2-axis2-transports/tree/master/modules/mail/src/main/java/org/apache/axis2/transport/mail"
click node_mqtt "https://github.com/wso2/wso2-axis2-transports/tree/master/modules/mqtt/src/main/java/org/apache/axis2/transport/mqtt"
click node_msmq "https://github.com/wso2/wso2-axis2-transports/tree/master/modules/msmq/src/main/java/org/apache/axis2/transport/msmq"
click node_rabbitmq "https://github.com/wso2/wso2-axis2-transports/tree/master/modules/rabbitmq/src/main/java/org/apache/axis2/transport/rabbitmq"
click node_sms "https://github.com/wso2/wso2-axis2-transports/tree/master/modules/sms/src/main/java/org/apache/axis2/transport/sms"
click node_tcp "https://github.com/wso2/wso2-axis2-transports/tree/master/modules/tcp/src/org/apache/axis2/transport/tcp"
click node_udp "https://github.com/wso2/wso2-axis2-transports/tree/master/modules/udp/src/main/java/org/apache/axis2/transport/udp"
click node_xmpp "https://github.com/wso2/wso2-axis2-transports/tree/master/modules/xmpp/src/org/apache/axis2/transport/xmpp"
click node_testkit "https://github.com/wso2/wso2-axis2-transports/tree/master/modules/testkit/src/main/java/org/apache/axis2/transport/testkit"
click node_features "https://github.com/wso2/wso2-axis2-transports/tree/master/features"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_axis2_core,node_base_format,node_base_lifecycle,node_base_concurrency,node_base_observability,node_base_datagram toneBlue
class node_jms,node_mail,node_mqtt,node_msmq,node_rabbitmq,node_sms,node_tcp,node_udp,node_xmpp toneAmber
class node_testkit,node_features toneMint
class node_brokers,node_mail_servers,node_telecom_gateways,node_raw_network toneRose
```

## Components

### Core runtime

Shared transport infrastructure and Axis2 message engine boundary

- **Axis2 engine**: message engine · Consumes inbound message contexts and drives outbound responses
- [Builders & formatters](https://github.com/wso2/wso2-axis2-transports/tree/master/modules/base/src/main/java/org/apache/axis2/format): shared I/O codecs · Common plain text, binary, and data-source conversion layer · `modules/base/src/main/java/org/apache/axis2/format`
- [Listener/sender base](https://github.com/wso2/wso2-axis2-transports/tree/master/modules/base/src/main/java/org/apache/axis2/transport/base): transport framework · Shared listener, sender, polling, and endpoint abstractions · `modules/base/src/main/java/org/apache/axis2/transport/base`
- [Threads & queues](https://github.com/wso2/wso2-axis2-transports/tree/master/modules/base/src/main/java/org/apache/axis2/transport/base/threads): execution support · Worker pools, watermark queues, cleanup, and dispatch tasks · `modules/base/src/main/java/org/apache/axis2/transport/base/threads`
- [Metrics & mgmt](https://github.com/wso2/wso2-axis2-transports/tree/master/modules/base/src/main/java/org/apache/axis2/transport/base): cross-cutting support · Metrics collection, management views, transport MBeans, and service tracking · `modules/base/src/main/java/org/apache/axis2/transport/base`
- [Datagram support](https://github.com/wso2/wso2-axis2-transports/tree/master/modules/base/src/main/java/org/apache/axis2/transport/base/datagram): packet transport support · Shared packet-oriented listener and dispatcher support for UDP-style transports · `modules/base/src/main/java/org/apache/axis2/transport/base/datagram`

### Protocol adapters

Protocol-specific transport implementations

- [JMS](https://github.com/wso2/wso2-axis2-transports/tree/master/modules/jms/src/main/java/org/apache/axis2/transport/jms): enterprise broker adapter · Full-duplex JMS transport with legacy and Jakarta support · `modules/jms/src/main/java/org/apache/axis2/transport/jms`
- [Mail](https://github.com/wso2/wso2-axis2-transports/tree/master/modules/mail/src/main/java/org/apache/axis2/transport/mail): mail transport adapter · SMTP/POP/IMAP request-response transport with polling and auth · `modules/mail/src/main/java/org/apache/axis2/transport/mail`
- [MQTT](https://github.com/wso2/wso2-axis2-transports/tree/master/modules/mqtt/src/main/java/org/apache/axis2/transport/mqtt): broker adapter · Async MQTT listener and sender with connection management · `modules/mqtt/src/main/java/org/apache/axis2/transport/mqtt`
- [MSMQ](https://github.com/wso2/wso2-axis2-transports/tree/master/modules/msmq/src/main/java/org/apache/axis2/transport/msmq): native queue adapter · Windows queue transport with native support and Camel bridge · `modules/msmq/src/main/java/org/apache/axis2/transport/msmq`
- [RabbitMQ](https://github.com/wso2/wso2-axis2-transports/tree/master/modules/rabbitmq/src/main/java/org/apache/axis2/transport/rabbitmq): broker adapter · RabbitMQ transport with pools, confirms, acks, and inflight tracking · `modules/rabbitmq/src/main/java/org/apache/axis2/transport/rabbitmq`
- [SMS](https://github.com/wso2/wso2-axis2-transports/tree/master/modules/sms/src/main/java/org/apache/axis2/transport/sms): telecom adapter · GSM and SMPP transport paths with builders, formatters, and managers · `modules/sms/src/main/java/org/apache/axis2/transport/sms`
- [TCP](https://github.com/wso2/wso2-axis2-transports/tree/master/modules/tcp/src/org/apache/axis2/transport/tcp): socket transport · Connection-oriented server, listener, worker, and sender flow · `modules/tcp/src/org/apache/axis2/transport/tcp`
- [UDP](https://github.com/wso2/wso2-axis2-transports/tree/master/modules/udp/src/main/java/org/apache/axis2/transport/udp): packet transport · Datagram-style listener and sender built around packet dispatch · `modules/udp/src/main/java/org/apache/axis2/transport/udp`
- [XMPP](https://github.com/wso2/wso2-axis2-transports/tree/master/modules/xmpp/src/org/apache/axis2/transport/xmpp): chat transport · Packet-listener based XMPP adapter with client/server connection helpers · `modules/xmpp/src/org/apache/axis2/transport/xmpp`

### Support & packaging

Reusable test harness and deployable feature bundles

- [Testkit](https://github.com/wso2/wso2-axis2-transports/tree/master/modules/testkit/src/main/java/org/apache/axis2/transport/testkit): integration harness · Reusable transport test framework with embedded servers, clients, and validators · `modules/testkit/src/main/java/org/apache/axis2/transport/testkit`
- [Features](https://github.com/wso2/wso2-axis2-transports/tree/master/features): deployment bundles · OSGi-style feature packaging for selected transports · `features`

### External systems

Protocols, servers, brokers, and gateways the transports connect to

- **Brokers & queues**: external messaging · JMS brokers, MQTT brokers, RabbitMQ, and MSMQ endpoints
- **Mail servers**: external messaging · SMTP, POP, and IMAP systems plus OAuth-backed mail access
- **Telecom gateways**: external messaging · GSM and SMPP delivery infrastructure
- **Network peers**: external networking · TCP, UDP, and XMPP peers or servers on the wire

## Connections

- Builders & formatters → Axis2 engine: build/format messages · Converts protocol payloads into Axis2 message content and back
- Listener/sender base → Axis2 engine: deliver contexts · Adapts inbound traffic into Axis2 message contexts and sends responses
- Threads & queues → Listener/sender base: runs IO tasks · Provides worker pools and queueing for listeners and senders
- Metrics & mgmt → Listener/sender base: tracks runtime · Adds metrics, management, and service tracking around transports
- Datagram support → UDP: shared packet flow · Provides packet-oriented listener and dispatcher support
- Listener/sender base → JMS: adapter base · JMS reuses the shared transport lifecycle and sender/listener abstractions
- Listener/sender base → Mail: adapter base · Mail reuses the shared transport lifecycle and polling patterns
- Listener/sender base → MQTT: adapter base · MQTT reuses the shared transport lifecycle and callback handling
- Listener/sender base → MSMQ: adapter base · MSMQ bridges into the shared transport lifecycle and message receiver path
- Listener/sender base → RabbitMQ: adapter base · RabbitMQ reuses the shared transport lifecycle and sender/listener abstractions
- Listener/sender base → SMS: adapter base · SMS implementations plug into the shared transport lifecycle
- Listener/sender base → TCP: adapter base · TCP transport follows the common listener/sender pattern
- Listener/sender base → UDP: adapter base · UDP transport follows the common listener/sender pattern
- Listener/sender base → XMPP: adapter base · XMPP transport follows the common listener/sender pattern
- JMS → Brokers & queues: connects to · Routes messages through JMS broker infrastructure
- Mail → Mail servers: connects to · Sends and retrieves mail via mail servers
- MQTT → Brokers & queues: connects to · Publishes and consumes through MQTT brokers
- RabbitMQ → Brokers & queues: connects to · Uses RabbitMQ broker channels and confirms
- MSMQ → Brokers & queues: connects to · Bridges into MSMQ queues and native support
- SMS → Telecom gateways: connects to · Uses GSM and SMPP delivery infrastructure
- TCP → Network peers: connects to · Speaks directly over TCP sockets
- UDP → Network peers: connects to · Speaks directly over UDP datagrams
- XMPP → Network peers: connects to · Communicates with XMPP servers and peers
- Testkit → Axis2 engine: exercises · Creates Axis2 test clients, endpoints, and validators
- Testkit → Listener/sender base: validates contracts · Drives transport-agnostic listener and sender behavior
- Features → JMS: packages · Bundles JMS transport for deployment
- Features → Mail: packages · Bundles mail transport for deployment
- Features → MQTT: packages · Bundles MQTT transport for deployment
- Features → RabbitMQ: packages · Bundles RabbitMQ transport for deployment
- Features → SMS: packages · Bundles SMS transport for deployment
- Features → TCP: packages · Bundles TCP transport for deployment
- Features → UDP: packages · Bundles UDP transport for deployment
- Features → XMPP: packages · Bundles XMPP transport for deployment
