espressif / esp-mqtt

ESP32 mqtt component
Apache License 2.0
614 stars 258 forks source link

Make `MQTT_POLL_READ_TIMEOUT_MS` configurable through `menuconfig/sdkconfig` (IDFGH-9196) #245

Closed ItayDumayVayyar closed 1 year ago

ItayDumayVayyar commented 1 year ago

Hey, I have implemented my own MQTT outbox for storing persistent messages in NVS. But I encountered a problem. In esp_mqtt_task() the main logic is to ask the outbox for an item, transmit it, and then poll read for a potential ACK.
https://github.com/espressif/esp-mqtt/blob/bb9c8af9d552b608dd3aabf9617bde757a538ebe/mqtt_client.c#L1562-L1568

It appears that esp_transport_poll_read() is utilized with a fixed value for MQTT_POLL_READ_TIMEOUT_MS, currently set at 1 second. This means that using esp_mqtt_client_enqueue() would result in a slow message rate due to the dependency on the timeout period or receipt of an ACK before requesting the next message from the outbox.

euripedesrocha commented 1 year ago

Hi @ItayDumayVayyar, thanks for the suggestion. I'm working on this feature, it should be available soon.

ItayDumayVayyar commented 1 year ago

Hi @ItayDumayVayyar, thanks for the suggestion. I'm working on this feature, it should be available soon.

Great, thanks! Can you estimate in what ESP-IDF version this change will be included?