You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to use MQTTnet to track logging information. Each of my services shall send its logging information to an individual topic. Each message shall be written to a database/cache to have them available for later. The database/cache will be trimmed to get rid of old information.
The thing with writing all messages to a database/cache seems to be easy. But this is my requirement:
When a client subscribes to a topic,, the client should be able to specify in the user properties how far back in history the subscription should "look", i.e. 24h, 7d, ...
How to restore/resend messages for a specific client/subscription?
I read all questions (open/close) of this issue tracker and the wiki and samples, but could not find something that matches my requirements.
Which project is your question related to?
Client
Server
The text was updated successfully, but these errors were encountered:
I think this is more of a "broker specific" question as most of the brokers just allow the messages to pass through them. In a more general context, you would need to have a QoS of at least 1 or 2, not having set the clear flag and have some sort of TTL in place which I am not sure mqtt supports that.
A "dirty approach" would be to subscribe to the db/logging whatever service to a topic that would essentially ping you when there is an update and you would execute a request/response scheme.
| SUBSCRIBE TO "NOTIFIER" |
|------------------------------------------------------------>|
| RECEIVED EVENT "NOTIFIER" |
Consumer|<------------------------------------------------------------|Producer
|QUERY THE DB WITH A PUBLISH MESSAGE|
|------------------------------------------------------------>|
|RECEIVE RESPONSE IN A DIFFERENT TOPIC|
|<------------------------------------------------------------|
But are you sure MQTT is the right way to solve the problem?
Yes, MQTT is the right way to go for the use case I work on.
I read more in the source code to get a better understanding. It's a pity that there is no documentation for IntelliSense provided by this project. Makes the API difficult to understand. Anyway...
My plan is to use the intercept-subscribe to restore the messages (if needed/requested) for the calling client and the intercept-unsubscribe/-disconnected to cleanup if needed. Should work fine.
Describe your question
I would like to use MQTTnet to track logging information. Each of my services shall send its logging information to an individual topic. Each message shall be written to a database/cache to have them available for later. The database/cache will be trimmed to get rid of old information.
The thing with writing all messages to a database/cache seems to be easy. But this is my requirement:
When a client subscribes to a topic,, the client should be able to specify in the user properties how far back in history the subscription should "look", i.e. 24h, 7d, ...
How to restore/resend messages for a specific client/subscription?
I read all questions (open/close) of this issue tracker and the wiki and samples, but could not find something that matches my requirements.
Which project is your question related to?
The text was updated successfully, but these errors were encountered: