0

In an attempt to mitigate the effect of deadlocks in my application I am considering setting up my ActiveMQ server to abort slow consumers. I can get this working OK, but the problem is that my Spring DefaultMessageListenerContainer never restarts the closed consumers, somewhat defeating the point of detecting when a consumer is blocked.

I have tried the following:

  • Changed the cache level of the container to CACHE_NONE ensure it's not a problem with it keeping hold of a closed consumer/session
  • Switched to a raw ActiveMQConnectionFactory rather than a PooledConnectionFactory to ensure it's not the pool keeping hold of a closed session/connection
  • Reverted to the default SimpleAsyncTaskExecutor rather than a pooled executor to ensure it's not a problem with keeping hold of threads that are somehow stuck

None of these have worked. Is there a way to get the DefaultMessageListenerContainer to automatically create new consumers if they are closed by ActiveMQ?

Robert Johnson
  • 632
  • 6
  • 25
  • `> deadlocks in my application ` - if the listener container thread(s) are "stuck" in the listener code, there is nothing the container can do - it can't detect the closed consumer until the thread returns to the container. You need to fix the deadlocks, sorry. – Gary Russell Nov 08 '17 at 13:56
  • I see, thanks. I was simulating a deadlocked thread by using an effectively infinite Thread.sleep; however I have changed this to simply sleep for a minute or so and the consumers come back once the thread returns, thus proving your point. – Robert Johnson Nov 08 '17 at 14:39

0 Answers0