Contents
This sample demonstrates the use of the StreamBase Thomson Reuters Enterprise Platform for Real-Time (TREP-RT) Publishing Output Adapter (formerly known as the Thomson Reuters RMDS Publishing Output Adapter).
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.
By default, the sample files are installed in:
- On Windows
-
C:\Program Files\StreamBase Systems\StreamBase.n.m\sample\adapter\embedded\reuters-rmds-pub\ - On UNIX
-
/opt/streambase/sample/adapter/embedded/reuters-rmds-pub/
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-pub Windows XP: C:\Documents and Settings\username\My Documents\StreamBase Studion.mWorkspace\ sample_embedded_reuters-rmds-pub Windows 7 and Windows Vista: C:\Users\username\Documents\StreamBase Studion.mWorkspace\ sample_embedded_reuters-rmds-pub
-
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 theportNumberparameter of theRSSLProviderConnectionnode 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
EventOutstream 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
EventOutstream 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
DumpInstream and click . One tuple per item being published appears in the Application Output view from theDumpOutstream. Items with active subscriptions are identified as such (table_ActiveSubscription=true). -
In the Manual Input view, select the
InfoQueryInstream, enterListSubscriptionsin theCommandfield, and click . One tuple per active subscription (as recorded within the adapter) 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, enter
DumpDictionaryin theCommandfield and click . One tuple per Reuters dictionary field appears in the Application Output view from theInfoQueryOutstream. A marker withDone=trueand all other fieldsnullis 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 -vThis 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
EventOutstream, 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
DumpOutstream 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
InfoQueryOutstream 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
InfoQueryOutstream for each field in the Reuters dictionary. -
In window 3, type the following command to terminate the server and dequeuer:
sbadmin shutdown
