To subscribe one or more exchanges use the following code:
{
class SubscribeExchange
{
public void Main()
{
ConfigurationHelper.Initialize();
SamplePushClient pushClient = new SamplePushClient("subscribe-test");
ConsumerStore streamingStore = ConfigurationHelper.CreateConsumer(pushClient);
if (streamingStore == null)
return;
streamingStore.AddExchange("ETR");
streamingStore.AddExchange("STG");
streamingStore.RemoveExchange("ETR");
}
}
}
or subscribe exchanges using a filter element:
{
class SubscribeExchangeFilterElement
{
public void Main()
{
ConfigurationHelper.Initialize();
SamplePushClient pushClient = new SamplePushClient("subscribe-test");
ConsumerStore streamingStore = ConfigurationHelper.CreateConsumer(pushClient);
if (streamingStore == null)
return;
streamingStore.AddFilter(new FilterElement { ExchangeCode = "ETR", SecurityType = SecurityType.Equity });
}
}
}
Note: Example available in samples folder in Data Manager Connect - Client Distribution".