The failover transport in ActiveMQ works nicely if one of broker instances goes down - producer automagically switches to the next broker instance what is good.
I was expecting the same behavior if broker reaches it's memory limit (configured through systemUsage
property in activemq.xml). However in this case it just starts to to throw 'Memory is full' warnings in the log, but jmsTemplate.convertAndSend
method in producer's application just hangs.
I tried to set sendFailIfNoSpace="true"
option for systemUsage property. In this case producer application just started to throw org.springframework.jms.ResourceAllocationException: Usage Manager Store is Full
exception on convertAndSend
and did not switch to good broker instance anyway.
Could someone advice how to fail-over on exception and / or 'memory is full' case?