mirror of
https://github.com/floci-io/floci.git
synced 2026-11-24 06:20:24 -05:00
* fix(iot): deliver data-plane publishes to MQTT subscribers A message sent with the IoT Data Publish API stored its retained copy and ran the topic rules, but never reached a connected MQTT client. The data-plane publish now goes through the broker fan-out after the rules, as an MQTT publish does. The fan-out delivers at the lower of the message and subscription QoS, with RETAIN 0, and a retained message sent on subscribe carries RETAIN 1 at the lower of its stored and the subscription QoS, as measured on AWS IoT Core. Publish refuses a qos other than 0 or 1 with AWS's InvalidRequestException messages. Closes floci-io/floci#6627 * fix(iot): allocate packet identifiers for broker publishes Vert.x draws the packet identifier of an outbound publish from an unsynchronized per-endpoint counter. With QoS 1 delivery, two threads fanning out to one client could send two unacknowledged copies under the same identifier. The broker now allocates them from one atomic counter. A retained message stored with a negative qos, which Publish accepted before it validated qos, is sent on subscribe at QoS 0 instead of aborting the replay. * fix(iot): keep MQTT packet identifiers per session One broker-wide counter let copies sent to other clients, QoS 0 included, wrap a client's identifiers while its QoS 1 copy was unacknowledged. Each session now draws QoS 1 identifiers from its own counter, and a QoS 0 copy carries none. * test(iot): share the IoT Data client builder Both IoT Data integration tests now build their IotDataPlaneClient through IotDataRequests.iotDataClient(accessKey), as review asked. The IoT limitations also list that a QoS 1 copy is never retried and has no in-flight limit, where AWS holds further copies at 100 unacknowledged. * test(iot): drive the packet identifier isolation test at QoS 1 QoS 0 copies carry no packet identifier, so the other client's 65,534 copies must be QoS 1 for the test to catch a counter shared by every client. The IoT limitations also say that a data-plane Publish reaches subscribers in every account and region, as the broker has none.