Contents
This sample demonstrates the use of the StreamBase ActivFeed Input Adapter.
By default, the sample files are installed in:
- On Windows:
-
C:\Program Files\StreamBase Systems\StreamBase.n.m\sample\adapter\embedded\activfeed\ - On UNIX:
-
/opt/streambase/sample/adapter/embedded/activfeed/
-
Obtain/edit the
ServiceLocation.xmlfile for your Activ Content Gateway (ACG) server location, and determine the username and password to access it. -
If you want to subscribe to one or more symbols when the adapter starts, add the appropriate lines to the initial subscription file,
initial_subscriptions.csv. This file contains a number of example subscriptions you can use as a starting point.
-
In the Package Explorer, double-click to open the
activfeed.sbappapplication. Make sure the application is the currently active tab in the EventFlow Editor. -
Double-click the ActivFeed icon to open the StreamBase Properties view for the adapter.
-
Click the Adapter Settings tab and enter values for the
Activ ServiceLocation.xmlpathname, username, and password file path names, and edit theuid.txtandpw.txtfiles with your ActivFeed account UserID and password, respectively. Also, edit or replace theServiceLocation.xmlfile with entries that you have for your ActivFeed account. (Connect to the ActivFeed server that will provide data that matches your account type.) -
Optional: Edit the
presubscribe.csvfile 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). -
Click the Edit Schema tab and, optionally, change the set of fields you would like to have appear in the market data output tuples.
-
Click the
Run StreamBase Application (Default Launch) button.
(Not the Run button.) This opens the
Test/Debug perspective and starts the application.
-
In the Test/Debug Perspective, open the Console view. If it is not already open: click → → . If the adapter connects successfully, you see a single message like the following:
[notice] sbd at hostname:10000; pid=4568; Listening -
Optional (if not using the
presubscribe.csvfile): In the Manual Input view, select the subscribe stream, and, in thesubscribe,fill in thecommand, symbol, relationships, andtablesfields, respectively, enter subeq,MSFT.Q,NONE, andall. Then click . -
In the Application Output view, observe the tuples emitted from the MarketDataOutputStream stream.
-
Click → (F9).
Open four StreamBase Command Prompt or terminal windows, setting the default directory to the one containing the ActivFeed sample files.
-
Edit the StreamBase Server configuration file,
sbd.sbconf, replacing the placeholder host, port, username, and password values at the bottom of the file with the actual values for your site. -
In window 1, type:
sbd -f sbd.sbconf activfeed.sbappIf the adapter connects successfully to the CSP, you see a single message like the following:
[notice] sbd at hostname:10000; pid=4568; Listening -
In window 2, type:
sbc dequeue MarketDataOutputStreamThis window displays the tuples dequeued from the adapter's market data port.
-
In window 3, type:
sbc dequeue AdapterStatusMessagesThis window displays the tuples dequeued from the adapter's status port.
-
In window 4, type:
echo subeq,MSFT.Q,OPTION,all | sbc enqueue subscribe -
In window 2, observe the tuples emitted from the MarketDataOutputStream stream.
-
In window 4, type:
echo listsym,x,x,x | sbc enqueue subscribeecho listrels,x,x,x | sbc enqueue subscribeecho listtables,x,x,x | sbc enqueue subscribe -
In window 2, observe the information tuples listing all symbols received, all relationships you can use in subscriptions, and table names that can be used.
-
Type Ctrl-C in window 1 to stop the StreamBase application and the dequeuer.
