# How/Where to Process Subscribed Messages

**URL:** <https://forum.cedalo.com/t/how-where-to-process-subscribed-messages/776>\
**Category:** MQTT protocol\
**Created:** [April 1, 2023, 7:13pm UTC](https://forum.cedalo.com/t/how-where-to-process-subscribed-messages/776 "2023-04-01T19:13:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![DS256](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.cedalo.com/ds256/32/502_2.png) [@DS256](https://forum.cedalo.com/u/DS256)\
**Post date:** [April 1, 2023, 7:13pm UTC](https://forum.cedalo.com/t/how-where-to-process-subscribed-messages/776/1 "2023-04-01T19:13:28Z")

</div>

I’m new to PAHO MQTT Client functions and subscribing to topics. From experience in Thonny it it appears to be an asynchronous environment with the processing done in the ‘on\_message’ function.

I’m looking for best practices on what to do once a payload is read and processed. I’m going to have additional processing to do and I’m wondering if I should pass the payload off to a spawn program or writing to a monitored file.

Thanks

---

<div class="post-metadata">

**Author:** ![roger.light](https://avatars.discourse-cdn.com/v4/letter/r/838e76/32.png) [@roger.light](https://forum.cedalo.com/u/roger.light)\
**Post date:** [April 4, 2023, 7:29am UTC](https://forum.cedalo.com/t/how-where-to-process-subscribed-messages/776/2 "2023-04-04T07:29:49Z")

</div>

If your extra processing requires more than a small amount of time, it would be best to pass the message to another process/thread so that the on\_message callback can return and hence allow the network loop to continue.

Apart from that, I would say that the specifics of how to do it really depends on what you’re happiest with.

Regards,

Roger

---

<div class="post-metadata">

**Author:** ![Mbongoo](https://avatars.discourse-cdn.com/v4/letter/m/4491bb/32.png) [@Mbongoo](https://forum.cedalo.com/u/Mbongoo)\
**Post date:** [February 11, 2026, 5:08pm UTC](https://forum.cedalo.com/t/how-where-to-process-subscribed-messages/776/3 "2026-02-11T17:08:47Z")

</div>

I develop applications in BASIC language using Mosquitto\_Pub and Mosquitto\_Sub.

I would like my applications to display errors occuring when executing Mosquitto\_Pub and Mosquitto\_Sub.

How can I do that ?
