locked
Prioritize between different sized data-messages in a signalr application RRS feed

  • Question

  • User1222158709 posted

    What would be a good approach to dynammicaly prioritize between different sized data-messages in a signalr application?

    I got all the usual small text-messages going from the server to a lot of the clients, no problem.

    But now I need to implement a way to deliver way bigger sized "packages" sent only to a few clients here and there, and I'd like to do this, without slowing down to much the flow of the smaller messages . I got no problem letting the bigger chunks of data flow slowly in the background so to speak, when there is time for it...

    Ideally, I would like a setup with a lot of handles controlling levels of importance/priority  of small messages, medium sized messages and bigger datachucks so I dynammical can adjust the flow, also during the transmission.

    So how? Create special slow background hubs or maybe somehow systemize threading within the same hub...

    -Any experience, ideas or patterns for doing this kind of thing with signalr?

    Hope you understand. Let me know if anything is unclear ;-)

    /thomas

    Tuesday, May 5, 2015 7:09 AM

All replies

  • User-1636419654 posted

    Hi Thomas

    At this time, SignalR does not have an inherent mechanism to prioritize message delivery to clients. Using multiple hubs would not affect performance in any way as the connection will be shared for all hubs, it would only be an implementation on the lines of separation of concerns. As an alternative, you may investigate using a custom Messaging Queue mechanism to have messages transmitted and re-arrange the messages based on their custom defined priority.

    Once that is accomplished, the next challenge would be to guarantee that your priority 1 messages(most important messages) are delivered. Since SignalR does message delivery on an assurance, there may be multiple reason which can cause messages to be dropped over the network while transmitting. If you seek guaranteed delivery, then a custom Acknowledgement/Re-transmission mechanism would also need to be implemented at the client/server levels.

    Regards

    Pulkit

    IIS/ASP.NET

    Tuesday, July 14, 2015 3:48 PM