|
| 1 | +# Supported Protocols and Management Interfaces |
| 2 | + |
| 3 | +This document summarizes the client-facing and management/admin protocols supported by the Maps Messaging Server, with code and configuration pointers. All ports are configurable; values below reflect the defaults in the provided config files. |
| 4 | + |
| 5 | + |
| 6 | +## Discovery and bootstrapping |
| 7 | +- Protocols are discovered via ServiceLoader: |
| 8 | + - Protocol implementations: src/main/java/io/mapsmessaging/network/protocol/impl/**/* (registered via ProtocolImplFactory) |
| 9 | + - Endpoint/transport servers: src/main/java/io/mapsmessaging/network/io/impl/**/* (registered via EndPointServerFactory) |
| 10 | +- Feature flags gate loading (see SubSystemManager and NetworkManager): |
| 11 | + - Protocols: feature "protocols.<name>" (e.g., protocols.mqtt, protocols.nats) |
| 12 | + - Network transports: feature "network.<name>" (e.g., network.tcp, network.udp) |
| 13 | +- YAML configuration drives listeners and defaults: |
| 14 | + - Network endpoints: src/main/resources/NetworkManager.yaml (and NetworkManagerDocker.yaml) |
| 15 | + - REST API: src/main/resources/RestApi.yaml |
| 16 | + - JMX, system topics, etc.: src/main/resources/MessageDaemon.yaml |
| 17 | + - Auth: src/main/resources/AuthManager.yaml |
| 18 | + |
| 19 | + |
| 20 | +## Client-facing protocols |
| 21 | + |
| 22 | +### MQTT v3.1.1 |
| 23 | +- Implementation: src/main/java/io/mapsmessaging/network/protocol/impl/mqtt/* |
| 24 | + - Factory: MQTTProtocolFactory.java (declares "MQTT version 3.1.1") |
| 25 | +- Default endpoints (NetworkManager.yaml): |
| 26 | + - tcp://:::1883/ (protocol: mqtt) |
| 27 | + - ssl://0.0.0.0:1892/ (protocols: mqtt, ws) — MQTT over WebSocket supported here |
| 28 | +- Authentication: username/password (Connect), enforced via AuthManager (JAAS). TLS optional. |
| 29 | + |
| 30 | +### MQTT v5.0 |
| 31 | +- Implementation: src/main/java/io/mapsmessaging/network/protocol/impl/mqtt5/* |
| 32 | + - Factory: MQTT5ProtocolFactory.java (declares "MQTT version 5.0") |
| 33 | +- Endpoints: same listener types as MQTT 3.1.1 when configured for mqtt in YAML. |
| 34 | +- Authentication: username/password and optional enhanced auth; TLS optional. |
| 35 | + |
| 36 | +### AMQP 1.0 |
| 37 | +- Implementation: src/main/java/io/mapsmessaging/network/protocol/impl/amqp/* |
| 38 | + - Uses Apache Qpid Proton-J (pom.xml: org.apache.qpid:proton-j) |
| 39 | + - Factory: AMQPProtocolFactory.java |
| 40 | +- Default endpoints (NetworkManager.yaml): |
| 41 | + - tcp://0.0.0.0:5672/ (protocol: amqp) |
| 42 | + - ssl://0.0.0.0:5692/ (protocol: amqp) |
| 43 | +- Authentication: SASL (PLAIN/ANONYMOUS etc.) via Proton; per-endpoint SASL config supported (EndPointServerConfigDTO.saslConfig). TLS optional. |
| 44 | +- WebSocket subprotocol: "amqp" when ws/wss is enabled (see WebSocket section below). |
| 45 | + |
| 46 | +### STOMP 1.1/1.2 |
| 47 | +- Implementation: src/main/java/io/mapsmessaging/network/protocol/impl/stomp/* |
| 48 | + - Supported versions: 1.1 and 1.2 (BaseConnectListener.java) |
| 49 | + - Factory: StompProtocolFactory.java |
| 50 | +- Default endpoints (NetworkManager.yaml): |
| 51 | + - tcp://0.0.0.0:8674/ (protocols: stomp, ws) |
| 52 | + - ssl://0.0.0.0:8695/ (protocols: stomp, wss) |
| 53 | +- Authentication: login/passcode headers (anonymous if not supplied), enforced via AuthManager. TLS optional. |
| 54 | +- WebSocket subprotocols: v10.stomp, v11.stomp, v12.stomp. |
| 55 | + |
| 56 | +### NATS (v2.0) |
| 57 | +- Implementation: src/main/java/io/mapsmessaging/network/protocol/impl/nats/* |
| 58 | + - Factory: NatsProtocolFactory.java |
| 59 | + - getVersion() returns "2.0" |
| 60 | +- Default endpoint (NetworkManager.yaml): |
| 61 | + - tcp://0.0.0.0:4222/ (protocol: nats) |
| 62 | +- Authentication: optional user/pass in CONNECT; enforced via AuthManager. TLS optional. |
| 63 | + |
| 64 | +### CoAP (RFC 7252/7641/7959) |
| 65 | +- Implementation: src/main/java/io/mapsmessaging/network/protocol/impl/coap/* |
| 66 | + - Factory: CoapProtocolFactory.java (notes RFCs) |
| 67 | +- Default endpoints (NetworkManager.yaml): |
| 68 | + - udp://0.0.0.0:5683/ (protocol: coap) |
| 69 | + - dtls://0.0.0.0:5684/ (protocol: coap) |
| 70 | +- Transport/auth: UDP and DTLS supported; DTLS configurable in YAML. |
| 71 | + |
| 72 | +### MQTT-SN v1.2 and v2.0 |
| 73 | +- Implementation: src/main/java/io/mapsmessaging/network/protocol/impl/mqtt_sn/* (v1_2, v2_0) |
| 74 | + - Factory: MQTT_SNProtocolFactory.java |
| 75 | + - Interface manager: MQTTSNInterfaceManager.java (selects v1.2 or v2.0 based on CONNECT) |
| 76 | +- Default endpoints (NetworkManager.yaml): |
| 77 | + - udp://0.0.0.0:1884/ (protocol: mqtt-sn) |
| 78 | + - dtls://0.0.0.0:1886/ (protocol: mqtt-sn) |
| 79 | +- Transport/auth: UDP/DTLS; username/password optional; DTLS configurable. |
| 80 | + |
| 81 | +### WebSocket (RFC 6455, encapsulation) |
| 82 | +- Implementation: src/main/java/io/mapsmessaging/network/protocol/impl/websockets/* |
| 83 | + - Factory: WebSocketProtocolFactory.java; handshake in Connecting.java |
| 84 | + - Subprotocols supported (when allowed by endpoint protocols): mqtt, amqp, v10.stomp, v11.stomp, v12.stomp |
| 85 | +- Endpoints: enabled when endpoint "protocols" includes ws (or wss). Examples in NetworkManager.yaml: |
| 86 | + - ssl://0.0.0.0:1892/ (protocols: mqtt, ws) |
| 87 | + - tcp://0.0.0.0:8674/ (protocols: stomp, ws) |
| 88 | + |
| 89 | +### LoRaWAN Semtech UDP gateway |
| 90 | +- Implementation: src/main/java/io/mapsmessaging/network/protocol/impl/semtech/* |
| 91 | + - Factory: SemTechProtocolFactory.java |
| 92 | + - Config DTO: dto/rest/config/protocol/impl/SemtechConfigDTO.java (maps inbound/outbound/status topics) |
| 93 | +- Endpoint: UDP port is user-configurable (commonly 1700). Not enabled by default in NetworkManager.yaml; add a UDP endpoint with protocol: semtech. |
| 94 | + |
| 95 | +### NMEA-0183 (serial) |
| 96 | +- Implementation: src/main/java/io/mapsmessaging/network/protocol/impl/nmea/* |
| 97 | +- Example (commented) in NetworkManager.yaml shows serial usage: |
| 98 | + - serial://ttyUSB0,9600,8,N,1/ with protocol: NMEA-0183 |
| 99 | + |
| 100 | + |
| 101 | +## Transports / listeners |
| 102 | +- TCP: src/main/java/io/mapsmessaging/network/io/impl/tcp/* (TCPEndPointServerFactory) |
| 103 | +- SSL/TLS: src/main/java/io/mapsmessaging/network/io/impl/ssl/* |
| 104 | +- UDP: src/main/java/io/mapsmessaging/network/io/impl/udp/* |
| 105 | +- DTLS: src/main/java/io/mapsmessaging/network/io/impl/dtls/* |
| 106 | +- Serial: src/main/java/io/mapsmessaging/network/io/impl/serial/* |
| 107 | +- LoRa: src/main/java/io/mapsmessaging/network/io/impl/lora/* |
| 108 | +- Proxy Protocol: EndPointConfigDTO supports proxyProtocolMode and allowedProxyHosts |
| 109 | + |
| 110 | + |
| 111 | +## Default endpoints/ports (from NetworkManager.yaml) |
| 112 | +- MQTT: tcp://:::1883/ (mqtt) |
| 113 | +- MQTT + WebSocket (TLS): ssl://0.0.0.0:1892/ (mqtt, ws) |
| 114 | +- NATS: tcp://0.0.0.0:4222/ (nats) |
| 115 | +- STOMP: tcp://0.0.0.0:8674/ (stomp, ws) |
| 116 | +- STOMP TLS: ssl://0.0.0.0:8695/ (stomp, wss) |
| 117 | +- AMQP: tcp://0.0.0.0:5672/ (amqp) |
| 118 | +- AMQP TLS: ssl://0.0.0.0:5692/ (amqp) |
| 119 | +- MQTT-SN: udp://0.0.0.0:1884/ (mqtt-sn) |
| 120 | +- MQTT-SN DTLS: dtls://0.0.0.0:1886/ (mqtt-sn) |
| 121 | +- CoAP: udp://0.0.0.0:5683/ (coap) |
| 122 | +- CoAP DTLS: dtls://0.0.0.0:5684/ (coap) |
| 123 | +- Docker example (NetworkManagerDocker.yaml): tcp://0.0.0.0:9000/ (protocol: all → amqp, mqtt, stomp, nats, ws) |
| 124 | + |
| 125 | + |
| 126 | +## Authentication |
| 127 | +- Central manager: src/main/java/io/mapsmessaging/auth/AuthManager.java; config in src/main/resources/AuthManager.yaml |
| 128 | + - JAAS-based; requires -Djava.security.auth.login.config=<path> at runtime when authenticationEnabled=true |
| 129 | + - On first boot, creates initial users (admin/user) with random passwords under MAPS_DATA/.security |
| 130 | +- Protocol-level: |
| 131 | + - MQTT 3/5: username/password in CONNECT; v5 supports enhanced auth (AuthenticationContext) |
| 132 | + - STOMP: login/passcode headers; if absent, attempts anonymous |
| 133 | + - NATS: user/pass in CONNECT |
| 134 | + - AMQP: SASL via Proton; per-endpoint SASL (EndPointServerConfigDTO.saslConfig) |
| 135 | +- TLS/DTLS available for endpoints (NetworkManager.yaml → global.security.tls/dtls), with optional client-certificate requirements |
| 136 | +- Proxy Protocol support at endpoint level (EndPointConfigDTO: proxyProtocolMode, allowedProxyHosts) |
| 137 | + |
| 138 | + |
| 139 | +## Management and administration |
| 140 | +- REST API (Jersey/Grizzly) |
| 141 | + - Base path: /api/v1 (src/main/java/io/mapsmessaging/rest/api/Constants.java) |
| 142 | + - Config: src/main/resources/RestApi.yaml; code: src/main/java/io/mapsmessaging/rest/RestApiServerManager.java |
| 143 | + - Default: http://0.0.0.0:8080 (TLS optional via RestApi.yaml) |
| 144 | + - Swagger/OpenAPI enabled by default; endpoints registered in MapsRestServerApi.java and other resources under io.mapsmessaging.rest.api.impl.* |
| 145 | + - Health endpoints: |
| 146 | + - /health (plain text): src/main/java/io/mapsmessaging/rest/api/impl/ConsulHealth.java |
| 147 | + - /api/v1/server/health and /api/v1/server/status (JSON): ServerDetailsApi.java |
| 148 | + - Other: /api/v1/ping, plus auth/destination/interface/schema/device/logging/ML endpoints when enabled |
| 149 | +- JMX |
| 150 | + - Enabled by default (MessageDaemon.yaml: EnableJMX: true). Beans under io.mapsmessaging.admin, network.*.jmx, etc. |
| 151 | +- Jolokia (JMX over HTTP) |
| 152 | + - Optional bridge; default disabled (src/main/resources/jolokia.yaml, default port 8778) |
| 153 | +- Metrics |
| 154 | + - Exposed via JMX; a Prometheus JMX exporter mapping is provided at src/main/resources/prometheus_config.yml |
| 155 | +- Discovery/Registration |
| 156 | + - Consul integration registers endpoint metadata (MessageDaemon.buildMetaData; ConsulManagerFactory) |
| 157 | + |
| 158 | + |
| 159 | +## Key code entry points |
| 160 | +- Bootstrap: src/main/java/io/mapsmessaging/MessageDaemon.java |
| 161 | +- Subsystems: src/main/java/io/mapsmessaging/SubSystemManager.java |
| 162 | +- Network manager: src/main/java/io/mapsmessaging/network/NetworkManager.java |
| 163 | +- Endpoint URL parsing: src/main/java/io/mapsmessaging/network/EndPointURL.java |
| 164 | +- EndPoint config packing/unpacking: src/main/java/io/mapsmessaging/config/network/EndPointConfigFactory.java |
| 165 | + |
| 166 | + |
| 167 | +## Configuration files |
| 168 | +- Network endpoints and protocol defaults: src/main/resources/NetworkManager.yaml |
| 169 | +- Docker example: src/main/resources/NetworkManagerDocker.yaml |
| 170 | +- REST API: src/main/resources/RestApi.yaml |
| 171 | +- Message daemon (JMX, system topics, compression, etc.): src/main/resources/MessageDaemon.yaml |
| 172 | +- Authentication: src/main/resources/AuthManager.yaml |
| 173 | +- Jolokia: src/main/resources/jolokia.yaml |
| 174 | +- Prometheus JMX exporter mapping: src/main/resources/prometheus_config.yml |
0 commit comments