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
Inside one of the controller Route I'm using this code to send an message to all subscriber
// Now inject the new message at the broker.
await Server.InjectApplicationMessage(new InjectedMqttApplicationMessage(msg)
{
SenderClientId = MqttServerConstants.ClientId
});
But What I found is an error on the Logs saying that the Message will be drop
Describe the bug
Inside one of the controller Route I'm using this code to send an message to all subscriber
// Now inject the new message at the broker.
await Server.InjectApplicationMessage(new InjectedMqttApplicationMessage(msg)
{
SenderClientId = MqttServerConstants.ClientId
});
But What I found is an error on the Logs saying that the Message will be drop
MQTTnet.AspNetCore.Routing/Source/Routing/MqttRouter.cs
Line 51 in 4649da9
To Reproduce
Steps to reproduce the behavior:
Using this version of MQTTnet 4.X.X
Create a controller then send a message using
Server.InjectApplicationMessage
Make sure you are using:
app.UseMqttServer(server =>
{
server.WithAttributeRouting(app.ApplicationServices, allowUnmatchedRoutes: false);
});
See error.
Expected behavior
A clear and concise description of what you expected to happen.
Need the ability to ignore the Server message from the router
by maybe looking at the sender id
Screenshots
None
Additional context / logging
Using this example
https://github.com/dotnet/MQTTnet/blob/7f5c437c46dd52ecb1d53dfc8ea9fb8ff46caf5d/Samples/Server/Server_Simple_Samples.cs#L53C12-L53C55
dbug: MQTTnet.AspNetCore.Routing.MqttRouter[0] Rejecting message publish because 'route/path' did not match any known routes.
The text was updated successfully, but these errors were encountered: