question

Upvotes
Accepted
5 1 0 3

How to establish multiple connections using RFA API

Is it possible for RFA API to establish multiple connections (to a same host but different ports ) ?

i.e.

Destination/publisher host:

Test_Host1

Ports:

- 10101

- 10102

..

- 10108


We have configured like below but it seems it just only connect to one of them :

===================

<?xml version="1.0" encoding="UTF-8"?>

<EmaConfig>

<ConsumerGroup>

<DefaultConsumer value="Consumer_1"/>

<ConsumerList>

<Consumer>

<Name value="Consumer_1"/>

<ChannelSet value="Channel_1, Channel_2"/>

<Logger value="Logger_1"/>

<Dictionary value="Dictionary_1"/>

<XmlTraceToStdout value="0"/>

</Consumer>

</ConsumerList>

</ConsumerGroup>

<ChannelGroup>

<ChannelList>

<Channel>

<Name value="Channel_1"/>

<ChannelType value="ChannelType::RSSL_SOCKET"/>

<CompressionType value="CompressionType::None"/>

<GuaranteedOutputBuffers value="5000"/>

<ConnectionPingTimeout value="30000"/>

<TcpNodelay value="1"/>

<Host value="test_host1"/>

<Port value="10101"/>

</Channel>

<Channel>

<Name value="Channel_2"/>

<ChannelType value="ChannelType::RSSL_SOCKET"/>

<CompressionType value="CompressionType::None"/>

<GuaranteedOutputBuffers value="5000"/>

<Host value="test_host1"/>

<Port value="10102"/>

</Channel>

</ChannelList>

</ChannelGroup>

<LoggerGroup>

<LoggerList>

<Logger>

<Name value="Logger_1"/>

<LoggerType value="LoggerType::Stdout"/>

<LoggerSeverity value="LoggerSeverity::Success"/>

</Logger>

</LoggerList>

</LoggerGroup>

<DictionaryGroup>

<DictionaryList>

<Dictionary>

<Name value="Dictionary_1"/>

<DictionaryType value="DictionaryType::FileDictionary"/>

<RdmFieldDictionaryFileName value="./RDMFieldDictionary"/>

<EnumTypeDefFileName value="./enumtype.def"/>

</Dictionary>

</DictionaryList>

</DictionaryGroup>

</EmaConfig>

===============================

Could you pleaes let us know how to properly configure it ? Thank you

#technology#productrfa-api
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.

@ryusuke.kamimura

Hi,

Thank you for your participation in the forum.

Are any of the replies below satisfactory in resolving your query?

If yes please click the 'Accept' text next to the most appropriate reply. This will guide all community members who have a similar question.

Otherwise please post again offering further insight into your question.

Thanks,

AHS

Upvotes
Accepted
24.9k 54 17 14

Hello @ryusuke.kamimura

I did a quick test with EMA API C++ version 3.6.7 (RTSDK 2.0.7) Cons410 example connects to the following sources:

  • Consumer 1: Connect to RTC/ADS Pop on my local machine port 14002
  • Consumer 2: Connect to EMA Java IProvider on my local machine port 14022

The modification code of Cons410 is as follows:

try {
    // Create two ConsumerManager objects to demonstrate horizontal scaling feature on user thread of control
    ConsumerManager consumerMgr1( "localhost:14002", "user1" );
    ConsumerManager consumerMgr2("localhost:14022", "user2");
        
    AppClient appClient1;
    AppClient appClient2;


    consumerMgr1.getOmmConsumer().registerClient( ReqMsg().serviceName( "ELEKTRON_DD" ).name( "/VOD.L" ), appClient1, (void *)"consumerMgr1" );
    consumerMgr2.getOmmConsumer().registerClient( ReqMsg().serviceName( "ELEKTRON_DD" ).name( "TRI.N" ), appClient2, (void *)"consumerMgr2" );


    // Start dispatching messages from each ConsumerManager
    consumerMgr1.start();
    consumerMgr2.start();


    sleep( 60000 );                // User thread calls onRefreshMsg(), onUpdateMsg(), or onStatusMsg()


    consumerMgr1.stop();
    consumerMgr2.stop();
}

Results:

result-1.png

result-2.png

The EMA API Horizontal Scaling example is available on the EMA C++ as Cons410 example. The example is available on the SDK package which can be downloaded from the following sites:


result-1.png (29.2 KiB)
result-2.png (17.9 KiB)
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.

Hi @wasin.w


Many thanks for your quick test and confirmation. Let us give a try on our side and get back if any further questions.

Upvotes
24.9k 54 17 14

Hello @ryusuke.kamimura

Thank you for contacting us. Can you please clarify if you are using the RFA API (C++, Java, or . Net?) or EMA API (C++ or Java)?

If you are using EMA API, the API doesn't support multiple hosts. However, you can use the Warm Standby feature. This feature allows a consumer to failover to a standby connection when a primary connection fails or a service is down. Because the standby server is already aware of items an application has subscribed for, during a failover APIs don't need to re-subscribe items to the standby server.

You can find more detail about the RTSDK Warm Standby feature from the following resources:

The EMA APIs examples for the Warm Standby feature are as follows:

  • EMA C++: Cons470
  • EMA Java: ex470_MP_WarmStandby

Hope this helps.

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
22.2k 59 14 21

Hi @ryusuke.kamimura,

You are asking about RFA, but the configuration you have posted is for EMA SDK.

Either way, there is no automatic mechanism to establish multiple connections to ADS, but an application can easily do this in the code. It does not even have to be a different IP/port; multiple connections can be established to the same ADS by instantiating a new OMMConsumer object. Each consumer will establish its own independent connection, which is unaffected by other connections.

In practice, multiple connections to same host do not offer any advantage, since a single connection has enough bandwidth to handle all the throughput - what is your use case?

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
5 1 0 3

Hi @Gurpreet / @wasin.w

Many thanks for your reply.

This is not a connection to TREP/ADS, but to an internally created publisher server that runs multiple instances (and each instance provides unqiue subset of RICs) which each instance maps to a unique port. hence this query.


Is there any way we can do this ? other than having to preparea new host per instance /port ?

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
24.9k 54 17 14

Hello @ryusuke.kamimura

The EMA API supports only a single host server (ADS or OMM IProvider) connection per OMMConsumer object. The channellist and warm standby are for the failover scenario.

There is the EMA API Horizontal Scaling example (EMA Java: ex410_MP_HorizontalScaling, EMA C++:Cons410) that shows how the single application can utilize multiple OMMConsumer objects. This article aims for the horizontal scaling feature but you can modify it to connect to different sources or ports.

If you need this feature in the future release of the SDK, you can submit an enhancement request to the product team via the following channels:

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.

Hello @wasin.w

Thank you for your reply.

So just to confirm,

it is possible to connect to different ports by using "EMA API Horizontal Scaling" feature that is already made available, correct ?

Our developer is using EMA API (C++),

could you please share us with the doc/sample config for it ?

Thank you.

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.