I have completely different two SignalR application, but the hub names are the same. Each application was deployed into same two servers(with load balancing). My architecture is like below
Cache Application: netscaler1 --> server1,server2 Hub Name: SignalRHub
Trade Application: netscaler2 --> server1,server2 Hub Name: SignalRHub
Cache
namespace SignalR.Server.Cache
{
class Program
{
static void Main(string[] args)
{
var url = ConfigurationManager.AppSettings["cacheurl"];
using (WebApp.Start(url))
{
Console.ReadLine();
}
}
}
public class Startup
{
public void Configuration(IAppBuilder app)
{
HubConfiguration conf = new HubConfiguration();
GlobalHost.DependencyResolver.UseRedis("sameIp", 6379, "*******", "Cache");
app.UseCors(CorsOptions.AllowAll);
app.MapSignalR(conf);
}
}
}
namespace SignalR.Server.Cache
{
public class SignalRHub : Hub
{
public void SendCache(string cache)
{
Clients.All.OnMessage(cache);
}
}
}
Trade
namespace SignalR.Server.Trade
{
class Program
{
static void Main(string[] args)
{
var url = ConfigurationManager.AppSettings["tradeurl"];
using (WebApp.Start(url))
{
Console.ReadLine();
}
}
}
public class Startup
{
public void Configuration(IAppBuilder app)
{
HubConfiguration conf = new HubConfiguration();
GlobalHost.DependencyResolver.UseRedis("sameIp", 6379, "*******", "Trade");
app.UseCors(CorsOptions.AllowAll);
app.MapSignalR(conf);
}
}
}
namespace SignalR.Server.Trade
{
public class SignalRHub : Hub
{
public void SendMessage(string message)
{
Clients.All.OnMessage(message);
}
}
}
My Questions :)
- Does the same redis server cause a problem? Does the redis event key parameter handle this?
- How redis stores this connections? I connected to redis with redis
desktop manager and I couldn't see any database. - I also storing data in same redis server for different purpose, Does this cause a problem?
- Do two hubs with the same name on the same server cause problems? should I change hub names