Skip to content

Commit d4d6c5a

Browse files
sunilpalacherlaminbi
authored andcommitted
[IoT] Fix publish while reconnecting error reporting (#427)
* Problem: Publishing silently fails when client is reconnecting and offline queues are disabled. Fix: Allow application to handle republishing of failed messages OR enable offline queues by throwing an exception under these conditions.
1 parent 97ec032 commit d4d6c5a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

aws-android-sdk-iot/src/main/java/com/amazonaws/mobileconnectors/iot/AWSIotMqttManager.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1262,6 +1262,8 @@ public void publishData(byte[] data, String topic, AWSIotMqttQos qos,
12621262
AWSIotMqttMessageDeliveryCallback.MessageDeliveryStatus.Fail,
12631263
userData);
12641264
}
1265+
} else {
1266+
throw new AmazonClientException("Client is reconnecting and publishing from offline queue is disabled.");
12651267
}
12661268
} else {
12671269
throw new AmazonClientException("Client is disconnected or not yet connected.");

0 commit comments

Comments
 (0)