According to this answer, there are benefits from using the "failover" protocol with a "tcp" transport, even with a single address.
In addition to this, the ActiveMQ documentation, the following applies (emphasis mine):
If a JMS broker goes down, ActiveMQ can automatically reconnect to an available JMS broker using the failover: protocol. Not only does this automatically reconnect, it will also resume any temporary destinations, sessions, producers and most importantly consumers.
Does this also apply when using the "vm" transport?
We are seeing frequent issues with queue consumers stopping to pick up messages, while the queue fills up, and we have not found a fix for this yet. This is with ActiveMQ v5.6.0 - we're upgrading to v5.14.5 at the moment, but want to explore additional options, too.
Our current Spring configuration for the ActiveMQConnectionFactory looks like this:
<bean id="jmsConnectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory"
depends-on="amqEmbeddedBroker">
<property name="brokerURL" value="vm://localhost" />
<property name="watchTopicAdvisories" value="false" />
</bean>
Would changing the URL from vm://localhost
to failover:(vm://localhost)
provide any benefit in this case, i.e. safe-guarding against connections being closed for whatever reason? When changing the URL to include the failover:
part, I can see that an instance of FailoverTransport
is created, but does it provide any benefit in the case of the vm
transport?