Exegy Adapter Sample

About This Sample

This sample demonstrates the use of the TIBCO StreamBase® Adapter for Exegy.

Exegy Middleware Dependencies

The StreamBase Exegy adapter relies on version 3.5.0 or later of the JAR file that implements the Exegy Client API, XCAPI.jar. This file is supplied as part of your Exegy installation and is not shipped with StreamBase. If you get an error message whose text refers to NoClassDefFoundError: com/exegy/xcapi/XCException, make sure this JAR file is locatable by the adapter on the path specified in the CLASSPATH environment variable.

The StreamBase Exegy adapter also relies on version 3.5.0 or later of the native library that implements the Exegy Client API, libjnixcapi64.so on Linux and jnixcapi64.DLL on Windows. This file is supplied as part of your Exegy installation and is not shipped with StreamBase. If you get an error message whose text refers to Failed to load Java XCAPI library (jnixcapi64), make sure this file is locatable by the adapter on the path specified in the LD_LIBRARY_PATH environment variable on Linux or in the PATH environment variable on Windows.

The Exegy API implementation described in this section is a product of a third party, and its specifications and file names are subject to change by Exegy. See your Exegy documentation for the latest information.

Importing This Sample into StreamBase Studio

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

  • From the top-level menu, click FileLoad StreamBase Sample.

  • Type exe to narrow the list of options.

  • Select Exegy input adapter from the StreamBase Market Data adapters category.

  • Click OK.

StreamBase Studio creates a project for this sample.

Running ExegySample.sbapp in StreamBase Studio

  1. In the Project Explorer, open the sample you just loaded.

  2. Open the src/main/eventflow folder.

  3. Open the package folder (most samples contain a single package folder. Open the top-level package folder if your sample contains more than one folder).

  4. Open the named application file and select the adapter icon to open the Properties view for the adapter.

  5. Select the Connection Properties tab and enter values for Exegy Server Host, Login Username, and Login Password.

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

    If you see red marks, wait a moment for the project in Studio to load its features.

    If red marks do not resolve themselves in a moment, select the project and right-click MavenUpdate Project from the context menu.

  7. In the Test/Debug Perspective, open the Application Output view. Observe a tuple on the Dictionary stream containing a list of tuples, one for each field in the Exegy dictionary.

  8. In the Manual Input view, select the Admin input stream, enter connect in the command field, and click Send Data. An additional tuple appears in the Application Output view from the Status stream indicating the adapter has connected to the Exegy server.

  9. In the Manual Input view, select the Subscribe input stream, enter subscribe, US:N:IBM, level_one, and equity in the command, symbol, subscriptionType, and containerType fields, respectively, then optionally add values for PassThru and maxQuoteRate and click Send Data. A tuple appears in the Application Output view from the Status stream indicating the subscription request has been processed, followed by a series of refresh (XC_MESSAGE_TYPE=0), quote (2), and trade (3) tuples on the Equities stream.

  10. In the Manual Input view, again in the Subscribe input stream, enter unsubscribe in the command field, leave the remaining fields unchanged, and click Send Data. A tuple appears in the Application Output view from the Status stream indicating the unsubscribe request has been processed, and the flow of tuples from the Equities stream stops.

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

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 permission problems. The default workspace location for this sample is:

studio-workspace/sample_exegy

See Default Installation Directories for the default location of studio-workspace on your system.