Creating a Dynamic Watch List

Creating a dynamic watch list is a bit more complex than creating individual or chain RICs, but is also more flexible. Chain RICs are limited to those defined by Reuters, but with this method you can specify a customized list of RICs.

Prerequisites
Define a source stream (named MyInfoStream) to receive the data, and manually edit the list of RICs to include.
Task

Creating a dynamic watch list is also dynamic: when inserts or deletes occur on the stream configured using these steps, RMDS subscriptions to the appropriate RICs are started or stopped.

  1. Define a stream on Event Stream Processor (for example, MyListStream), which publishes to the adapter the list of RICs to which you want to subscribe. This stream requires these columns:
    Column Description
    symbol Specifies an RIC symbol ticker (for example, CSCO.O) to which the adapter should subscribe.
    service Specifies the RMDS service on which to subscribe to obtain data for that RIC.
    stream Specifies the name of the stream (for example, MyInfoStream) on which the adapter publishes data for this RIC.
    The stream can also include an optional fourth column, rfaQueue.
  2. Define a second stream on Event Stream Processor (for example, MyInfoStream) that receives the data requested by the first stream.
  3. Edit the map file to include the subscription.
    <subscriptions>
    <subscription name="subscription1" flags="BASE" >
    <stream name="MyListStream" >
    <name column="3" /> <!-- symbol -->
    <field column="1" name="service"/>
    <field column="2" name="stream"/>
    </stream>
    </subscription>
    </subscriptions>
  4. Specify the set of RICs you want and send them to the first stream you created (for example, MyListStream) to subscribe to them.
    1. Create a file with the same six columns that the stream expects in comma-separated values (CSV) format. The columns are: stream from which you are receiving data, opcode, service, symbol, and stream to which you are sending data.
      For example, open a new file (RIClist.csv) using an editor and put in these lines.
      MyListStream,p,,IDN_RDF,MyInfoStream,CSCO.O
      MyListStream,p,,IDN_RDF,MyInfoStream,K.N
      MyListStream,p,,IDN_RDF,MyInfoStream,KBN.N
      MyListStream,p,,IDN_RDF,MyInfoStream,KBN.R
      MyListStream,p,,IDN_RDF,MyInfoStream,ACAM.ARC
      MyListStream,p,,IDN_RDF,MyInfoStream,IBM.ARC
    2. Send the data from the file to Event Stream Processor using the esp_convert and esp_upload commands. The following example assumes that you have installed all SAP command line tools in the default directories and added those directories to your PATH variable. If you have not, prepend the appropriate path to each command shown in this example.
      For example, to send the file created in the previous step to Event Stream Processor running a project named p1 in workspace ws1 on port 19011 of your local server, enter:
      cat RIClist.csv | esp_convert -c user:password -d "," -p localhost:19011/ws1/p1 | esp_upload -c user:password -p localhost:19011/ws1/p1
    3. Start the adapter:
      esp_rmds -f mapfile -d7 -c user:password -p localhost:19011/ws1/p1 >& logfile &
      If the adapter and Event Stream Processor are on different machines, enter the name of the remote host in place of localhost after the -p in the previous command.