Contents
This sample demonstrates the use of the Spotfire Streaming Adapter for BM&FBovespa UMDF. See B3 UMDF Input Adapter for details on the use and structure of this adapter.
This sample use one instance of the UMDF Input Adapter to connect to the BM&FBOVESPA UMDF market feed and provide market data. In order to run this sample, you must have access to one of BM&FBOVESPA's UMDF feeds for the adapter to use.
Once the application has started, you can use the adapter to subscribe to one or more instruments to obtain instrument definition, initial snapshot, incremental updates and other FAST messages for those instruments as they are issued by the market feed.
Note
This sample fails to appear in the Import Samples and Community Content dialog unless you installed the High Performance FIX Engine option in your StreamBase installation.
This sample also requires your company's access credentials to the BM&FBOVESPA exchange.
In StreamBase Studio, import this sample with the following steps:
-
From the top-level menu, select
> . -
Enter
umdf
to narrow the list of options. -
Select BM&FBOVESPA UMDF Input adapter from the StreamBase Market Data Adapters category.
-
Click
.
StreamBase Studio creates a single project containing the sample files.
-
In the Project Explorer view, open this sample's folder.
Keep an eye on the bottom right status bar of the Studio window. Make sure any
Updating
,Downloading
,Building
, orRebuild
project messages finish before you proceed. -
Open the
src/main/eventflow/
folder.packageName
-
Double-click to open the
umdf.sbapp
module. Make sure the module is the currently active tab in the EventFlow Editor. -
In the
src/main/resources
folder, edit thechannelDefinitions.xml
file to input the proper IP addresses and ports supplied to your company by BM&FBOVESPA to access the UMDF data feeds. See B3 UMDF Input Adapter for details on editing this file. -
Be sure to obtain an up-to-date version of the UMDF FAST templates definition file (named
templates-UMDF.xml
) from BM&FBOVESPA, and place it in the sample'ssrc/main/resources
folder. Make sure the adapter's FAST Template File property points to this file. -
Click the Run button. This opens the SB Test/Debug perspective and starts the module.
-
Wait for the Waiting for fragment to initialize message to clear.
-
In the Manual Input view, select the Subscriptions stream. Enter the following values and click
:-
Command:
Subscribe
-
ChannelID:
MyChannel
-
SymbolID:
SomeSymbol
where
MyChannel
is the value specified in thechannelDefinitions.xml
file'schannel id="MyChannel"
attribute, andMySymbol
is the name of a valid instrument handled by this UMDF feed. -
-
After you have sent the command, the adapter connects to the configured Instrument Definition stream and obtains the definition for the specified symbol. Once received, the adapter issues a tuple on the InstrumentDefinitions output port that contains the contents of the received FAST message.
Note
This step happens only the first time you subscribe to this symbol in the lifetime of the module. If you later unsubscribe and resubscribe, this tuple is not generated.
-
The adapter next sends a tuple on the Events port to indicate the subscription to the symbol has succeeded.
-
The adapter connects to the configured UMDF Recovery stream to obtain the current state of the book for this instrument. Once the snapshot is obtained, a tuple is emitted on the Snapshots output port with the information.
-
At this point the adapter starts emitting tuples on the IncrementalRefreshes port as updates become available.
-
You can also periodically observe messages of type News and others being generated on the OtherMessages port as they are received.
-
When done, press F9 or click the Terminate EventFlow Fragment 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_adapter_embedded_umdf
See Default Installation
Directories for the default location of studio-workspace
on your system.