kqkdChen opened a new issue #1442:
URL: https://github.com/apache/incubator-iotdb/issues/1442


   使用 python paho mqtt 插入数据时出现错误:
   client_id不能为空,且qos必须等于0,不然就会出现错误。
   
   qos=1 or 2, 则会出现如下错误,结果就是预期应该插入10W条数据的结果只插入了20条数据
   
![image](https://user-images.githubusercontent.com/41674301/86111404-47a77000-baf9-11ea-870b-cd7b3e5ba2e2.png)
   
   iotdb version: 0.10.0
   paho-mqtt: 1.5.0
   
   代码如下
   
   ```python
   import random
   
   import paho.mqtt.client as mqtt
   import time
   
   
   def on_connect(client, userdata, flags, rc):
       print("Connected with result code: " + str(rc))
   
   
   def on_message(client, userdata, msg):
       print(msg.topic + " " + str(msg.payload))
   
   
   client = mqtt.Client(client_id=str(random.uniform(1, 10)))
   # client = mqtt.Client()
   client.username_pw_set("root", "root")
   client.connect('127.0.0.1', 1883)
   
   timestamp = lambda: int(round(time.time() * 1000))
   for i in range(100000):
       message = "{\n" "\"device\":\"root.log.d1\",\n" "\"timestamp\":%d,\n" 
"\"measurements\":[\"s1\"],\n" "\"values" \
                 "\":[%f]\n" "}" % (timestamp() + 1000 * i, random.uniform(1, 
10))
       client.publish('root.log.d1.info', payload=message, qos=0, retain=False)
   client.disconnect()
   
   ```


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to