Activemq disconnects me after 4.5 minutes

21 views
Skip to first unread message

Gregory Iiams

unread,
Feb 15, 2018, 3:00:36 PM2/15/18
to stompest
I'm using the synchronous client.  Pretty much exactly as the example says!

When activemq 'disconnects' my client, it just seems to unload it.  Stompest doesn't see it, and the tcp connection stays open.  

So, I guess this is a basic python question, but if I'm running the client in a while loop... how can I make sure I stay connected?

Would using the session method help me?  (I've not been able to quite figure out how to make a session actually connect and subscribe to a topic.)

I tried setting up heartbeat, but it complains about an ID header.  (I see an older mail about this, perhaps I just need to set an id header argument in the client.subscribe() function...)

Or, do I somehow run my connection on a timer, and re-authenticate and reconnect every 4 minutes?  (This definitely seems incorrect lol.  And I'm not entirely sure how I would do that.)

nikipore

unread,
Feb 15, 2018, 3:03:24 PM2/15/18
to stompest
Well, heart-beating with the synchronous client is your business and amounts to using loops, time.sleep() or whatever. You can look at the unit tests as this works, but in general that's a bad idea, and I would either negotiate with the server not to use heart-beating or switch to stompest.async which heart-beats for you.

Gregory Iiams

unread,
Feb 15, 2018, 4:03:52 PM2/15/18
to stompest
AH!!! I'll play with that then!

Thanks again man! Oder vielen dank :)
Reply all
Reply to author
Forward
0 new messages