question

Upvotes
Accepted
7 2 2 3

Hoi to program an NIP to accept multiple ADH/ADS connections using EMA

Hi team,


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()
.host(configuration.getHost())
.username(configuration.getUsername())
.instanceId(configuration.getInstance())
.adminControlDirectory(OmmNiProviderConfig.AdminControl.USER_CONTROL);

provider = EmaFactory.createOmmProvider(config, this.providerErrorClient);
provider.registerClient(EmaFactory.createReqMsg().domainType(EmaRdm.MMT_LOGIN), providerClient);
providerClient.awaitServiceRegistration(TIMEOUT);


Regards,

Erol


elektronrefinitiv-realtimeelektron-sdkema-apirrtjava
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
Accepted
25.3k 87 12 25

Hi @Hans Ole Hartmann

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.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
25.3k 87 12 25

Hi @erol.komac

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.


icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
1 0 0 0

Hi Umar

Please see the response from the client (Nordea) here, and thanks for your help.

Hi Hans,


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?


Venlig hilsen

Martin Eriksen
Developer

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.