Feature/direct messages sdk snapshot - #1833
Draft
muboheng wants to merge 2 commits into
Draft
Conversation
Adds an on-device path for AWS IoT Core direct messages (point-to-point, no cloud subscription). A component subscribes over IPC with subscriptionMode=RECEIVE_ONLY; the Nucleus routes matching inbound messages locally without ever issuing a cloud SUBSCRIBE. - Subscribe (v5): add skipCloudSubscribe, a routing flag (not an MQTT wire option). Unsubscribe is unchanged - receive-only removal matches by (topic, callback) alone. - MqttClient: keep receive-only registrations in a separate set; the router runs an independent second delivery pass over them, matching each filter with MqttTopic.topicIsSupersetOf and invoking each callback in its own try/catch. The "no subscriber" drop is logged only when both the cloud and receive-only passes miss. - MqttProxyIPCAgent: SubscribeToIoTCore branches on subscriptionMode. RECEIVE_ONLY builds a receive-only Subscribe and skips qos validation (qos is meaningless with no cloud subscription); SUBSCRIBE/absent/ unknown keep the existing cloud path. Authorization runs unchanged for both modes. Tests: MqttClientTest (router + receive-only delivery), MqttProxyIPCAgentTest (handler modes + auth), IPCMqttProxyTest (real IPC), and DirectMessageRoutingIntegTest (real IPC handler + real router end to end, asserting no cloud SUBSCRIBE). Note: requires an aws-iot-device-sdk with subscriptionMode; the pom bump to a published SDK is intentionally not committed (kept as a local dev-only change).
| } | ||
| assertThat("an unrecognized subscriptionMode must surface InvalidArgumentsError, not UnmappedDataException", | ||
| cause, instanceOf(InvalidArgumentsError.class)); | ||
| assertThat(cause.getMessage(), containsString("FUTURE_MODE")); |
| } | ||
|
|
||
| @Test | ||
| void GIVEN_no_cloud_and_no_local_match_WHEN_message_received_THEN_dropped_without_error(ExtensionContext context) |
| // conn1 reports it cannot take another subscription, so cmd/A lands on conn1 and cmd/# opens conn2. | ||
| when(mockIndividual1.canAddNewSubscription()).thenReturn(false); | ||
|
|
||
| client.subscribe(SubscribeRequest.builder().topic("cmd/A").callback(cb).build()); |
| when(mockIndividual1.canAddNewSubscription()).thenReturn(false); | ||
|
|
||
| client.subscribe(SubscribeRequest.builder().topic("cmd/A").callback(cb).build()); | ||
| client.subscribe(SubscribeRequest.builder().topic("cmd/#").callback(cb).build()); |
| // cmd/A -> conn1 (first covering connection); cmd/# -> conn2 (also covers cmd/A). | ||
| when(mockIndividual1.canAddNewSubscription()).thenReturn(false); | ||
|
|
||
| client.subscribe(SubscribeRequest.builder().topic("cmd/A").callback(cb).build()); |
| when(mockIndividual1.canAddNewSubscription()).thenReturn(false); | ||
|
|
||
| client.subscribe(SubscribeRequest.builder().topic("cmd/A").callback(cb).build()); | ||
| client.subscribe(SubscribeRequest.builder().topic("cmd/#").callback(cb).build()); |
Point the aws-iot-device-sdk dependency at the snapshot uber jar built from tushar-aws/aws-iot-device-sdk-java-v2 @ fe364de, which adds the SubscriptionMode enum required by the RECEIVE_ONLY feature. * Bump aws-iot-device-sdk 1.31.0 -> 1.33.0-DIRECTMSG-SNAPSHOT (resolved via the existing greengrass-common CloudFront repository) * Bump aws-crt 0.45.0 -> 0.47.0 to match the SDK 1.33.0 CRT pairing * Revert to the public release version once the SDK change ships to Maven Central
muboheng
force-pushed
the
feature/direct-messages-sdk-snapshot
branch
from
August 7, 2026 23:38
43f69ad to
15281d0
Compare
|
Unit Tests Coverage Report
Minimum allowed coverage is Generated by 🐒 cobertura-action against 15281d0 |
|
Integration Tests Coverage Report
Minimum allowed coverage is Generated by 🐒 cobertura-action against 15281d0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue #, if available:
Description of changes:
Why is this change necessary:
How was this change tested:
Any additional information or context required to review the change:
Documentation Checklist:
Compatibility Checklist:
any deprecated method or type.
Refer to Compatibility Guidelines for more information.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.