Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Messaging Powered Front Ends

534 views

Published on

How to power front end solutions using messaging - demonstrating ASP.NET SignalR as the channel and RabbitMQ as the back end messaging transport.

Published in: Software
  • Be the first to comment

Messaging Powered Front Ends

  1. 1. Elton Stoneman Microsoft MVP & Pluralsight Author http://particular.net Messaging Powered Front Ends
  2. 2. Introduction to ServiceInsight for NServiceBusMessaging Powered Front Ends • Channel to the User • Broadcast Notifications • Targeted Responses • Fault Tolerance • Scaling Concerns Outline
  3. 3. Introduction to ServiceInsight for NServiceBusMessaging Powered Front Ends Any back-end communication Client callback mechanism Mobile push / WebSockets / polling Channel to the User Broadcast All clients Pub-sub style Targeted Single client Req-resp style
  4. 4. Introduction to ServiceInsight for NServiceBusMessaging Powered Front Ends Two-way comms over TCP/IP Persistent connection (SPA) SignalR adds fault-tolerance WebSockets & SignalR Server .NET Hub Can invoke client calls Client Connects to Hub Can invoke server calls
  5. 5. Introduction to ServiceInsight for NServiceBusMessaging Powered Front Ends Demo: Broadcast Notifications Noticeboard Web App WebSockets & Messaging
  6. 6. Introduction to ServiceInsight for NServiceBusMessaging Powered Front Ends Client-server call with SignalR Web Server publishes to Exchange Broadcast Notifications exchange: noticeboard SendMailRequest
  7. 7. Introduction to ServiceInsight for NServiceBusMessaging Powered Front Ends Exchange bound to Queues Web Server listens on Queue Broadcast Notifications exchange: noticeboard SendMailRequest queue: broadcast queue: persist
  8. 8. Introduction to ServiceInsight for NServiceBusMessaging Powered Front Ends Web server broadcasts to clients Client renders new message Broadcast Notifications
  9. 9. Introduction to ServiceInsight for NServiceBusMessaging Powered Front Ends Multiple Servers Additional Queues Broadcast Notifications
  10. 10. Introduction to ServiceInsight for NServiceBusMessaging Powered Front Ends Demo: Response Messages Noticeboard Web App WebSockets & Messaging
  11. 11. Introduction to ServiceInsight for NServiceBusMessaging Powered Front Ends Multiple message handlers Targeted Responses exchange: noticeboard SendMailRequest queue: broadcast queue: persist
  12. 12. Introduction to ServiceInsight for NServiceBusMessaging Powered Front Ends Dedicated reply queue Specified in outgoing messages Web Server listens for replies Targeted Responses exchange: noticeboard SendMailRequest queue: reply-svr01 Sender: elton Content: hi ReplyTo: reply-svr01
  13. 13. Introduction to ServiceInsight for NServiceBusMessaging Powered Front Ends Handlers act on message Send reply with result Targeted Responses SendMailRequest queue: persist queue: reply-svr01 MailSavedEvent HandlerFailedEvent
  14. 14. Introduction to ServiceInsight for NServiceBusMessaging Powered Front Ends Handlers act on message Send reply with result Targeted Responses queue: broadcast queue: reply-svr01 MailBroadcastEvent HandlerFailedEvent SendMailRequest
  15. 15. Introduction to ServiceInsight for NServiceBusMessaging Powered Front Ends Web server receives reply Looks up client & sends Targeted Responses
  16. 16. Introduction to ServiceInsight for NServiceBusMessaging Powered Front Ends But... you can do this just with SignalR
  17. 17. Introduction to ServiceInsight for NServiceBusMessaging Powered Front Ends Persistence handler offline Demo: Fault Tolerance exchange: noticeboard SendMailRequest queue: broadcast queue: persist X
  18. 18. Introduction to ServiceInsight for NServiceBusMessaging Powered Front Ends Durable queues Messages wait for handler Fault Tolerance exchange: noticeboard SendMailRequest queue: persist
  19. 19. Introduction to ServiceInsight for NServiceBusMessaging Powered Front Ends Broadcast notification is easy Targeted response – not so much... Scaling Concerns
  20. 20. Introduction to ServiceInsight for NServiceBusMessaging Powered Front Ends SignalR fault tolerance Heartbeat checks connection Scaling Concerns
  21. 21. Introduction to ServiceInsight for NServiceBusMessaging Powered Front Ends Connection re-established Load-balanced Web servers Scaling Concerns
  22. 22. Introduction to ServiceInsight for NServiceBusMessaging Powered Front Ends Messages to 'wrong' Reply Queue Scaling Concerns queue: reply-svr01 queue: reply-svr02
  23. 23. Introduction to ServiceInsight for NServiceBusMessaging Powered Front Ends Instead of per-server Reply Queue Common Reply Exchange Scaling Concerns
  24. 24. Introduction to ServiceInsight for NServiceBusMessaging Powered Front Ends • You need a channel to the client • Messaging semantics: pub-sub & req-resp • Maintain patterns with messaging • Fault tolerance – persistent messages • Scaling – broadcast and filter Summary
  25. 25. Thank you blog.sixeyed.com @EltonStoneman

×