question

Upvotes
Accepted
3 0 0 4

How to subscribe to multiple RICs with my NIProvider

I am implementing my own NIProvider which is essentially something like [this example](https://github.com/Refinitiv/Real-Time-SDK/blob/master/CSharp/Ema/Examples/Training/IProvider/100_Series/100_MP_Streaming/IProvider.cs) but I added a string array `Rics`:

string[] Rics = {"NVDA", "MSFT", "AAPL"};

to simulate updates for multiple names:

public static void Main(string[] args)
{
    OmmProvider? provider = null;
    AppClient appClient = new AppClient();
    FieldList fieldList = new FieldList();

    OmmIProviderConfig config = new OmmIProviderConfig();

    provider = new OmmProvider(config.Port("14002"), appClient);

    while (appClient.ItemHandle == 0) Thread.Sleep(1000);
    string[] Rics = {"NVDA", "MSFT", "AAPL"};
    for (int i = 0; i < 65536; i++)
    {
        for (int j = 0; j < Rics.length; ++j) {
            fieldList.Clear();
            fieldList.AddReal(22, 3991 + i, OmmReal.MagnitudeTypes.EXPONENT_NEG_2);
            fieldList.AddReal(30, 10 + i, OmmReal.MagnitudeTypes.EXPONENT_0);
            var updMsg = new UpdateMsg().Payload(fieldList.Complete());
            updMsg.Name(ric);
            provider.Submit(updMsg, appClient.ItemHandle);

            Thread.Sleep(1000);
        }
    }

}

This works fine as long as the consumer can accept all the RICs. But my consumer is something like this:

public class Consumer
{
    static void Main()
    {
        OmmConsumer? consumer = null;
        AppClient appClient = new();
        OmmConsumerConfig config = new OmmConsumerConfig().Host("localhost:14002").UserName("user");
        consumer = new OmmConsumer(config);
        string[] Rics = {"AAPL", "MSFT"};
        foreach (var ric in Rics)
            consumer.RegisterClient(new RequestMsg().ServiceName("DIRECT_FEED").Name(ric), appClient);
        Thread.Sleep(60000); // API calls OnRefreshMsg(), OnUpdateMsg() and OnStatusMsg()
        consumer?.Uninitialize();        
    }
}

Which largely models after [this example](https://github.com/Refinitiv/Real-Time-SDK/blob/master/CSharp/Ema/Examples/Training/Consumer/100_Series/100_MP_Streaming/Consumer.cs)

but it adds RICs in a loop:

foreach (var ric in Rics)
    consumer.RegisterClient(new RequestMsg().ServiceName("DIRECT_FEED").Name(ric), appClient);

This approach works fine if my consumer connects to LSEG's Real-Time Optimized data platform, RTO will only send updates to my consumer from the RICs I subscribed to (in this particular example, MSFT and AAPL only, NVDA excluded). But if I connect my consumer to my NIProvider above, my own NIProvider will not honor my subscription requests and send all updates (in this particular example, NVDA, MSFT and AAPL).


My question is, how can I implement the same filtering mechanism in my NIProvider?

#technologyema-apirefinitiv-realtime-sdk
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.

1 Answer

· Write an Answer
Upvotes
Accepted
85k 289 53 77

@vnaik01

Thank you for reaching out to us.

I think you are using an Interactive Provider (IProvider), not a Non-Interactive Provider (NIProvider).

IProvider must only provide updates to the subcribed RICs. For example, if the consumer subscribes to "AAPL" and "MSFT", it must only provide refreshes and updates of "AAPL" and "MSFT" to that consumer.

To use a Non-Interactive Provider (NIProvider), you need to have RTDS (ADH or ADS POP) on your enviornment.


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.