Hello,

I've just started using Activemq so please excuse me if this has been
already answered. 

I'm using failover with two brokers, host1 and host2, and this connection
uri: 

failover:(tcp://host1:61617,tcp://host2:61617)

So the consumer randomly connects to one of the brokers. When i stop that
broker, the consumer reconnects to the other one. However, if after this i
stop the second one, the program stops instead of trying to reconnect. It
launches the same exception as when it successfully reconnects, and tries to
reconnect, but the program stops. Here are the traces after it connected to
host 2,  reconnected to host1 and i stopped it:

14:19:27.433 [ActiveMQ Transport: tcp://host1/ip1:61617] DEBUG
o.a.a.transport.tcp.TcpTransport - Stopping transport tcp://host1/ip1:61617
14:19:27.433 [ActiveMQ Transport: tcp://host1/ip1:61617] WARN 
o.a.a.t.failover.FailoverTransport - Transport (host1/ip1:61617) failed to
tcp://host1:61617 , attempting to automatically reconnect due to:
java.io.EOFException
14:19:27.448 [ActiveMQ Transport: tcp://host1/ip1:61617] DEBUG
o.a.a.t.failover.FailoverTransport - Transport failed with the following
exception:
java.io.EOFException: null
        at java.io.DataInputStream.readInt(DataInputStream.java:375) 
~[na:1.6.0_23]
        at
org.apache.activemq.openwire.OpenWireFormat.unmarshal(OpenWireFormat.java:269)
~[activemq-core-5.5.0.jar:5.5.0]
        at
org.apache.activemq.transport.tcp.TcpTransport.readCommand(TcpTransport.java:227)
~[activemq-core-5.5.0.jar:5.5.0]
        at
org.apache.activemq.transport.tcp.TcpTransport.doRun(TcpTransport.java:219)
~[activemq-core-5.5.0.jar:5.5.0]
        at
org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:202)
~[activemq-core-5.5.0.jar:5.5.0]
        at java.lang.Thread.run(Thread.java:662) [na:1.6.0_23]
14:19:27.448 [ActiveMQ Transport: tcp://host1/ip1:61617] DEBUG
o.apache.activemq.ActiveMQConnection - transport interrupted, dispatchers: 1
14:19:27.448 [ActiveMQ Transport: tcp://host1/ip1:61617] DEBUG
o.apache.activemq.ActiveMQConnection - notified failover transport
(unconnected) of pending interruption processing for:
ID:28APO0174-2998-1316521115351-0:1
14:19:27.448 [ActiveMQConnection[ID:28APO0174-2998-1316521115351-0:1]
Scheduler] DEBUG o.a.activemq.ActiveMQMessageConsumer -
ID:28APO0174-2998-1316521115351-0:1:1:1 clearing dispatched list (0) on
transport interrupt
14:19:27.448 [ActiveMQConnection[ID:28APO0174-2998-1316521115351-0:1]
Scheduler] DEBUG o.apache.activemq.ActiveMQConnection -
transportInterruptionProcessingComplete for:
ID:28APO0174-2998-1316521115351-0:1
14:19:27.448 [ActiveMQConnection[ID:28APO0174-2998-1316521115351-0:1]
Scheduler] DEBUG o.apache.activemq.ActiveMQConnection - notified failover
transport (unconnected) of interruption completion for:
ID:28APO0174-2998-1316521115351-0:1
14:19:27.448 [ActiveMQ Task-3] DEBUG o.a.a.t.failover.FailoverTransport -
urlList connectionList:[tcp://host2:61617, tcp://host1:61617], from:
[tcp://host1:61617, tcp://host2:61617]
14:19:27.448 [ActiveMQ Task-3] DEBUG o.a.a.t.failover.FailoverTransport -
Attempting connect to: tcp://host2:61617

Also, if before stopping the second broker, i start again the first one, the
same happens, the program crashes.

I'd like to know if this is the right behaviour and, in that case, if
something can be done to make it work as i want.



--
View this message in context: 
http://activemq.2283324.n4.nabble.com/Failover-reconnection-questions-tp3826592p3826592.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Reply via email to