'Note: Define/Dim query variable outside of MessageArrived, saving some time declaring variable over and over (and reducing garbage collection)
'Dim query As String =" INSERT INTO paquetes (topic,tower,source,command,subcommand,user,pretopic,fecha) VALUES (?,?,?,?,?,?,?,?)"
'ALL MQTT MESSAGES ARE LOGGED INTO MYSQL DATABASE:
Private Sub mqtt_MessageArrived (Topic As String, Payload() As Byte)
' Do some processing
' Now add data to database
Dim mysql as SQL
mysql = pool.GetConnection
mysql.ExecNonQuery2(query,Array As Object( elpath(1),torre,source,comando,subcomando,userid,elpath(0),fechahoy))
mysql.close
' Do some more processing
End Sub