Contents
This sample demonstrates the use of the TIBCO StreamBase® Adapter for Thomson Reuters Enterprise Platform for Real-Time Publishing (formerly known as the Thomson Reuters RMDS Publishing Output Adapter).
-
By default, the publishing adapter listens on TCP port 14002. To use a different port, edit the RFA configuration file,
rfa-config.xml
, and change the<portNumber>
parameter of the<RSSLProviderConnection>
node to the desired value.
-
In the Package Explorer, double-click to open one of the four message model-specific sample applications:
MarketPrice.sbapp
,MarketByOrder.sbapp
,MarketByPrice.sbapp
, orMarketMaker.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.
-
If you wish to publish to a different Reuters service than the default (
DIRECT_FEED
), click the Adapter Settings tab and change the Publish Service Name property to the desired value. -
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. Look for an event tuple emitted on the
EventOut
stream indicating the adapter succeeded in listening for incoming connections. -
Use a TREP-RT subscribing client, such as one of the sample applications provided with the StreamBase TREP-RT Subscribing adapter, to subscribe to an item being published. Note that each sample application is driven by a message model-specific CSV file (such as
MarketPriceFeed.csv
) containing recorded feed data for the following items:-
MarketPrice: AAPL.O, DIS.N, EBAY.O, GOOG.O, IBM.N, INTC.O, MSFT.O, NKE.C
-
MarketByOrder: AAPL.ARC, EBAY.ARC, GOOG.ARC, INTC.ARC, MSFT.ARC
-
MarketByPrice: AAPL.ARC, EBAY.ARC, GOOG.ARC, INTC.ARC, MSFT.ARC
-
MarketMaker: AAPL.OQ, EBAY.OQ, GOOG.OQ, INTC.OQ, MSFT.OQ
-
-
When the client subscribes to an item listed above, look for event tuples emitted on the
EventOut
stream indicating the client has established a session with the publisher (EventType=ClientSession
) and has subscribed to an item (EventType=Item, Action=Subscribe
). (When using the client in direct-connect mode, you might also see login and dictionary download event tuples.) -
In the Manual Input view, select the
DumpIn
stream and click . One tuple per item being published appears in the Application Output view from theDumpOut
stream. Items with active subscriptions are identified as such (table_ActiveSubscription=true
). -
In the Manual Input view, select the
InfoQueryIn
stream, enterListSubscriptions
in theCommand
field, and click . One tuple per active subscription (as recorded within the adapter) 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, enter
DumpDictionary
in theCommand
field and click . One tuple per Reuters dictionary field 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. -
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 three terminal windows on UNIX, or three 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.
-
Use a TREP-RT subscribing client, such as one of the sample applications provided with the StreamBase TREP-RT Subscribing adapter, to subscribe to one or more of the items being published by this sample.
-
In window 2, observe that event tuples are emitted on the
EventOut
stream, indicating the client has established a session with the publisher (EventType=ClientSession
) and has subscribed to an item (EventType=Item, Action=Subscribe
). -
In window 3, type:
echo null | sbc enqueue DumpIn
-
In window 2, observe that a tuple is emitted on the
DumpOut
stream for each item being published. Items with active subscriptions are identified as such (table_ActiveSubscription=true
). -
In window 3, type:
echo ListSubscriptions,null,null | sbc enqueue InfoQueryIn
-
In window 2, observe that a tuple is emitted on the
InfoQueryOut
stream for each active subscription, as recorded by the publishing adapter. -
In window 3, type:
echo DumpDictionary,null,null | sbc enqueue InfoQueryIn
-
In window 2, observe that a tuple is emitted on the
InfoQueryOut
stream for each field in the Reuters dictionary. -
In window 3, 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 Output 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-pub
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-pub
See Default Installation Directories for the default location of studio-workspace
on your system.