feat: add support for CoAP transport#308
Conversation
…ssage published by coap can be accepted by mqtt consumer
…message successfully.
…riodly, and remove the session which is expired.
…ther process for RPC reception.
…n from session to datagramChannelManager.
…essage removal when receving ack.
… a subscriptition request.
…equest, without further processing. But the messages sent by session-write function has not been marked.
…and check authToken in connection mode; Move the exception handle in CoapTokenUtil; Remove CoapTokenManager.
RockteMQ-AI
left a comment
There was a problem hiding this comment.
Review by github-manager-bot
Summary
Adds CoAP (Constrained Application Protocol) transport support to RocketMQ-MQTT, enabling IoT devices using CoAP to connect to the RocketMQ messaging system. This is a large feature addition (~5600 lines) with new protocol handlers, session management, and test coverage.
Findings
-
[Critical]
distribution/conf/meta.confanddistribution/conf/service.conf— These files contain hardcoded internal IP addresses (11.159.23.108,11.159.23.111,11.159.23.104) and test credentials (username=test,secretKey=test). These look like development environment values that were accidentally committed. These must be reverted to empty/placeholder values before merge. -
[Warning] PR Scope: This is a very large PR (~5600 lines, 60+ files). Consider splitting into smaller, reviewable chunks:
- CoAP message model and codec (mqtt-common)
- CoAP protocol handlers (mqtt-cs)
- CoAP upstream processors (mqtt-ds)
- Tests
-
[Warning]
MqttServer.java— Adding CoAP UDP listener startup needs review for:- Port conflict handling
- Graceful shutdown of the DatagramChannel
- Resource cleanup on startup failure
-
[Info] Good test coverage — the PR includes unit tests for most new components (CoapDecoder, CoapEncoder, handlers, etc.). This is appreciated for a feature of this size.
-
[Info]
CoapMessage.java— TheintToByteArray(int)method hardcodes 3-byte arrays. Verify this matches the CoAP spec (RFC 7252) token length constraints.
Suggestions
- Must fix: Remove hardcoded IPs and test credentials from config files.
- Consider using Eclipse Californium (the reference CoAP implementation for Java) instead of a custom codec, which would reduce maintenance burden and improve spec compliance.
- Add a README section documenting the CoAP transport feature, its limitations, and configuration.
- Consider adding a feature flag to enable/disable CoAP support, since not all deployments need it.
Automated review by github-manager-bot
No description provided.