ActivFeed Input Adapter Sample

This sample demonstrates the use of the Spotfire Streaming Adapter for Activ Financial.

Preparing to Run the Sample

  1. Obtain/edit the ServiceLocation.xml file for your Activ Content Gateway (ACG) server location, and determine the username and password to access it.

  2. If you want to subscribe to one or more symbols when the adapter starts, add the appropriate lines to the initial subscription file, presubscribe.csv. This file contains a number of example subscriptions you can use as a starting point.

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 activfeed to narrow the list of options.

  • Select ActivFeed input adapter from the StreamBase Market Data Adapters category.

  • Click Import Now.

StreamBase Studio creates a single project for the operator samples.

Running This Sample in StreamBase Studio

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

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

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

  4. Double-click the ActivFeed icon to open the StreamBase Properties view for the adapter.

  5. Click the Adapter Settings tab and enter values for the ActivFeed ServiceLocation.xml pathname as well as a username and password with your ActivFeed account UserID and password, respectively. Also, edit or replace the ServiceLocation.xml file with entries that you have for your ActivFeed account. (Connect to the ActivFeed server that will provide data that matches your account type.)

  6. Optional: Edit the presubscribe.csv file with symbols and relationships of interest. Refer to Activ documentation for the symbology, relationship names (typical: NONE, OPTION, FUTURE) and table names ("all" is generally sufficient).

  7. Click the Edit Schema tab and, optionally, change the set of fields you would like to have appear in the market data output tuples.

  8. Open the named application file and click the Run button. This opens the SB Test/Debug perspective and starts the module.

    If you see red marks, wait a moment for the project in Studio, 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.

  9. In the Test/Debug Perspective, open the Console view. If it is not already open: click Window>Show View>Console. If the adapter connects successfully, you see a single message like the following:

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

  10. Optional (if not using the presubscribe.csv file): In the Manual Input view, select the subscribe stream, and, in the subscribe, fill in the command, symbol, relationships, and tables fields, respectively, enter subeq, MSFT.Q, NONE, and all. Then click Send Data.

  11. In the Output Streams view, observe the tuples emitted from the MarketDataOutputStream stream.

  12. 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_activfeed

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