Delivery.OMMStream object
Creates a definition that can be used to get the OMMStream that can be used to subscribe to streaming items of any Domain Model (e.g. MarkePrice, MarketByPrice...) exposed by the underlying WebSocket protocol of the Delivery Platform (formerly Refinitiv Data Platform).
Syntax
Delivery.OMMStream.Definition()Delivery.OMMStream.Definition(params string[] items)Delivery.OMMStream.Definition(IEnumerable<string> items)
Methods
Api(OMMStream.Api api)
Api(string api)
The streaming API service supporting the OMM streaming data.
Name(params string[] itemNames)
Name(IEnumerable
The collection of item names of interest. Eg: AAPL.O (RIC)
Fields(params string[] fields)
Fields(IEnumerable
Specify a subset of fields from the service to be delivered.
Eg: Fields(BID", "BIDSIZE", "ASK", "ASKSIZE", "TRDPRC_1", "TRDVOL_1")
Service(string service)
The streaming platform can optionally manage the realtime streaming data through multiple, configured services.
As such, this interfaces offers the ability to override the default.
Domain(string domain)
The domain for the specific data of interest. For example, MarketPrice, MarketByPrice, MarketByOrder, etc.
Refer to the WebSockets documentation for all defined domains. Default: MarketPrice.
ExtendedParams(JObject obj)
The streaming platform can offer a multitude of properties, depending on how the enviroment is configured.
In most cases, the default streaming environment is suitable for delivery. However, there may be some
rare cases where applications may need to define properties that are less commonly used. The extended
params specification provides this capability. To extend, applications must form the request properties
as defined within the WebSocket Request specifications. If extended properties are included, they will
be merged with all other properties specified.
The possible values for the EndpointRequest.Api:
| Value | Description |
|---|---|
| Pricing | Stream Market Data instruments. |
| CustomInstruments | Stream user-defined custom instruments. |
Returned value
OMMStreamDefinition object.
Usage
The following example demonstrates how to create an OMM stream definition and capture snapshot data:
// Request a snapshot for the Canadian Dollar.
var stream = OMMStream.Definition("CAD=")
.Fields("BID", "ASK", "HIGH_1", "LOW_1")
.GetStream().OnRefresh((a, b, c) => {})
.OnStatus((a, b, c) => {});
// By setting streaming the false, we are requesting only a snapshot of the historical data
// without any incoming streaming updates
stream.Streaming(false).Open();
The following example demonstrates how to create an OMM stream with multiple registered callbacks and request stream data:
var stream1 = OMMStream.Definition("EUR=")
.GetStream()
.OnRefresh((item, msg, s) => Console.WriteLine($"{DateTime.Now}:{msg}"))
.OnUpdate((item, msg, s) => DumpMsg(item, msg))
.OnStatus((item, msg, s) => Console.WriteLine($"{DateTime.Now} => Status1: {msg}"))
.OnError((item, msg, s) => Console.WriteLine($"Stream1 error: {DateTime.Now}:{msg}"));
The following example demonstrates how to request bulk snapshot data using the OMM Stream:
// Read in the batch of items to request for
var items = new List<string> { ".A1UTI", ".A3DOW", ".A4DOW", ".AAPIDX" };
var stream = OMMStream.Definition(items)
.GetStream()
.OnComplete(s => Console.WriteLine("Bulk request completed"));
stream.Streaming(false).Open();