Hi,
I've been building a test automation framework upon snakemq, and have been using it for production testing (exciting stuff). It has worked very well, but I'm encountering an issue with on-disconnect callbacks. If I leave a connection open for a long time, at least an hour, I notice that neither the server (listener) nor the client run a registered on-disconnect callback when one side exits. Disconnects are recognized just fine if I don't let much time pass after the initial connection & last client loop.
Perhaps the issue lies with how I'm running my client:
My server (listener) continuously runs the loop method of its link object, and does this forever. Meanwhile, my client runs its loop method initially to establish a connection, and then holds off running the loop until much later (multiple days). After this goes on for a while, the server seems to lose its ability to catch client disconnects when I forcibly stop the client myself. In any case, my client does run the cleanup() method on its link object when it exits.
Is my connection timing out, because I'm not running the link loop method often enough on the client?
I see three different parameters that I probably need to use & understand:
snakemq.messaging.Messaging.keepalive_interval
snakemq.messaging.Messaging.keepalive_wait
snakemq.link.Link.add_connector((host, port), reconnect_interval)
I've tried a few different combinations of the above 3 parameters and I'm still experiencing the issue - perhaps there is a lot of room for optimization here? I'm wondering if there is something else I need to try before I sink a lot more time tweaking those parameters.
Thanks,
-Jason