Server: Is there an option in the server to just get the messages that you subscribed to before?
- Dominant language
- C#
- Stars
- 5.1k
- Forks
- 1.2k
- PR merge metrics
- No merged PRs in 30d
Description
### Describe your question
@chkr1011 Is there an option in the server to just get the messages that you subscribed to before? There is, of course, `InterceptingPublishAsync` which can be used like this, but this will get all messages that are published to the server.
```csharp
private async Task Run()
{
var mqttFactory = new MqttFactory();
var mqttServerOptions = new MqttServerOptionsBuilder().WithDefaultEndpoint().Build();
using (var mqttServer = mqttFactory.CreateMqttServer(mqttServerOptions))
{
await mqttServer.StartAsync();
mqttServer.InterceptingPublishAsync += this.InterceptPublish;
await mqttServer.SubscribeAsync("Test", "a/b/#");
await mqttServer.StopAsync();
}
}
private async Task InterceptPublish(InterceptingPublishEventArgs args)
{
// Handle some published data here.
args.ProcessPublish = true;
}
```
### Which project is your question related to?
- Server
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.