The solution involves adjusting the heartBeatToConnectionTtlModifier parameter in your STOMP acceptor configuration in broker.xml. This parameter controls how the broker interprets client heartbeats in relation to connection timeouts.
Implementation
Modify your STOMP acceptor configuration in broker.xml as follows:
<!-- STOMP Acceptor -->
<acceptor name="stomp">tcp://0.0.0.0:61613?tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576;protocols=STOMP;useEpoll=true;heartBeatToConnectionTtlModifier=10.0</acceptor>
Explanation
heartBeatToConnectionTtlModifier: This parameter determines how the broker calculates the connection timeout based on the client's heartbeat settings.
Default value is typically 2.0
Increasing it to 10.0 makes the broker more lenient with heartbeat timing
The formula is: connectionTTL = heartBeatToConnectionTtlModifier * max(clientHeartBeatSendFrequency, clientHeartBeatReceiveFrequency)