We have configured the redis backplane in owin startup code of the web app.
var config = new RedisScaleoutConfiguration(hangfireRedisConnection, scaleoutEventKey);
GlobalHost.DependencyResolver.UseRedis(config);
app.MapSignalR();
The web app runs a background job on a timer, that wakes up and notifies the client if an important event took place. After querying the backend, the background job calls into a simple HubService wrapper that takes IHubContext as a dependency and eventually calls Client.All.notify method on the hub to push down to the client:
HubService:
private readonly IHubContext applicationHub;
public HubService(IHubContext applicationHub)
{
this.applicationHub = applicationHub;
}
public void NotifyClient()
{
hubContext.Client.All.nofify(message); // <- this is always called, with and without the backplane, however with the backplane it doesn't make it to the client
}
HubContext is registered at the startup:
Container.RegisterInstance<IHubContext>(GlobalHost.ConnectionManager.GetHubContext<ApplicationHub>());
This works fine without the backplane, but doesn't with the backplane configured. I have verified in the debugger that the call is being made, but it doesn't make it down to the client.
Also, if we call signalr hub from the client (outside of the web app) either through js or signalr.client clients, the backplane works as advertised.
Is there something missing in the scenario where we're calling directly into hub context from within the web app itself without initiating the call from the client first?