79541192

Date: 2025-03-28 10:42:18
Score: 0.5
Natty:
Report link

Solution

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)

Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: abhishek yadav