The B4R rMQTT library is based on the well known
Arduino PubSubClient library written by Nick O'Leary. It's a subset of this library - with the most important/used methods wrapped. I do have a scenario that requires some of the additional methods to be wrapped as well. Specifically:
I think these are very useful for sending chunks of large payload to MQTT. One easy to understand use case is sending an image byte payload to MQTT. I do this in B4i, B4J all the time and it works great. If I have an image stored in SPIFFS, SD Card, or even if I am downloading the image via HTTP - it's necessary to be able to chunk and stream the payload to the MQTT broker using write(payload,length).
In fact the last scenario is exactly what I'm looking to accomplish. On my esp8266 sketch, I'm downloading a jpeg snapshot via HTTP from an IP Camera and temporarily storing it in SPIFFS (the image I don't think would be more than 200KB (in reality it's a max of 120KB). I want to publish the image bytes to an MQTT topic so the receiver (B4J, B4i, etc.) can receive the image and display it.
The advantage of this is that the broker should be able to queue up the chunks and when the EndPublish is receive notify the subscribers as normal - it's then business as usual on the receiving side.
The advantages of this are great - I can have a small esp8266 or esp32 device that's connected to an MQTT broker on the internet (like cloudmqtt or my own broker at a VPS) that pulls images (or anything else) from devices on a local network and publishes it. My receivers don't need direct access to the cameras (no firewalls to worry about) and everything is very secure.
Hopefully I've built the case for this
- I don't thin kit would be to terribly difficult to add this.