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?