Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Paho » How to resolve "Persistence already in use (32200)"
How to resolve "Persistence already in use (32200)" [message #1699138] Mon, 22 June 2015 02:54 Go to next message
supot numnaun is currently offline supot numnaunFriend
Messages: 1
Registered: June 2015
Junior Member
Hello,

I use mqttv3 client(java), when i publish message (height frequency) i get error "Persistence already in use (32200)"

Thank you.
Here my code
try {
            MqttClient client = new MqttClient("tcp://localhost:1884", MqttAsyncClient.generateClientId());
            client.setCallback(new MqttCallback() {
				
				@Override
				public void messageArrived(String arg0, MqttMessage arg1) throws Exception {
					log.info("messageArrived");
				}
				
				@Override
				public void deliveryComplete(IMqttDeliveryToken arg0) {
					log.info("deliveryComplete");
				}
				
				@Override
				public void connectionLost(Throwable arg0) {
					log.info("connectionLost");
				}
			}); 
MqttClient before connecting to broker
            client.connect();
            client.publish(topicName, payload, qos, true);

            String time = new Timestamp(System.currentTimeMillis()).toString();
            log.info(String.format("Publishing at:%s to Topic:%s Message:%s", time, topicName, new String(payload)));
            Thread.sleep(2000); 
            client.disconnect();
        } catch (MqttException ex) {
        	log.error(ex);
        	throw new RuntimeException(ex.getMessage());
        } catch (InterruptedException ex) {
        	log.error(ex);
        }
Re: How to resolve "Persistence already in use (32200)" [message #1702272 is a reply to message #1699138] Tue, 21 July 2015 09:05 Go to previous message
Ian Craggs is currently offline Ian CraggsFriend
Messages: 83
Registered: March 2013
Member
If you are disconnecting and connecting each time you publish, then the disconnect may be taking a little while before you try to reconnect again. If you are publishing "with high frequency" then it would be better to keep a connection open, and just call publish when you want to send a message.
Previous Topic:Java client: Trouble connecting to CloudMQTT server with username password
Next Topic:Paho Java, M2JE problem, compliling my program
Goto Forum:
  


Current Time: Thu Apr 25 10:14:02 GMT 2024

Powered by FUDForum. Page generated in 0.02893 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top