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 will only run on Linux platforms. While you may use Studio to write your EventFlow applications on any supported platform, in order to run your applications they will need to be deployed to a Linux machine. This is due to the fact that as since version 4.0, the Exegy Client API only provides Java support on Linux.

The StreamBase Exegy adapter relies on version 4.10.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 4.10.0 or later of the native library that implements the Exegy Client API, libjnixcapi64.so. This file is supplied as part of your Exegy installation and is not shipped with TIBCO Streaming. 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 File>Import Samples and Community Content.

  • Enter exe to narrow the list of options.

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

  • Click Import Now.

StreamBase Studio creates a project for this sample.

Running This Sample in StreamBase Studio

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

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

    If the red marks do not resolve themselves after a minute, select the project, right-click, and select Maven>Update Project from the context menu.

  2. Open the src/main/eventflow/packageName folder.

  3. Open the ExegySample.sbapp file and select the adapter icon to open the Properties view for the adapter.

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

  5. Click the Run button. This opens the SB Test/Debug perspective and starts the module.

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

  7. 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 Output Streams view from the Status stream indicating the adapter has connected to the Exegy server.

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

  9. 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 Output Streams view from the Status stream indicating the unsubscribe request has been processed, and the flow of tuples from the Equities stream stops.

  10. When done, press F9 or click the Terminate EventFlow Fragment 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.