InfoReach TMS Adapter Sample

This sample demonstrates the use of the StreamBase InfoReach TMS Adapter, which connects to the InfoReach Trade Management System (TMS).

Sample Location

By default, the sample files are installed in:

On Windows

C:\Program Files\StreamBase Systems\StreamBase.n.m\sample\adapter\embedded\inforeach-tms\

On UNIX

/opt/streambase/sample/adapter/embedded/inforeach-tms/

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_inforeach-tms
Windows XP:
  C:\Documents and Settings\username\My Documents\StreamBase Studio n.m Workspace\
      sample_adapter_embedded_inforeach-tms
Windows Vista:
  C:\Users\username\Documents\StreamBase Studio n.m Workspace\
      sample_adapter_embedded_inforeach-tms

Preparing to Run the Sample

  1. Make sure the InfoReach TMS system is available on your system.

Running the Sample in StreamBase Studio

  1. In the Package Explorer, double-click to open the inforeach-tms.sbapp application.

  2. In the EventFlow editor, click the TMS adapter's icon to display the adapter's Properties view. In the Adapter Settings tab, inspect the TMS Installation Directory value, which has a certain Windows path by default. Edit this path as appropriate for your system.

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

  4. In the Test/Debug Perspective, look in the Console view for several pages of messages as the TMS client-side system is started. After this, look for messages like the following:

    [notice] StreamBase InfoReach TMS Adapter: TMS system started

    [notice] sbd at hostname:10000; pid=4568; Listening

  5. As portfolio, target, and order messages are sent by TMS, tuples are emitted on the corresponding output stream. In the Application Output view, select one of the streams to observe the incoming tuples.

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

Running the 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 two terminal windows on UNIX, or two 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 inforeach-tms.sbapp

    If the adapter connects successfully to TMS, you see several pages of messages as the TMS client-side system is started. Look for the following messages:

    [notice] StreamBase InfoReach TMS Adapter: TMS system started

    [notice] sbd at hostname:10000; pid=4568; Listening

  3. In window 2, type:

    sbc dequeue -v

    This window displays the tuples dequeued from the adapter's output ports as portfolio, target, and order messages are sent by TMS.

  4. In window 2, type: Ctrl-Z (Windows) or Ctrl-D (UNIX) to exit the sbc session.

  5. In window 2, type the following command to terminate the server:

    sbadmin shutdown