Creating the Input Adapter Map File

Create an adapter map file to configure the interface between the Reuters Marketfeed input adapter and Event Stream Processor.

This procedure maps updates from RMDS to the source stream defined in the example.ccl file. This file is in the $ESP_REUTERS_HOME/examples directory along with an example map file.

  1. Open a new map file using an editor.
  2. Enter the following as the first line of the file to specify that the adapter map file conforms to XML version 1.0.:
    xml version="1.0" encoding="UTF-8"
  3. Specify that this is an adapter map file and that includes a separate file:
    <!DOCTYPE adapter [
    <!ENTITY rmdsFields SYSTEM "rmds.sm.mf.xml">
    ]>
  4. Add the opening and closing adapter tags. In the opening adapter tag, specify the name of the adapter. For example:
    <adapter name="mySubscribeAdapter1">
    </adapter>
  5. After the opening adapter tag, add the publication element. Specify the name to be used in log messages for this adapter and any other attributes required to prescribe how the adapter should deliver data to Event Stream Processor.
    For example,
    <publication name="RMDS Adapter - low latency" retryInterval="5" />
    This example also includes a retryInterval attribute with a value that tells the adapter to wait five seconds before retrying if it fails to connect to Event Stream Processor.
  6. After the publication element, add the opening and closing streamMaps tags to contain the streamMap elements that do the actual mapping between RMDS FIDs and columns of an Event Stream Processor stream. Each streamMap maps to one and only one Event Stream Processor stream.
    <streamMaps>
    </streamMaps>
    Since the streamMaps section can contain more than one streamMap, one instance of the adapter can provide RMDS data to more than one Event Stream Processor stream.
  7. Enter a streamMap element for each Event Stream Processor stream to which you wish to send RMDS data. For each streamMap,
    1. Enter the opening streamMap tag specifying the name of the Event Stream Processor stream to which the RMDS data is sent as the value of the name attribute.
    2. Enter the closing streamMap tag.
    3. Between the streamMap tags, add one mapping element for each column defined in the target stream's definition. You can do this in the map file itself or in a separate file that is included in the map file as an entity.
      <streamMap name="stream1" flags="NO_SHINE">
      &rmdsFields;
      </streamMap>
  8. After the streamMaps section, add the rfa element, including:
    • A config attribute that specifies the absolute path and file name of the Reuters configuration file
    • A sessionName attribute that specifies a session name corresponding to the one used in the Reuters configuration file
      <rfa config="$ESP_REUTERS_HOME/config/rfasub.cfg"
      sessionName="Session1" />
    The rfa element may also include attributes to modify the adapter's treatment of blanks (by default it converts them to zeros). You can specify the value for the blank attribute or specify values for each datatype directly using the blankInt32, blankInt64, blankMoney, blankString, blankDate, and blankTimestamp attributes. Specify a value that does not conflict with any of the values you expect in your data. If you are using both input and output adapters, specify the same value for each attribute to both adapters.
  9. Between the rfa element and the closing adapter tag, add the opening and closing itemLists tags. When entering the opening itemLists tag:
    • Specify the Reuters service from which the adapter is receiving RMDS data as the value of the service attribute.
    • Specify the name of the Event Stream Processor stream that is receiving the RMDS data as the value of the stream attribute.
      <itemLists service="IDN_RDF" stream="stream1">
      </itemLists>
    The itemLists tags will contain one or more pairs of opening and closing itemList tags.
  10. Between the itemLists tags, add opening and closing itemList tags for each separate list of RICs to which the adapter subscribes.
  11. Between the itemList tags, add an item element for each RIC to add to the list. When entering the item element:
    1. Specify an RIC to which the adapter subscribes as the value of the name attribute.
    2. (Optional) Specify the name of the queue you wish to use as the value of the rfaQueue attribute. Specifying an rfaQueue spawns a separate thread to do the processing.
    3. (Optional) Specify the name of the service to use.
      For example:
      <itemList>
      <item name="AAPL.O" rfaQueue="queue1" />
      <item name="CSCO.O" />
      </itemList>