Hi Rob,
I've done some experiments, I set up a STOMP 1.2 client with heartbeating off and acknowledgements set to auto,
connected to 61618, then subscribed to /topic/TRAIN_MVT_ALL_TOC. After a minute, I get an ERROR frame, and the
broker hangs up. Here's the error frame in question:
ERROR
message:AMQ229014\c Did not receive data from /nnn.nnn.nnn.nnn\c55388 within the 60000ms connection TTL. The connection will now be closed.
^@
Artemis' TTL feature is meant to prevent dead clients holding connections open while doing nothing themselves,
but if you've got no heartbeating and no acknowledgements, you're sending nothing, which means that after
60 seconds, without fail, you will be disconnected.
Gozirra only supports a subset of STOMP 1.0, but heartbeating was first specified in 1.1. Despite being
specified in 1.0, it also doesn't support acknowledgements either, something the original author describes as
"gratuitous bloat" in the readme.
The code is enough of a mess that I haven't worked out whether or how it deals with disconnects, it might
or might not tell you if you set up an error listener, but you haven't done so.
In the short term, I'd suggest that one possible untested fix is modifying Gozirra to unilaterally send
heartbeats. All versions of STOMP allow any number of linebreaks between messages, part of the basis for
the feature in later versions, so what you'd need to do is send a linebreak (\r\n or \n are both legal)
to the broker every so often, within that TTL window.
In the medium (or even short) term, I'd suggest ditching the library. I've written STOMP client libraries that
can cope with the rather more demanding Darwin push port, I have an extremely low opinion on Gozirra. I don't
think it's possible to paper over the cracks and build quality software on top of this.
(I'm starting to think a wiki list of recommendations and anti-recommendations for STOMP clients might be an idea)
Evelyn