Hey folks,
I am building a third party app which registers and opens a number of statistics. I have implemented the warm standby connection to my stat servers but I am having some issues. I am registering for a number of stats and when the stat servers are failed over I get an event to advise me this has happened but I don't automatically receive any updates on the registered stats. Now I am finding it difficult to get any information on whether in a warm standby situation the failed over stat server has details of the stats which we registered against? Should I expect that I should still have registrations against statistics for my app?
I was under the impression that in a warm standby scenario both servers would have knowledge of the connections and registered stats or do I need to go and re-register on the failed over server?
This is my connection code:
private void Connect()
{
try
{
PropertyConfiguration conf = new PropertyConfiguration();
conf.SetOption("protocol", "addp");
conf.SetOption(AddpInterceptor.TimeoutKey, "10");
conf.SetOption(AddpInterceptor.RemoteTimeoutKey, "10");
conf.SetOption(AddpInterceptor.TraceKey, "both");
Endpoint primaryEndpoint = new Endpoint(_statServerName, _statServerPrimaryHostName, _statServerPrimaryPort, conf);
Endpoint backUpEndpoint;
if (_statServerSecondaryHostName != "")
{
backUpEndpoint = new Endpoint(_statServerName, _statServerSecondaryHostName, _statServerSecondaryPort, conf);
}
else
{
backUpEndpoint = new Endpoint(_statServerName, "", _statServerPrimaryPort, conf);
TpsLogManager<StatisticQueryEngine>.Error("Error : StatsQueryEngine - " + _statServerName + " Backup is blank");
_managementServer.SendMessageToMessageServer(97014, LogCategory.Alarm, LogLevel.Alarm, "Error : StatsQueryEngine - " + _statServerName + " Backup is blank");
}
statServerProtocol = new StatServerProtocol(primaryEndpoint)
{
ClientId = _statisticRefId,
ClientName = _clientName,
};
statServerProtocol.Closed += statServerProtocol_Closed;
var warmStandbyConfig = new WarmStandbyConfiguration(primaryEndpoint, backUpEndpoint)
{
Timeout = 5000,
Attempts = 2
};
var warmStandby = new WarmStandbyService(statServerProtocol);
warmStandby.ApplyConfiguration(warmStandbyConfig);
warmStandby.Channel.Opened += Channel_Opened;
warmStandby.Channel.Closed += Channel_Closed;
warmStandby.StateChanged += warmStandby_StateChanged;
warmStandby.SwitchedOver += warmStandby_SwitchedOver;
warmStandby.Start();
warmStandby.Channel.BeginOpen();
_eventBrokerService = BrokerServiceFactory.CreateEventBroker(statServerProtocol);
TpsLogManager<StatisticQueryEngine>.Debug(_statServerPrimaryHostName + " :Statistic broker service created");
_eventBrokerService.Register(OnEventInfo);
TpsLogManager<StatisticQueryEngine>.Debug(_statServerPrimaryHostName + " :Statistic handler registered.");
//Activate event broker service
_eventBrokerService.Activate();
TpsLogManager<StatisticQueryEngine>.Debug(_statServerPrimaryHostName + " :Event Broker Service Activate.");
TpsLogManager<StatisticQueryEngine>.Info(statServerProtocol.State.ToString());
}
catch (Exception e)
{
TpsLogManager<StatisticQueryEngine>.Error("Error : StatsQueryEngine : " + e.Message);
}
}
I would appreciate any help you can provide and would appreciate if you can see anything in the code above which could be causing my issue.
Thanks in advance,
Kerry.