Can you advice on the following on behalf of a client please:
There are 2 ADH servers that should work in hot-standby mode. NIP application creates a provider and establishes a channel to ADH to publish data to cache. This part works well. The question is if connection to 2 ADHs should be created by establishing 2 different channels from 1 provider or there should be 2 different providers with 1 channel on each?
I have attached the java class responsible for connecting the publisher to RTDS. Most interesting is the below code which shows how we connect. I think we should attach this code and the class to the request to Reuthers so they have some background knowledge.
OmmNiProviderConfig config = EmaFactory.createOmmNiProviderConfig()
provider = EmaFactory.createOmmProvider(config, this.providerErrorClient);
If I understand the customer correctly, the ChannelSet facility I mentioned above does just that. They use a ChannelSet with 2 or more ADH hostnames in their configuration and the API will try to connect to the next one in the list if one server goes down during runtime or is not available at application startup.
However, this would not be hot-standby as there would a timeout period for the loss of existing connection to register before the API would try the other server in the list. They could try reducing the Ping Time out in the config to minimise the downtime.
However, if they want a better standby type facility they should create multiple OMMProviders publishing to multiple ADH and let the ADHs handle the switchover behaviour etc.
Please expand on what the client means by 'establishing 2 different channels from 1 provider'?
AFAIK, each OmmProvider instance can only have 1 active channel at one time. Perhaps the customer has read the section in the docs related to ChannelSets where you can specify multiple Channels in a ChannelSet?
The list of Channels in a ChannelSet is only used in case of initial connection failure, subsequent disconnect - extract from the EMA Config Guide:
ChannelSet : Specifies a comma-separated set of channel names. Each channel name must have a corresponding <Channel> entry in the ChannelGroup. In the event of a reconnection,Channels in the set are tried until a successful connection is made.
Please see the response from the client (Nordea) here, and thanks for your help.
We are fine by having just one active channel at a time. We want failover to work though so that if one TREP server goes down the application will connect to the other one.
Do you have a code example of how to do this?