Contents
This sample demonstrates the use of the TIBCO StreamBase® Adapter for Bloomberg Server API and the StreamBase Adapter for Bloomberg B-Pipe.
Bloomberg B-Pipe is an embedded adapter that can connect to a Bloomberg B-Pipe process to subscribe to and get data from the process. The Adapter for Bloomberg Server API is an embedded adapter that can connect to a Bloomberg Server API process to subscribe to and get data from the process.
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.
In StreamBase Studio, import this sample with the following steps:
-
From the top-level menu, click
→ . -
Type
bloo
to narrow the list of options. -
Select the Bloomberg Server API/Managed B-Pipe input adapter from the StreamBaase Market Data Adapters category.
-
Click
.
StreamBase Studio creates a project for this sample.
-
In the Project Explorer, open the sample you just loaded.
-
Open the
src/main/eventflow
folder. -
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).
-
Open the
bloomberg-managed-bpipe.sbapp, bloomberg-managed-bpipe-srcref.sbapp,
orbloomberg-serverapi.sbapp
application file. -
Select the Bloomberg adapter icon to open the Properties view for the adapter.
-
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 application.
-
Select the Initial Subscriptions tab and enter additional subscriptions strings you would like the adapter to process when it starts.
-
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
→ from the context menu. -
In the Test/Debug Perspective, open the Output Streams 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. -
In the Manual Input view, enter
Subscribe
in theCommand
field and a topic in theTopic
field and click . Status tuples will appear in the Output Streams view indicating the success or failure of the subscription. Assuming one or more subscriptions were successful, MarketData tuples will appear in the Output Streams view. -
In the Manual Input view, enter
Unsubscribe
in theCommand
field and a topic in theTopic
field and click to unsubscribe from a Topic. Similarly, commandListSubs
will output the list of existing subscriptions. -
The adapter may also be used to get more information about Bloomberg data fields. Use
FieldInfo
in theCommand
field in Manual Input view to use the field commands. For example, withCommand
asFieldInfo
:-
Enter
LAST_PRICE
inId
field and click . In the Output Streams view, a Metadata tuple will appear giving more information aboutLAST_PRICE
field. -
Enter
price
inSearchSpec
field,Equity
inProductType
,RealTime
inFieldType
, and click . In the Output Streams view, Metadata tuples appear with information about fields that match the search string price and are of theFieldType
andProductType
specified.
-
-
When done, press F9 or click the Stop Running Application button.
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_bloomberg-bpipe-serverapi
See Default Installation Directories for the default location of studio-workspace
on your system.