Creating a Dynamic Watch List

Creating a dynamic watch list is a bit more complex than creating individual RICs, but is also more flexible. You can specify a custom list of RICs.

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

This method 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 wish 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 (the p in the example is for UPSERT), service, symbol, and stream to which you are sending data.
      For example, use a text editor to open a new file (RIClist.csv) 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 on port 11180 of your local server, enter:
      cat RIClist.csv | esp_convert -c user:password -d "," \
      -p localhost:11180/ws1/p1 | esp_upload -c user:password -p localhost:11180/ws1/p1
    3. Start the adapter:
      esp_rmdsomm -f mapfile -d7 -c user:password \
      -p localhost:11180/ws1/p1 >& logfile &
      If the adapter and Event Stream Processor are on different machines, enter the name of the remote host rather than localhost after the -p in the previous command.