You're using a non-durable subscription on your topic, aren't you? That's
your (primary) problem: you're losing messages around the time of the
failover because your consumer isn't subscribed during that period of time.

It's possible that the broker is actually losing a few messages, especially
if you're using async sends as your primary configuration, but you're
losing 1000 messages because you're using a configuration where that's the
expected behavior. Once you get that fixed, if you're still seeing message
loss, we can try to help dig deeper into it.

Also, you referenced reducing a timeout to 1 ms. Which timeout was that?

Tim

On Mon, Dec 10, 2018, 2:51 AM PedroRP <pedro.rami...@techonrails.com wrote:

> Hi Tim!
>
> My sender app is sending text messages with the text: "Message (sequence)".
> The sender's log is showing the message after send it. This is the log:
>
> Message 6291
> Message 6292
> Message 6293
> Message 6294
> Message 6295
> 2018-12-10 10:37:43.175  WARN 8732 --- [.45:61626@55241]
> o.a.a.t.failover.FailoverTransport       : Transport
> (tcp://172.18.13.45:61626) failed , attempting to automatically reconnect:
> {}
>
> java.io.EOFException: null
>         at java.io.DataInputStream.readInt(DataInputStream.java:392)
> ~[na:1.8.0_181]
>         at
>
> org.apache.activemq.openwire.OpenWireFormat.unmarshal(OpenWireFormat.java:268)
> ~[activemq-all-5.15.0.jar:5.15.0]
>         at
>
> org.apache.activemq.transport.tcp.TcpTransport.readCommand(TcpTransport.java:240)
> ~[activemq-all-5.15.0.jar:5.15.0]
>         at
> org.apache.activemq.transport.tcp.TcpTransport.doRun(TcpTransport.java:232)
> ~[activemq-all-5.15.0.jar:5.15.0]
>         at
> org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:215)
> ~[activemq-all-5.15.0.jar:5.15.0]
>         at java.lang.Thread.run(Thread.java:748) [na:1.8.0_181]
>
> 2018-12-10 10:37:50.567  INFO 8732 --- [ActiveMQ Task-1]
> o.a.a.t.failover.FailoverTransport       : Successfully reconnected to
> tcp://172.18.13.45:61616
> Message 6296
> Message 6297
> Message 6298
> Message 6299
>
> The consumer's log is the following:
>
> TopicMessageConsumer Received message [ Message 6292 ]
> TopicMessageConsumer Received message [ Message 6293 ]
> TopicMessageConsumer Received message [ Message 6294 ]
> TopicMessageConsumer Received message [ Message 6295 ]
> 2018-12-10 10:37:43.175  WARN 6360 --- [.45:61626@55240]
> o.a.a.t.failover.FailoverTransport       : Transport
> (tcp://172.18.13.45:61626) failed , attempting to automatically reconnect:
> {}
>
> java.io.EOFException: null
>         at java.io.DataInputStream.readInt(DataInputStream.java:392)
> ~[na:1.8.0_181]
>         at
>
> org.apache.activemq.openwire.OpenWireFormat.unmarshal(OpenWireFormat.java:268)
> ~[activemq-all-5.15.0.jar:5.15.0]
>         at
>
> org.apache.activemq.transport.tcp.TcpTransport.readCommand(TcpTransport.java:240)
> ~[activemq-all-5.15.0.jar:5.15.0]
>         at
> org.apache.activemq.transport.tcp.TcpTransport.doRun(TcpTransport.java:232)
> ~[activemq-all-5.15.0.jar:5.15.0]
>         at
> org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:215)
> ~[activemq-all-5.15.0.jar:5.15.0]
>         at java.lang.Thread.run(Thread.java:748) [na:1.8.0_181]
>
> 2018-12-10 10:37:43.175  WARN 6360 --- [.45:61626@55242]
> o.a.a.t.failover.FailoverTransport       : Transport
> (tcp://172.18.13.45:61626) failed , attempting to automatically reconnect:
> {}
>
> java.io.EOFException: null
>         at java.io.DataInputStream.readInt(DataInputStream.java:392)
> ~[na:1.8.0_181]
>         at
>
> org.apache.activemq.openwire.OpenWireFormat.unmarshal(OpenWireFormat.java:268)
> ~[activemq-all-5.15.0.jar:5.15.0]
>         at
>
> org.apache.activemq.transport.tcp.TcpTransport.readCommand(TcpTransport.java:240)
> ~[activemq-all-5.15.0.jar:5.15.0]
>         at
> org.apache.activemq.transport.tcp.TcpTransport.doRun(TcpTransport.java:232)
> ~[activemq-all-5.15.0.jar:5.15.0]
>         at
> org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:215)
> ~[activemq-all-5.15.0.jar:5.15.0]
>         at java.lang.Thread.run(Thread.java:748) [na:1.8.0_181]
>
> 2018-12-10 10:37:50.533  INFO 6360 --- [ActiveMQ Task-6]
> o.a.a.t.failover.FailoverTransport       : Successfully reconnected to
> tcp://172.18.13.45:61616
> 2018-12-10 10:37:51.586  INFO 6360 --- [ActiveMQ Task-6]
> o.a.a.t.failover.FailoverTransport       : Successfully reconnected to
> tcp://172.18.13.45:61616
> TopicMessageConsumer Received message [ Message 7290 ]
> TopicMessageConsumer Received message [ Message 7291 ]
> TopicMessageConsumer Received message [ Message 7292 ]
> TopicMessageConsumer Received message [ Message 7293 ]
>
> I'm killing the broker ungracefully (kill -9).
>
> I test the app with async and sync sending. Both cases with the same
> result.
>
> The above logs are using the following url to connect to the brokers:
>
>
> failover:(tcp://broker1:61616,tcp://broker2:61626)?jms.useAsyncSend=false&trackMessages=true&timeout=1
>
> Thanks!
>
>
>
> --
> Sent from:
> http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html
>

Reply via email to