|Re: Is it permitted to publish in message callback? [message #1815766 is a reply to message #1815731]
||Thu, 10 October 2019 07:47
| Liam Fry
Registered: October 2019
As it turns out, yes, you can publish while inside the message handler.|
After much trial and error, I found a solution but not the cause.
The solution: I had to raise my QoS from 0 to 1 on both publish and subscribe. If I don't raise the QoS, in my situation, I found that 97.2% of all "published while in message handler" messages were never delivered. Once QoS was raised to 1, delivery rate reached 100%. Unfortunately, raising the QoS to 1 has added an average of 800ms to message delivery time with approximately 12% of publications taking up to 3 seconds to be delivered.
UPDATE: I failed to note in my original post: all components - broker and my clients - are running on the same host. These times are stunningly bad and it does not bode well for when my application is released to the network.
I think it's worth noting that, when I alter my application in such a way as to move publications outside the message handler, delivery rate is fast and 100%, even with QoS at 0. Unfortunately, re-working my application so that no publications ever occur from within the message handler breaks functionality for which there is no easy solution at this time.
Powered by FUDForum
. Page generated in 0.03574 seconds