public MQTTClient(MQTTConnectionInfo conn, ConnectionMgr conmgr) throws Exception {
try {
clientId = conn.getClientId();
mqttClient = ClientFactory.getConnection(conn, conmgr);
username =conn.getUsername();
log.info("-- inside MqttClient == While Connecting : "+username.toString() + mqttClient.getState());
} catch (Exception e) {
e.printStackTrace();
throw e;
}
}
This resource is not properly closed and released in all situations. how to close getConnection()