Thomson Reuters Enterprise Platform for Real-Time Subscribing Input Adapter Sample

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

Preparing to Run the Sample

  1. Edit the RFA configuration file, rfa-config.xml. Changing the P2PS (<serverList> and <portNumber>) parameters to match the Reuters infrastructure at your site.

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

Running This Sample in StreamBase Studio

  1. In the Package Explorer, double-click to open one of the four message model-specific sample applications: MarketByOrder.sbapp, MarketByPrice.sbapp, MarketMaker.sbapp, or MarketPrice.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. 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.)

  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. 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 the initial_subscriptions.txt file, look for tuples emitted from the MarketData stream as well.

  6. In the Manual Input view, select the InfoQueryIn stream, enter ListSubscriptions and MyTag in the Command and Tag fields, respectively, and click Send Data. One tuple per initial subscription 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.

  7. In the Manual Input view, select the DynamicSubscribe stream. Enter values in the Service and Item fields. (If using the Market Feed sample, you can enter a four-part subject value in the Subject field instead). Enter true in either the Subscribe or Snapshot fields and click Send Data. If the item you entered is active, look for one or more tuples representing the item's initial state emitted on the MarketData stream in the Application Output view. If you enter true in the Subscribe field, a series of update tuples is emitted from the MarketData stream as well.

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

  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. In window 3, type:

    echo ListSubscriptions,MyTag | sbc enqueue InfoQueryIn

  5. Observe in windows 2 that a tuple is emitted on the InfoQueryOut port for each active subscription, followed by a tuple with a value of true in its Done field.

  6. In window 4, subscribe to an Item:

    echo DIRECT_FEED,MSFT.OQ,true,false | sbc enqueue DynamicSubscribe

  7. Observe in windows 2 that one or more tuples representing the item's initial state are emitted from the MarketData stream.

  8. In window 3 or 4, 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 Input 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-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.