diff --git a/.gitignore b/.gitignore index be5a7c70..8030c881 100644 --- a/.gitignore +++ b/.gitignore @@ -49,6 +49,8 @@ maven-metadata.xml /bin/ broker/config/git.properties distribution/src/main/resources/git.properties +license/target +server/target broker/h2db broker/media common/target diff --git a/broker/config/wildfirechat.conf b/broker/config/wildfirechat.conf index c8288726..8a6f4de9 100755 --- a/broker/config/wildfirechat.conf +++ b/broker/config/wildfirechat.conf @@ -3,7 +3,7 @@ #********************************************************************* #服务器的接入IP。给客户端提供是${server.ip}和${http_port}。 #客户端会从${http_port}端口获取到长链接端口。 -server.ip 192.168.1.100 +server.ip 0.0.0.0 ##原生客户端长链接端口 port 1883 @@ -26,7 +26,7 @@ host 0.0.0.0 ##本地绑定端口 local_port 80 -##是否使用内置DB。0使用mysql;1使用h2db +##是否使用内置DB。0使用mysql;1使用h2db;2使用mysql+mongodb。社区版只支持0和1,专业版支持2 embed.db 0 ##服务器管理接口密钥 @@ -98,6 +98,16 @@ push.android.server.address http://localhost:8085/android/push push.ios.server.address http://localhost:8085/ios/push +#********************************************************************* +# MongoDB configuration +#********************************************************************* +#专业版支持,社区版请忽略 +#mongodb.client_uri mongodb://[username:password@]host1[:port1][,host2[:port2],...[,hostN[:portN]]][/[database][?options]] +#mongodb.client_uri mongodb://host1:27017,host2:27017,host3:27017/wfchat?replicaSet=myReplicaSet +mongodb.client_uri mongodb://wfc:123456@localhost:27017/wfchat +mongodb.database wfchat +mongodb.data_expire_days 1096 + #********************************************************************* # Sensitive configuration #********************************************************************* diff --git a/broker/pom.xml b/broker/pom.xml index d6a58007..ebc28fda 100755 --- a/broker/pom.xml +++ b/broker/pom.xml @@ -233,6 +233,11 @@ 5.2.4 + + org.mongodb + mongo-java-driver + 3.4.1 + diff --git a/broker/src/main/java/io/moquette/BrokerConstants.java b/broker/src/main/java/io/moquette/BrokerConstants.java index 5acf3867..4a94b440 100755 --- a/broker/src/main/java/io/moquette/BrokerConstants.java +++ b/broker/src/main/java/io/moquette/BrokerConstants.java @@ -106,6 +106,10 @@ public final class BrokerConstants { public static final String MESSAGE_Forward_Url = "message.forward.url"; + public static final String MONGODB_Client_URI = "mongodb.client_uri"; + public static final String MONGODB_Database = "mongodb.database"; + public static final String MONGODB_Data_Expire_Days = "mongodb.data_expire_days"; + public static final String MESSAGE_ROAMING = "message.roaming"; diff --git a/distribution/src/main/resources/wildfirechat.conf b/distribution/src/main/resources/wildfirechat.conf index 246ce465..2df20132 100755 --- a/distribution/src/main/resources/wildfirechat.conf +++ b/distribution/src/main/resources/wildfirechat.conf @@ -26,7 +26,7 @@ host 0.0.0.0 ##本地绑定端口 local_port 80 -##是否使用内置DB。0使用mysql;1使用h2db +##是否使用内置DB。0使用mysql;1使用h2db;2使用mysql+mongodb。社区版只支持0和1,专业版支持2 embed.db 1 ##服务器管理接口密钥 @@ -99,6 +99,15 @@ push.android.server.address http://localhost:8085/android/push ##苹果推送服务器地址 push.ios.server.address http://localhost:8085/ios/push +#********************************************************************* +# MongoDB configuration +#********************************************************************* +#专业版支持,社区版请忽略 +#mongodb.client_uri mongodb://[username:password@]host1[:port1][,host2[:port2],...[,hostN[:portN]]][/[database][?options]] +#mongodb.client_uri mongodb://host1:27017,host2:27017,host3:27017/wfchat?replicaSet=myReplicaSet +mongodb.client_uri mongodb://wfc:123456@localhost:27017/wfchat +mongodb.database wfchat +mongodb.data_expire_days 1096 #********************************************************************* # Netty Configuration diff --git a/pom.xml b/pom.xml index 472b68e1..920c6e43 100755 --- a/pom.xml +++ b/pom.xml @@ -30,7 +30,6 @@ - broker wildfire_jmeter