[GitHub] [incubator-iotdb] kqkdChen commented on issue #1442: failed to insert data using python paho mqtt library

2020-07-01 Thread GitBox


kqkdChen commented on issue #1442:
URL: 
https://github.com/apache/incubator-iotdb/issues/1442#issuecomment-652326040


   单条插入
   ```python
   from time import *
   import paho.mqtt.publish as publish
   
   
   def timestamp():
   return int(round(time() * 1000))
   
   
   def single(tx_id: str, log_type: str, log_content: str, hostname: str = 
"192.168.3.181", port: int = 1883):
   device_id = "root.log.%s" % tx_id
   payload = "{\n" "\"device\":\"%s\",\n" "\"timestamp\":%d,\n" 
"\"measurements\":[\"type\",\"content\"],\n" "\"values" \
 "\":[\"%s\",\"%s\"]\n" "}" % (device_id, timestamp(), 
log_type, log_content)
   publish.single(topic=device_id, payload=payload, hostname=hostname, 
port=port)
   
   
   if __name__ == '__main__':
   type_list = ["INFO", "WARNING", "ERROR"]
   content_list = ["content_1", "content_2", "content_3", "content_4"]
   begin_time = time()
   for i in range(10):
   single("14", type_list[i % len(type_list)], content_list[i % 
len(content_list)])
   end_time = time()
   run_time = end_time - begin_time
   print('cost time:', run_time)
   ```



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




[GitHub] [incubator-iotdb] kqkdChen commented on issue #1442: failed to insert data using python paho mqtt library

2020-07-01 Thread GitBox


kqkdChen commented on issue #1442:
URL: 
https://github.com/apache/incubator-iotdb/issues/1442#issuecomment-652324556


   > > qos=1 or 2, 则会出现如下错误,结果就是预期应该插入10W条数据的结果只插入了20条数据
   > 
   > @kqkdChen 这个问题已经好了?发生了什么?
   
   我换了另外一种方法写了mqtt 
client端的代码,所以就没有出现上述的错误了,然后我希望官网可以多一些其他语言的demo,我也会展示我的代码,希望可以帮助更多的人



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




[GitHub] [incubator-iotdb] kqkdChen commented on issue #1442: failed to insert data using python paho mqtt library

2020-07-01 Thread GitBox


kqkdChen commented on issue #1442:
URL: 
https://github.com/apache/incubator-iotdb/issues/1442#issuecomment-652293863


   > Thanks @kqkdChen for your report. I will take a look ASAP.
   
   谢谢,这个插入错误的问题我已经解决了,然后你能先帮我看这个新问题吗?**这个比较重要,涉及到mqtt连接的身份验证失效**。 #1446 



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