0

I have a system where messages are being sent server from one application to server side in my web application

The messages are being sent by NService bus

Has anyone ever been able to find a way to get a message to the relevant server side instance and avoid it being swallowed by another?

Eg instance 1 is only interested in message 124 instance 2 is only interested in message 135

If instance one picks up message 135 I have a problem because it will never get to instance 2

This is a real time application and I have seen that people say a backplane is not the recommended approach

Paul

Paul
  • 2,773
  • 7
  • 41
  • 96
  • What is the reason to require instance affinity? Instances are replicas of the same logical endpoint. Therefore what they do and how shouldn't be different. Could you elaborate on the scenario you're dealing with? – Sean Feldman Mar 31 '18 at 14:12
  • I have a system that displays data in real time. User 1 opens the system in a browser. This starts the receiving end point. User 2 starts in a browser. These share the same endpoint so if a message is sent by nservice bus that is relevant to both users it will be missed by one of them because as soon as it’s been handled by user 1 user 2 will not be notified. So if both users are monitoring the price of gold for example, only 1 will get the update that’s what I need to fix – Paul Mar 31 '18 at 14:14

1 Answers1

0

So if both users are monitoring the price of gold for example, only 1 will get the update that’s what I need to fix

This sounds as a schenario where messages need to be broadcasted and all clients need to receive those on the client (browser) side. SignalR has maintains a connection to each client. When NServiceBus message arives on the webserver, you can send that message to all the cliens using SignalR's Hub which exposes Clients.All.

This will require a Backplane to ensure that clients that reconnect get their copy of the SignalR messages.

Sean Feldman
  • 23,443
  • 7
  • 55
  • 80
  • I already have a way of the server notifying relevant clients via signal r although I haven’t looked at backplanes they look complicated an people seems to suggest avoiding them for real time systems? I have an issue is that I have an endpoint that I start a new instance of when the website starts so I was thinking that would be a new seperate connection that would swallow the message – Paul Mar 31 '18 at 14:44
  • Backplane ensures that when a client reconnects, it would still get the messages, assuming client uses the same ID. Wouldn't say backplane is complicated. Azure Service Bus / Reddis / SQL implementations abstract the complexity and in your code it is as complex as adding `.UseServiceBus()` or `.UseRedis()`. – Sean Feldman Mar 31 '18 at 14:52