Changed default behaviour to use persistent sotre, now use in memory as default and not FS moquette.mapdb (Fix issue #242)

This commit is contained in:
andsel
2016-12-31 16:06:18 +01:00
parent a146ffb30e
commit 0f41c9ea08
4 changed files with 11 additions and 9 deletions
+2
View File
@@ -2,6 +2,8 @@ Version 0.9:
Moved canRead check to topic from publish phase to subscribe (#144)
Added javadoc and src jars creations for JCenter/Maven central
Added persisting of clean session flag for already existing client session (fix issue #145)
Moved the message logic management fo FSM, to better control the concurrency.
Changed default config to use in memory store and not default moquette.mapdb
Version 0.8:
Introduced authenticator and authorizator implementations.
@@ -36,7 +36,7 @@ public abstract class IConfig {
setProperty(BrokerConstants.HOST_PROPERTY_NAME, BrokerConstants.HOST);
//setProperty(BrokerConstants.WEB_SOCKET_PORT_PROPERTY_NAME, Integer.toString(BrokerConstants.WEBSOCKET_PORT));
setProperty(BrokerConstants.PASSWORD_FILE_PROPERTY_NAME, "");
setProperty(BrokerConstants.PERSISTENT_STORE_PROPERTY_NAME, BrokerConstants.DEFAULT_PERSISTENT_PATH);
//setProperty(BrokerConstants.PERSISTENT_STORE_PROPERTY_NAME, BrokerConstants.DEFAULT_PERSISTENT_PATH);
setProperty(BrokerConstants.ALLOW_ANONYMOUS_PROPERTY_NAME, Boolean.TRUE.toString());
setProperty(BrokerConstants.AUTHENTICATOR_CLASS_NAME, "");
setProperty(BrokerConstants.AUTHORIZATOR_CLASS_NAME, "");
@@ -47,28 +47,22 @@ public class ConfigurationClassLoaderTest implements IAuthenticator, IAuthorizat
@After
public void tearDown() throws Exception {
m_server.stopServer();
File dbFile = new File(m_config.getProperty(BrokerConstants.PERSISTENT_STORE_PROPERTY_NAME));
if (dbFile.exists()) {
dbFile.delete();
}
}
@Test
public void loadAuthenticator() throws Exception {
Properties props = new Properties(IntegrationUtils.prepareTestProperties());
props.setProperty(BrokerConstants.AUTHENTICATOR_CLASS_NAME, "io.moquette.server.ConfigurationClassLoaderTest");
props.setProperty(BrokerConstants.AUTHENTICATOR_CLASS_NAME, getClass().getName());
startServer(props);
assertTrue(true);
m_server.stopServer();
}
@Test
public void loadAuthorizator() throws Exception {
Properties props = new Properties(IntegrationUtils.prepareTestProperties());
props.setProperty(BrokerConstants.AUTHORIZATOR_CLASS_NAME, "io.moquette.server.ConfigurationClassLoaderTest");
props.setProperty(BrokerConstants.AUTHORIZATOR_CLASS_NAME, getClass().getName());
startServer(props);
assertTrue(true);
m_server.stopServer();
}
@Override
@@ -36,6 +36,12 @@ websocket_port 8080
#*********************************************************************
host 0.0.0.0
#*********************************************************************
# The file for the persistent store, if not specified, use just memory
# no physical persistence
#*********************************************************************
#persistent_store ./moquette_store.mapdb
#*********************************************************************
# acl_file:
# defines the path to the ACL file relative to moquette home dir