If you are already able to provide information in an any-to-any MQTT network, what prevents you from sending the result of a database query via a MQTT client? Is it the query itself, is it the database design or do you want to use a point-to-point connection, or is it something else?
The data to send from the MQTT Client must be an Array of Btyes, not a Resultset
The Client publishes an SQL request to the MQTT Broker with a Topic of "GETDATA"
The Server is subscribing to "GETDATA"
The Server processed the SQL with a local SQLLite database and gets a ResultSet
What I then want to do is have the server publish the ResultSet with a topic of "ClientID/RESULT"
The client is subscribed to "ClientID/RESULT"
The client can then process the ResultSet
I have tried
Dim sql As SQL
sql.InitializeSQLite("D:\Users\Patrick\OneDrive\Documents\B4X", "MQTTServer.db", False)
Dim rs As ResultSet = sql.ExecQuery("SELECT * from TesTable")
Dim ser As B4XSerializator
Dim ResultPackage() As Byte
ResultPackage = ser.ConvertObjectToBytes(rs)
but i get
java.lang.RuntimeException: Cannot serialize object: org.sqlite.RS@f16dd6d