This is an automated email from the ASF dual-hosted git repository.

qiaojialin pushed a commit to branch fix_mqtt_max_length
in repository https://gitbox.apache.org/repos/asf/incubator-iotdb.git


The following commit(s) were added to refs/heads/fix_mqtt_max_length by this 
push:
     new 383b5e3  add max mqtt message size config
383b5e3 is described below

commit 383b5e3f4b8b23e213a8a00b9a4a284165aa7b65
Author: qiaojialin <[email protected]>
AuthorDate: Mon Jun 1 23:45:03 2020 +0800

    add max mqtt message size config
---
 pom.xml                                                           | 3 ++-
 server/src/main/java/org/apache/iotdb/db/service/MQTTService.java | 5 +----
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/pom.xml b/pom.xml
index 05b0a5b..95f0fb0 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1222,7 +1222,8 @@
         <!-- upload code coverage report to coveralls.io-->
         <!-- to enable coveralls locally, you need to get the repoToken from 
https://coveralls.io/github/apache/incubator-iotdb.
              use `mvn post-integration-test -Pcode-coverage 
-DrepoToken=TOKEN`-->
-        <!-- enable site--><!-- use `mvn package -P site -pl site` to compile 
the site module only -->
+        <!-- enable site-->
+        <!-- use `mvn package -P site -pl site` to compile the site module 
only -->
         <profile>
             <id>site</id>
             <modules>
diff --git a/server/src/main/java/org/apache/iotdb/db/service/MQTTService.java 
b/server/src/main/java/org/apache/iotdb/db/service/MQTTService.java
index 1ee783f..fd10c5b 100644
--- a/server/src/main/java/org/apache/iotdb/db/service/MQTTService.java
+++ b/server/src/main/java/org/apache/iotdb/db/service/MQTTService.java
@@ -56,10 +56,6 @@ public class MQTTService implements IService {
     public void startup() {
         IoTDBConfig iotDBConfig = IoTDBDescriptor.getInstance().getConfig();
         IConfig config = createBrokerConfig(iotDBConfig);
-
-        config.setProperty(BrokerConstants.NETTY_MAX_BYTES_PROPERTY_NAME,
-            
String.valueOf(IoTDBDescriptor.getInstance().getConfig().getMaxMqttMessageSize()));
-
         List<InterceptHandler> handlers = Lists.newArrayList(new 
PublishHandler(iotDBConfig));
         IAuthenticator authenticator = new BrokerAuthenticator();
 
@@ -81,6 +77,7 @@ public class MQTTService implements IService {
         properties.setProperty(BrokerConstants.PORT_PROPERTY_NAME, 
String.valueOf(iotDBConfig.getMqttPort()));
         
properties.setProperty(BrokerConstants.BROKER_INTERCEPTOR_THREAD_POOL_SIZE, 
String.valueOf(iotDBConfig.getMqttHandlerPoolSize()));
         
properties.setProperty(BrokerConstants.IMMEDIATE_BUFFER_FLUSH_PROPERTY_NAME, 
"true");
+        properties.setProperty(BrokerConstants.NETTY_MAX_BYTES_PROPERTY_NAME, 
String.valueOf(iotDBConfig.getMaxMqttMessageSize()));
         return new MemoryConfig(properties);
     }
 

Reply via email to