Contents
This sample demonstrates the use of the Thomson Reuters Enterprise Platform for Real-Time (TREP-RT) Subscribing Input Adapter (formerly known as the Thomson Reuters RMDS Subscribing Input Adapter).
In StreamBase Studio, import this sample with the following steps:
-
From the top menu, click → .
-
Select this sample from the Embedded Input Adapters list.
-
Click OK.
StreamBase Studio creates a project for this sample.
By default, the sample files are installed in:
- On Windows
-
C:\Program Files\StreamBase Systems\StreamBase.n.m\sample\adapter\embedded\reuters-rmds-sub\ - On UNIX
-
/opt/streambase/sample/adapter/embedded/reuters-rmds-sub/
When you load the sample into StreamBase Studio, Studio copies the sample project's
files to your Studio workspace. StreamBase Systems recommends that you use the
workspace copy of the sample, especially on UNIX, where you may not have write access
to /opt/streambase. In the default installation, the
path to this sample in your Studio workspace is:
UNIX: ~/streambase-studio-n.m-workspace/sample_adapter_embedded_reuters-rmds-sub Windows XP: C:\Documents and Settings\username\My Documents\StreamBase Studion.mWorkspace\ sample_embedded_reuters-rmds-sub Windows 7 and Windows Vista: C:\Users\username\Documents\StreamBase Studion.mWorkspace\ sample_embedded_reuters-rmds-sub
-
Edit the RFA configuration file,
rfa-config.xml. Changing the P2PS (serverListandportNumber) or RTIC (daemon,network, andservice) parameters to match the Reuters infrastructure at your site. -
If you want to subscribe to one or more items when the adapter starts, add lines to the initial subscription file,
initial_subscriptions.txt. This file contains a number of commented-out example subscriptions you can use as a starting point.
-
In the Package Explorer, double-click to open one of the five message model-specific sample applications:
MarketFeed.sbapp(RMDS 5),MarketByOrder.sbapp,MarketByPrice.sbapp,MarketMaker.sbapp, orMarketPrice.sbapp. Make sure the application is the currently active tab in the EventFlow Editor. -
Select the adapter icon to open the Properties view for the adapter.
-
Select the Adapter Settings tab and enter values for Username, Position, and Application, if required at your site. (At many sites, one or more of these parameters are unused, and can be left blank.)
-
Click the
Run button. This opens the SB
Test/Debug perspective and starts the application.
-
In the Test/Debug Perspective, open the Application Output view. If connectivity to your RFA infrastructure is configured correctly, look for several event tuples emitted on the
Eventsstream. When using the Market Feed (RMDS 5) application, the events indicate the state of the Reuters connection and service(s). When using one of the four RMDS 6 applications, events provide the login and dictionary load status. If you have added initial subscriptions to theinitial_subscriptions.txtfile, look for tuples emitted from theMarketDatastream as well. -
In the Manual Input view, select the
InfoQueryInstream, enterListSubscriptionsandMyTagin theCommandandTagfields, respectively, and click . One tuple per initial subscription appears in the Application Output view from theInfoQueryOutstream. A marker withDone=trueand all other fieldsnullis the last tuple to appear on this stream. -
In the Manual Input view, select the
DynamicSubscribestream. Enter values in theServiceandItemfields. (If using the Market Feed sample, you can enter a four-part subject value in theSubjectfield instead). Entertruein either theSubscribeorSnapshotfields and click . If the item you entered is active, look for one or more tuples representing the item's initial state emitted on theMarketDatastream in the Application Output view. If you entertruein theSubscribefield, a series of update tuples is emitted from theMarketDatastream as well. -
When done, press F9 or click the
Stop Running Application button.
This section describes how to run the sample in UNIX terminal windows or Windows command prompt windows. On Windows, be sure to use the StreamBase Command Prompt from the Start menu as described in the Test/Debug Guide, not the default command prompt.
-
Open four terminal windows on UNIX, or four StreamBase Command Prompts on Windows. In each window, navigate to the directory where the sample is installed, or to your workspace copy of the sample, as described above.
-
In window 1, type:
sbd MarketPrice.sbapp -
In window 2, type:
sbc dequeue -vThis window will display the tuples dequeued from the adapter's output ports.
-
In window 3, type:
echo ListSubscriptions,MyTag | sbc enqueue InfoQueryIn -
Observe in windows 2 that a tuple is emitted on the
InfoQueryOutport for each active subscription, followed by a tuple with a value oftruein itsDonefield. -
In window 4, subscribe to an Item:
echo DIRECT_FEED,MSFT.OQ,true,false | sbc enqueue DynamicSubscribe -
Observe in windows 2 that one or more tuples representing the item's initial state are emitted from the
MarketDatastream. -
In window 3 or 4, type the following command to terminate the server and dequeuer:
sbadmin shutdown
