How wso2/wso2-axis2-transports works
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: base Listener/sender base · features Features · udp UDP · jms JMS
Components 21
Core runtime
Shared transport infrastructure and Axis2 message engine boundary
- Axis2 engine · Consumes inbound message contexts and drives outbound responses
- Builders & formatters · Common plain text, binary, and data-source conversion layer
modules/base/src/main/java/org/apache/axis2/format - Listener/sender base · Shared listener, sender, polling, and endpoint abstractions
modules/base/src/main/java/org/apache/axis2/transport/base - Threads & queues · Worker pools, watermark queues, cleanup, and dispatch tasks
modules/base/src/main/java/org/apache/axis2/transport/base/threads - Metrics & mgmt · Metrics collection, management views, transport MBeans, and service tracking
modules/base/src/main/java/org/apache/axis2/transport/base - Datagram 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 · Full-duplex JMS transport with legacy and Jakarta support
modules/jms/src/main/java/org/apache/axis2/transport/jms - Mail · SMTP/POP/IMAP request-response transport with polling and auth
modules/mail/src/main/java/org/apache/axis2/transport/mail - MQTT · Async MQTT listener and sender with connection management
modules/mqtt/src/main/java/org/apache/axis2/transport/mqtt - MSMQ · Windows queue transport with native support and Camel bridge
modules/msmq/src/main/java/org/apache/axis2/transport/msmq - RabbitMQ · RabbitMQ transport with pools, confirms, acks, and inflight tracking
modules/rabbitmq/src/main/java/org/apache/axis2/transport/rabbitmq - SMS · GSM and SMPP transport paths with builders, formatters, and managers
modules/sms/src/main/java/org/apache/axis2/transport/sms - TCP · Connection-oriented server, listener, worker, and sender flow
modules/tcp/src/org/apache/axis2/transport/tcp - UDP · Datagram-style listener and sender built around packet dispatch
modules/udp/src/main/java/org/apache/axis2/transport/udp - XMPP · 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
External systems
Protocols, servers, brokers, and gateways the transports connect to
- Brokers & queues · JMS brokers, MQTT brokers, RabbitMQ, and MSMQ endpoints
- Mail servers · SMTP, POP, and IMAP systems plus OAuth-backed mail access
- Telecom gateways · GSM and SMPP delivery infrastructure
- Network peers · TCP, UDP, and XMPP peers or servers on the wire
Connections 33
- 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