I'm using MQTT in android to communicate with an ActiveMQ server. I used this example to implement the android mqtt client: http://dalelane.co.uk/blog/?p=1599. When I first open the android app it connects to the ActiveMQ and everything works. When I close the application, delete the app data and reopen the android to try and reconnect to ActiveMQ I get the following error in ActiveMQ:
2013-09-29 19:25:50,064 | WARN | Transport Connection to: tcp://192.168.0.108:54395 failed: java.io.EOFException | org.apache.activemq.broker.TransportConnection.Transport | ActiveMQ Transport: tcp:///192.168.0.108:54395@1883
2013-09-29 20:18:20,417 | WARN | Failed to add Connection ID:32132151513546-2:5, reason: javax.jms.InvalidClientIDException: Broker: localhost - Client: dbasdfasdfe0b already connected from tcp://192.168.0.108:59211 | org.apache.activemq.broker.TransportConnection | ActiveMQ Transport: tcp:///192.168.0.108:36745@1883
I'm guessing it has something to do with not disconnecting from the server before trying to reconnect. Maybe I can configure ActiveMQ to delete the unused connection and disconnect the client sooner when ActiveMQ figures that the client got disconnected?