Thomson Reuters Enterprise Platform for Real-Time Publishing Output Adapter Sample

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).

Preparing to Run the Sample

  1. 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.

Running the Sample in StreamBase Studio

  1. In the Package Explorer, double-click to open one of the four message model-specific sample applications: MarketPrice.sbapp, MarketByOrder.sbapp, MarketByPrice.sbapp, or MarketMaker.sbapp. Make sure the application is the currently active tab in the EventFlow Editor.

  2. Select the adapter icon to open the Properties view for the adapter.

  3. 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.

  4. Click the Run button. This opens the SB Test/Debug perspective and starts the application.

  5. 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.

  6. 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:

    1. MarketPrice: AAPL.O, DIS.N, EBAY.O, GOOG.O, IBM.N, INTC.O, MSFT.O, NKE.C

    2. MarketByOrder: AAPL.ARC, EBAY.ARC, GOOG.ARC, INTC.ARC, MSFT.ARC

    3. MarketByPrice: AAPL.ARC, EBAY.ARC, GOOG.ARC, INTC.ARC, MSFT.ARC

    4. MarketMaker: AAPL.OQ, EBAY.OQ, GOOG.OQ, INTC.OQ, MSFT.OQ

  7. 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.)

  8. In the Manual Input view, select the DumpIn stream and click Send Data. One tuple per item being published appears in the Application Output view from the DumpOut stream. Items with active subscriptions are identified as such (table_ActiveSubscription=true).

  9. In the Manual Input view, select the InfoQueryIn stream, enter ListSubscriptions in the Command field, and click Send Data. One tuple per active subscription (as recorded within the adapter) appears in the Application Output view from the InfoQueryOut stream. A marker with Done=true and all other fields null is the last tuple to appear on this stream.

  10. In the Manual Input view, enter DumpDictionary in the Command field and click Send Data. One tuple per Reuters dictionary field appears in the Application Output view from the InfoQueryOut stream. A marker with Done=true and all other fields null is the last tuple to appear on this stream.

  11. When done, press F9 or click the Stop Running Application button.

Running This Sample in Terminal Windows

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.

  1. 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.

  2. In window 1, type:

    sbd MarketPrice.sbapp

  3. In window 2, type:

    sbc dequeue -v

    This window will display the tuples dequeued from the adapter's output ports.

  4. 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.

  5. 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).

  6. In window 3, type:

    echo null | sbc enqueue DumpIn

  7. 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).

  8. In window 3, type:

    echo ListSubscriptions,null,null | sbc enqueue InfoQueryIn

  9. In window 2, observe that a tuple is emitted on the InfoQueryOut stream for each active subscription, as recorded by the publishing adapter.

  10. In window 3, type:

    echo DumpDictionary,null,null | sbc enqueue InfoQueryIn

  11. In window 2, observe that a tuple is emitted on the InfoQueryOut stream for each field in the Reuters dictionary.

  12. In window 3, type the following command to terminate the server and dequeuer:

    sbadmin shutdown

Importing This Sample into StreamBase Studio

In StreamBase Studio, import this sample with the following steps:

  • From the top menu, click FileLoad StreamBase Sample.

  • Select this sample from the Embedded Output Adapters list.

  • Click OK.

StreamBase Studio creates a project for this sample.

Sample Location

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 location of streambase-install-dir on your system. This location may require administrator privileges for write access, depending on your platform.