Question

I'm new to SignalR and am trying send push notifications to a Silverlight client.

Our web project is NOT Asp.Net MVC - just ASP.NET.

I have created a simple Hub class:

 [HubName("ServerHub")] 
public class ServerHub: Hub
{
    public Task SendMessage(string message)
    {
        return Clients.NewMessage(message);
    }
}

The problem is that we've got some messages coming through to our web server via message queues (Rhino Service Bus). When a message is processed, we want to send a notification to the UI. But the RSB worker thread is running outside of the HttpContext, so when invoking the SendMessage method the Clients property is null.

I have tried to work around this by adding the ServerHub to the Http Cache, and then retrieve it from the Message Consumer. Still having same issue - Hub's properties are null.

Any suggestions?

Thanks.

Was it helpful?

Solution

Ok, was doing it wrong. Hadn't used GlobalHost.DependencyResolver.Resolve().

Regards.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top