question

Upvotes
Accepted
154 12 17 29

MarketDataItemSub, MarketDataSubscriberInterestSpec and MarketDataSubscriber class

Please provide the additional information for these classes.

treprfarfa-api
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

1 Answer

Upvotes
Accepted
9.5k 10 5 7

Hello @Catherine Wong

MarketDataItemSub,MarketDataSubscriber and MarketDataSubscriberInterestSpec class are used in RFA Market Data Consumer application(SSL connection which default port is 8101).

The MarketDataItemSub class represents a subscription for a single Market Data Item specified by item name(RIC) to request Market Data Events i.e. data of the RIC. For the class details and its methods, please refer to <RFA Java Package>\Legacy\Docs\refman\rfalegacy_java\com\reuters\rfa\session\MarketDataItemSub.html.

The MarketDataSubscriberInterestSpec interface represents an interest in receiving events e.g. Service Events or Connection Events which are not related to Market Data Events. For the class details and its methods, please refer to <RFA Java Package>\Legacy\Docs\refman\rfalegacy_java\com\reuters\rfa\session\MarketDataSubscriberInterestSpec.html

The MarketDataSubscriber class provides a proxy to make market data subscriptions for a MarketDataItemSub or register for a MarketDataSubscriberInterestSpec. For the class details and its methods, please refer to <RFA Java Package>\Legacy\Docs\refman\rfalegacy_java\com\reuters\rfa\session\MarketDataSubscriber.html

For example:

  • To monitor the service(s) and the connection, the application registers for Service Events and Connection Events as an example source code shown below:
//Create a MarketDataSubscriber event source using the Session reference 
//and calls the createEventSource() method with EventSource.MARKET_DATA_SUBSCRBER type
MarketDataSubscriber _marketDataSubscriber =(MarketDataSubscriber)_session.createEventSource(EventSource.MARKET_DATA_SUBSCRIBER,"myMarketDataSubscriber");

//Create MarketDataSubscriberInterestSpec and 
//set which the application interests i.e. setMarketDataSvcInterest(true) to receive Service Events
//setConnectionInterest(true) to receive Connection Events
MarketDataSubscriberInterestSpec marketDataSubscriberInterestSpec = new MarketDataSubscriberInterestSpec();
marketDataSubscriberInterestSpec.setMarketDataSvcInterest(true);
marketDataSubscriberInterestSpec.setConnectionInterest(true);
 //register for MarketDataSubscriberInterestSpec
 Handle _mdsClientHandle = _marketDataSubscriber.registerClient(_eventQueue,marketDataSubscriberInterestSpec,myClient, null);

  • To get data of any item/RIC, the application makes market data subscriptions using MarketDataSubscriber instance. Anyway, MarketDataSubscriber instance can be reused as an example source code below:
//create MarketDataItemSub
MarketDataItemSub marketDataItemSub = new MarketDataItemSub();
//itemName is the RIC e.g. TRI.N
marketDataItemSub.setItemName(itemName);
//set service that the application requests data from
marketDataItemSub.setServiceName(_serviceName);
//use _marketDataSubscriber which has been created in the source code of the first bullet to make market data subscriptions
_marketDataSubscriber.subscribe(_eventQueue, marketDataItemSub, myClient, null); 

Please refer to MDSubDemo application which demonstrates how to use these classes. The application is in <RFA Java Package>\Legacy\Examples\com\reuters\rfa\legacyexample\session\mdsub\

For details of developing RFA Market Data applications, please refer to RFAJ_DeveloperGuide.pdf in <RFA Java Package>\Legacy\Docs

Note: the latest RFA version providing these classes and theirs documents are 7.6.1.L2 which can be downloaded at RFA Java Downloads Page. RFA version 8.x or higher does not support MarketData interface using these classes so the classes and their documents have been removed from the packages.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Click below to post an Idea Post Idea