How to handle connection timeout?

104 views
Skip to first unread message

Gregory Iiams

unread,
Feb 15, 2018, 2:38:46 PM2/15/18
to stompest
I'm pretty much using the following example:

But, the broker is timing me out after around 4.5 minutes.  I've been thinking maybe I could use the session method? But can't work out how to implement that.

So, I tried to use heartbeat.  But when I connect to broker using version_1_1, I get the following error:

stompest.error.StompProtocolError: Invalid SUBSCRIBE frame (id header mandatory in version 1.1) [headers={'ack': 'client-individual', 'destination': '/topic/c.c.p.v.ism.advisory'}]

I'm not sure how to set id header? The documentation I found just mentions id, but doesn't specifically say how to set it.

Any help for this noob would be hugely appreciated! :)

nikipore

unread,
Feb 15, 2018, 2:55:56 PM2/15/18
to stom...@googlegroups.com
Read about the STOMP protocol here, then look at the implementation of stompest.protocol.StompSpec here, and you will find a constant StompSpec.ID_HEADER. Of course, you could as well write the value 'id' of the constant, but that would be considered bad style because you refer to the implementation (as opposed to the specification) of the protocol.

The test cases are also a treasure trove for usage examples, e.g. here.

Gregory Iiams

unread,
Feb 15, 2018, 4:03:52 PM2/15/18
to stompest
I managed to find the test cases a few minutes ago!  So, I'm able to connect using version 1_1, and now should be able to use the client.beat method.  :)  

There is an example here: .beat example

So, how would I actually use the client.beat() from within my while loop?


On Thursday, February 15, 2018 at 1:55:56 PM UTC-6, nikipore wrote:
Read about the STOMP protocol here, then look at the implementation of stompest.protocol.StompSpec here, and you will find a constant StompSpec.ID_HEADER. Of course, you could as well write the value 'id' of the constant, but that would be considered bad style because you refer to the implementation (as opposed to the specification) of the protocol).
Reply all
Reply to author
Forward
0 new messages