Replies: 1 comment 2 replies
-
AFAIK To handle broker events, you can create a custom plugin for the broker which will get notified when any of the following events occur:
You can see how that works in the In Otherwise, you could also let an MQTT client run in a different process (or in a different task of the same process) and subscribe to the topic you need, like
See also But there might be some cases where data will be missed, e.g. before the client has connected once. If your client is run separately, you will also want to use a fixed |
Beta Was this translation helpful? Give feedback.
-
There are lots of examples of creating a broker with amqtt, but I cannot find any examples that interact with amqtt once the broker is up and running.
For example, if I simply wanted every value published to a topic to get also written to a database, how would I do that? Should I just add client code to the same application with a subscription to # - and if so how can I avoid any risk of missing any data (eg ensuring no data is lost before my client is connected)? What if I also wanted to record each broker connection being opened/closed - ie events that I can't just capture by subscribing to a topic?
Beta Was this translation helpful? Give feedback.
All reactions