Contents
This sample demonstrates the use of the TIBCO StreamBase® Adapter for Thomson Reuters Enterprise Platform for Real-Time Subscribe (formerly known as the Thomson Reuters RMDS Subscribing Input Adapter).
-
Edit the RFA configuration file,
rfa-config.xml
. Changing the P2PS (<serverList>
and<portNumber>
) 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 four message model-specific sample applications:
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
Events
stream. Events provide the login and dictionary load status. If you have added initial subscriptions to theinitial_subscriptions.txt
file, look for tuples emitted from theMarketData
stream as well. -
In the Manual Input view, select the
InfoQueryIn
stream, enterListSubscriptions
andMyTag
in theCommand
andTag
fields, respectively, and click . One tuple per initial subscription appears in the Application Output view from theInfoQueryOut
stream. A marker withDone=true
and all other fieldsnull
is the last tuple to appear on this stream. -
In the Manual Input view, select the
DynamicSubscribe
stream. Enter values in theService
andItem
fields. (If using the Market Feed sample, you can enter a four-part subject value in theSubject
field instead). Entertrue
in either theSubscribe
orSnapshot
fields and click . If the item you entered is active, look for one or more tuples representing the item's initial state emitted on theMarketData
stream in the Application Output view. If you entertrue
in theSubscribe
field, a series of update tuples is emitted from theMarketData
stream 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 -v
This 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
InfoQueryOut
port for each active subscription, followed by a tuple with a value oftrue
in itsDone
field. -
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
MarketData
stream. -
In window 3 or 4, type the following command to terminate the server and dequeuer:
sbadmin shutdown
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.
When you load the sample into StreamBase Studio, Studio copies the sample project's files to your Studio workspace, which is normally part of your home directory, with full access rights.
Important
Load this sample in StreamBase Studio, and thereafter use the Studio workspace copy of the sample to run and test it, even when running from the command prompt.
Using the workspace copy of the sample avoids the permission problems that can occur when trying to work with the initially installed location of the sample. The default workspace location for this sample is:
studio-workspace
/sample_adapter_embedded_reuters-rmds-sub
See Default Installation Directories for the location of studio-workspace
on your system.
In the default TIBCO StreamBase installation, this sample's files are initially installed in:
streambase-install-dir
/sample/adapter/embedded/reuters-rmds-sub
See Default Installation Directories for the default location of studio-workspace
on your system.