Bloomberg Server API and B-Pipe Adapter Samples

This sample demonstrates the use of the TIBCO StreamBase® Adapter for Bloomberg Server API and the StreamBase Adapter for Bloomberg B-Pipe.

Preparing to Run the Sample

To run this sample, you must have a Bloomberg Managed B-Pipe or Server API server running. Please contact Bloomberg support to get the server installed.

Running This Sample in StreamBase Studio

  1. In the Package Explorer, double-click bloomberg-managed-bpipe.sbapp or bloomberg-serverapi.sbapp.

  2. Select the Bloomberg adapter icon to open the Properties view for the adapter.

  3. Select the Adapter Properties tab and enter the server host name and port number, if it is different from the one configured in the sample app.

  4. Select the Initial Subscriptions tab and enter additional subscriptions strings you would like the adapter to process when it starts.

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

  6. In the Test/Debug Perspective, open the Application Output view. If the adapter is able to connect to the Bloomberg server, Status and MarketData tuples will appear. The MarketData tuples are as a result of the subscriptions listed in Initial Subscriptions tab.

  7. In the Manual Input view, enter Subscribe in the Command field and a topic in the Topic field and click Send Data. Status tuples will appear in the Application Output view indicating the success or failure of the subscription. Assuming one or more subscriptions were successful, MarketData tuples will appear in the Application Output view.

  8. In the Manual Input view, enter Unsubscribe in the Command field and a topic in the Topic field and click Send Data to unsubscribe from a Topic. Similarly, command ListSubs will output the list of existing subscriptions.

  9. The adapter may also be used to get more information about Bloomberg data fields. Use FieldInfo in the Command field in Manual Input view to use the field commands. For example, with Command as FieldInfo:

    • Enter LAST_PRICE in Id field and click Send Data. In Application Output, a Metadata tuple will appear giving more information about LAST_PRICE field.

    • Enter price in SearchSpec field, Equity in ProductType, RealTime in FieldType, and click Send Data. In the Application Output view, Metadata tuples appear with information about fields that match the search string price and are of the FieldType and ProductType specified.

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

Importing This Sample into StreamBase Studio

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

  • From the top menu, click FileLoad StreamBase Sample.

  • Select this sample from the Embedded Input Adapters list.

  • Click OK.

StreamBase Studio creates a project for this sample.

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 the permission problems that can occur when trying to work with the initially installed location of the sample. The default workspace location for this sample is:

studio-workspace/sample_bloomberg-bpipe-serverapi

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

In the default TIBCO StreamBase installation, this sample's files are initially installed in:

streambase-install-dir/sample/bloomberg-bpipe-serverapi

See Default Installation Directories for the location of streambase-install-dir on your system. This location may require administrator privileges for write access, depending on your platform.