B4J Question Where are the jMQTTBroker v2 messages stored?

byz

Active Member
Licensed User
hi,guys:
Where are the jMQTTBroker v2 messages stored?
I'm using https://www.b4x.com/android/forum/threads/mqttbroker.61548/#content Post as a message broker for MQTT, I would like to ask where the message is? Whether it can be stored persistently, such as sqlite or mysql. I didn't find any way to store messages in the MqttBroker class.
 
Solution
Try to add this line before the broker is started:
B4X:
broker.As(JavaObject).GetFieldJO("config").RunMethod("setProperty", Array("persistent_store", File.Combine(File.DirApp, "mqtt.db")))

The persistent file is created. I haven't tested how exactly it is used.

byz

Active Member
Licensed User
Thank you, Erel.I'll try later and bring the results to feed back here.
 
Upvote 0

byz

Active Member
Licensed User
Upvote 0

byz

Active Member
Licensed User
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…