Skip to content

Support for client specific messages#2239

Closed
jboshoven-emporia wants to merge 1 commit into
dotnet:masterfrom
jboshoven-emporia:client-specific-messages
Closed

Support for client specific messages#2239
jboshoven-emporia wants to merge 1 commit into
dotnet:masterfrom
jboshoven-emporia:client-specific-messages

Conversation

@jboshoven-emporia
Copy link
Copy Markdown

This change adds DestinationClientId onto MqttApplicationMessages. If this value is non-null, only that specific subscriber will receive the message. This makes it possible to have a single topic shared by multiple clients.

This change adds DestinationClientId onto MqttApplicationMessages. If this value is non-null, only that specific subscriber will receive that message. This makes it possible to have a single topic for multiple devices.
@insylogo
Copy link
Copy Markdown

Why not just retrieve just the client object you care about and call Deliver/Enqueue message to it?

var session = Server.GetSessionAsync(clientId) then session.TryEnqueueApplicationMessage or DeliverApplicationMessageAsync

@jboshoven-emporia
Copy link
Copy Markdown
Author

jboshoven-emporia commented Apr 9, 2026

I love that idea, let me give it a shot.
I'll close the PR if that works.

@jboshoven-emporia jboshoven-emporia marked this pull request as draft April 9, 2026 03:18
@jboshoven-emporia
Copy link
Copy Markdown
Author

Thank you @insylogo that worked great.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants