Aditya
Aditya

Reputation: 151

STOMP stops receiving messages after few mins of inactivity

I am facing a very unusual problem in ActiveMQ and Stomp connection. I have integrated it in my website, and it works very fine when there is any activity on the site or even on the computer (even if the browser in which the site is opened is minimized). Whenever the computer goes in idle mode for more than 10 mins, the connection between ActiveMQ and STOMP is closed and then after that even if user maximizes the browser again, there would be no communication and no updates.

Versions I am using activemq : 5.9.0 STOM : 1.0.9

I am using following configuration settings transportConnector name="wss" uri="wss://0.0.0.0:61614?maximumConnections=1000&wireFormat.maxFrameSize=104857600&wireFormat.maxInactivityDuration=500000000&wireFormat.maxInactivityDurationInitalDelay=36000000&websocket.maxIdleTime=0&transport.useInactivityMonitor=false"

What wrong I am doing? I have tried every possible combination of the above parameters but the result is same with little variation in duration increment in the idle time after which the connection would be lost.

All I want is, whether user is using the browser/computer or not, the connection should remain active.

Thank you in advance for the help provided.

Update 1: Here is the error I am receiving in the log file failed: org.apache.activemq.transport.InactivityIOException: Channel was inactive for too long

Upvotes: 0

Views: 1014

Answers (1)

NiranjanK
NiranjanK

Reputation: 437

ActiveMQConnectionFactory have property called

idleTimeout

which have a default value 30 sec. IF connection have no activity for 30 sec then it will closed by Inactivity monitor but if you want to increase this limit then you should set the IdleTimeout to 15 min. in your Jms ConnectionFactory using method

factory.setIdleTimeout(15*60*1000)

Upvotes: 1

Related Questions