I am using ActiveMQ 5.10.2 and I am trying to test a failover scenario with C++ clients using Apache ActiveMQ CMS (activemq-cpp-library-3.9.5). The configuration for one of the two brokers is:
<broker xmlns="http://activemq.apache.org/schema/core" brokerName="broker-1" dataDirectory="${activemq.data}" useJmx="true">
<managementContext>
<managementContext createConnector="true" connectorPort="1099"/>
</managementContext>
<persistenceAdapter>
<kahaDB directory="${activemq.data}/kahadb"/>
</persistenceAdapter>
<networkConnectors>
<networkConnector
name="broker1->broker2"
uri="static:(failover:(tcp://broker-2:61637))"
duplex="false"
decreaseNetworkConsumerPriority="true"
networkTTL="2"
dynamicOnly="true">
</networkConnector>
</networkConnectors>
<transportConnectors>
<transportConnector name="openwire" updateClusterClients="true" uri="tcp://broker-1:61636?maximumConnections=1000&wireFormat.maxFrameSize=104857600"/>
</transportConnectors>
The client's URL is : failover:(tcp://broker-1:61636,tcp://broker-2:616137)?reconnectSupported=true&timeout=3000
After the producer starts to send the messages to the consumer, I kill the broker-1 expecting to see the transition to broker-2. Instead of this, I am getting the following error:
Thread 16: onException: Exception: type=JMSException, msg=DataInputStream::readLong - Reached EOF
Thread 16: onException: Terminating program...
My question is, if the problem is on the onException Method, or is something wrong with the configuration of the failover mechanism.
Kind Regards