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.
- Open a new map file using an editor.
- 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"
- Specify that this is an adapter map file and that includes a separate
file:
<!DOCTYPE adapter [
<!ENTITY rmdsFields SYSTEM "rmds.sm.mf.xml">
]>
- Add the opening and closing adapter tags. In the opening adapter tag, specify
the name of the adapter. For example:
<adapter name="mySubscribeAdapter1">
</adapter>
- 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.
- 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.
- Enter a streamMap element for each Event Stream Processor stream to which you wish to send RMDS
data. For each streamMap,
- 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.
- Enter the closing streamMap tag.
- 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>
- After the streamMaps section, add the rfa element, including:
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.
- Between the rfa element and the closing adapter tag, add the opening and
closing itemLists tags. When entering the opening itemLists tag:
The itemLists tags will contain one or more pairs of opening and closing itemList tags.
- Between the itemLists tags, add opening and closing itemList tags for each separate list of RICs to
which the adapter subscribes.
- Between the itemList tags, add an item element for each RIC to add to the list.
When entering the item element:
- Specify an RIC to which the adapter subscribes as the value of the name
attribute.
- (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.
- (Optional) Specify the name of the service to use.
For example:
<itemList>
<item name="AAPL.O" rfaQueue="queue1" />
<item name="CSCO.O" />
</itemList>