Samples Guide Contents

Document Conversion Incomplete

The StreamBase Samples Guide has been partially updated for StreamBase 10.

The instructions for many sample are correct for StreamBase 10, which others still provide sample descriptions and sample run instructions appropriate for StreamBase 7.x.

Running samples in StreamBase Studio 10 has changed from Run AsStreamBase Application to Run AsEventFlow Fragment. Running samples with the sbd command is no longer available; instead you now install and start a StreamBase Runtime node containing your EventFlow fragment, as described in Deploying EventFlow Fragments.

This Guide is expected to be thoroughly converted to describe StreamBase 10 features in upcoming releases.

StreamBase sample applications help you learn how to design EventFlow applications. The tables of available samples below are organized in the same categories found the Load StreamBase Sample dialog.

Topic Description
Loading Samples in Studio Using the FileLoad StreamBase Sample dialog.
TIBCO StreamBase Component Exchange Locating more examples in the TIBCO StreamBase Component Exchange.

Application Samples

This sample category includes EventFlow applications that focus on basic StreamBase functionality and solving business problems.

Topic Description
Authentication Sample Demonstrates what happens when you enable StreamBase authentication and then try to use certain sb* StreamBase commands, such as sbadmin shutdown.
Best Bids and Asks Sample Shows an example of a common stock trading application that tracks the highest bid price and lowest ask price for each stock.
Bollinger Band Sample Shows an example of a common analytical tool that provides a relative definition of high and low bands in securities trading.
Debugger Breakpoints Sample Shows how to set breakpoints for debugging applications in StreamBase Studio.
Error Streams Sample Demonstrates how to use Error Ports and Streams.
FeedProc Sample Shows an example of an application that processes financial tick data from three financial feeds, performing various useful computations on the data.
First Application Sample Use this sample while stepping through the tutorial in the Getting Started Guide. The tutorial is designed for first-time StreamBase Studio users.
Interfaces Sample Demonstrates how to use StreamBase interfaces to enforce a set of stream and schema definitions, and to use different implementations of the same interface for different purposes.
LDAP Authentication Sample Demonstrates what happens when you enable StreamBase LDAP authentication and then try to use certain sb* StreamBase commands, such as sbc dequeue and sbadmin shutdown.
Loop Sample Demonstrates how to use a simple loop in an EventFlow application.
MACD Sample Shows an example of a momentum indicator: a program that follows trends and shows the relationship between two moving averages of prices.
Output Filtering Sample Demonstrates the use of output filtering to allow StreamBase client applications to receive only the tuples that they are supposed to receive, based on a keyword.
Type Coercion Sample Demonstrates when a numeric data type can be automatically coerced to other types and when it cannot be coerced, illustrated by both list and tuple inputs.

Client Library Samples

This sample category demonstrate how to work with the StreamBase Client libraries to create client programs.

Topic Description
Buffering Sample Highlights the tuple buffering options for producer or enqueue clients.
Client Sample Provides sample enqueue and dequeue clients; that is, enqueuing (adding) tuples onto a named stream, and dequeuing (reading) processed tuples from a named stream. The samples include both Java or C++ sources.
ReadTable API Sample Provides sample Java code that illustrates the new StreamBaseClient.ReadTable() method, which is used to display all or a specified number of rows from a Query Table or Materialized Window.
TableOperator Java Client API Sample Provides sample Java code that illustrates the use of methods in the TableAccessor class, which lets Java operators and adapters interact with Query Tables. In particular, this class lets you insert and replace rows, read a single row based on the primary index, perform more complex multi-row queries, delete rows, and truncate entire tables.
Client Status Monitor Sample Demonstrates how to monitor the status of StreamBase clients using the Java Client API. The sample provides a Java application that runs a StreamBase client and tracks its connection status in four ways.

Data Construct and Operator Samples

The operator sample group illustrates all StreamBase operators in the Palette view, one sample per operator. The JDBC Query sample requires site-specific configuration and is thereby provided in a separate sample.

Topic Description
Operator Sample Group Operator Sample Group. Provides one small EventFlow module for each operator in the Palette view in StreamBase Studio.
Capture Fields for Generic Data Store Sample Demonstrates how to use a capture field in the schema of a Query Table to make that table reusable with variable schemas in different copies of its containing module.
Capture Fields and Parent Schemas Sample Demonstrates how to use capture fields in conjunction with parent schemas to create a reusable module that can match orders for FX trading in one instance and can match orders for Equities trading in another copy of the identical, unchanged module. The module uses abstract schemas for its input stream and Query Table that become concrete schemas in actual use.
Decision Table Operator Sample Demonstrates the decision table operator.
Field Grids Sample Demonstrates how to avoid or resolve conflicts, ambiguities and typechecking errors related to including and adding fields with names that conflict and related usage of declared local variables.
FTP Operator Sample Shows how to use the FTP operator to execute simple FTP client commands programmatically.
JDBC Table Data Construct Sample Demonstrates the Query operator when associated with a JDBC Table data construct. The EventFlow application in this sample cannot pass typechecking until you configure the sample to connect to an actual JDBC database at your site.
JSON to Tuple and Tuple to JSON Operator Sample Demonstrates the Tuple to JSON and JSON to Tuple operators.
Runtime Schema Cast Operator Sample Demonstrates the Runtime Schema Cast operator, which casts its input schema to its configured target output schema at run time.
XML Normalizer Operator Sample Demonstrates the XML Normalizer operator.
XML to Tuple and Tuple to XML Operator Sample Demonstrates the Tuple to XML and XML to Tuple operators.

Extending StreamBase Samples

You can extend StreamBase by writing your own custom clients, functions, embedded adapters, and Java operators, as illustrated in this category of samples.

Topic Description
EventFlow Function Sample Shows how to define EventFlow functions in operators and streams.
Custom Java Simple Function Sample Shows how to provide a custom simple function written in Java.
Custom Java Aggregate Function Sample Shows how to provide a custom aggregate function written in Java.
Custom Embedded Adapter Sample Shows how to provide a custom adapter written in Java.
Java Operator Sample Shows how to provide a custom operator written in Java. Shows a simple StringCase class that extends the StreamBase Client API's Operator class.
Java Operator Complex Types Sample Shows how to create a Java operator to retrieve fields and values from nested structures in a tuple, such as lists of integers or lists of tuples that contain a double.
Configuration File Access Sample Shows how to access elements from a configuration file from an operator or and adapter, allowing instances of the component to be easily and reliably configured.
Feed Simulation Conditional Field Sample Shows how to generate fields for feed simulations whose values depend on the contents of other fields.
Feed Simulation Custom Reader Sample Shows how to provide custom file reader functionality to the feed simulation mechanism.
Microsoft .NET Operator Sample Shows how to use the Microsoft .NET operator to integrate .NET code into your StreamBase application.
Calling an Embedded StreamBase Server from Java Shows how to run an embedded StreamBase Server from Java.
Logging with Log4j Using Log4j as a logging back-end to StreamBase logging.
Logging Samples Using Logback as a logging back-end to StreamBase logging.

Large Data Storage and Analysis

This sample category describes adapters and operators that connect StreamBase providers of so-called big data solutions.

Topic Description    
Apache Cassandra Operator Sample Shows how to use the Apache Cassandra operators to connect to a metaspace and exchange tuples with it from your StreamBase application.    
HBase Operator Samples Describes how to run the HBase Operator sample applications, which illustrates how to use the HBase operators when connecting a StreamBase application to an Apache HBase server.    
HDFS File Writer and File System Adapter Sample Apache Hadoop Distributed File System (HDFS) File Writer and File System adapter    
HDFS Binary File Reader/Writer Adapter Sample HDFS Binary file input and output adapters    
HDFS CSV File Reader Input Adapter Sample HDFS CSV File input adapter    
HDFS CSV File Writer Output Adapter Sample HDFS CSV File output adapter    
HDFS File Reader Input Adapter Sample HDFS File Reader input adapter    
HDFS File Writer Output Adapter Samples HDFS File Writer output adapter    
HDFS Regular Expression File Reader Input Adapter Sample HDFS Regular Expression File input adapter    
HDFS XML File Writer Output Adapter Sample HDFS XML File output adapter    
H2O Operator Sample Demonstrates the H2O operator.    
JPMML Operator Sample Demonstrates the PMML operator.    
Spark MLib Operator Sample Demonstrates the Spark operator.    

Native Database Connectivity Adapter Samples

This sample category illustrates how to use the adapters that provide connectivity to certain databases using high performance database-native drivers provided by the database vendor, as opposed to standard JDBC connectivity.

Topic Description
Database Change Data Capture Input Adapter Sample Change Data Capture
Vertica Load Adapter Sample Vertica Load adapter

Other TIBCO Product Connectivity Samples

This sample category describes adapters and operators that connect StreamBase to other members of the TIBCO product family.

Topic Description
TIBCO ActiveMatrix BPM Operator Sample Shows how to use the TIBCO ActiveMatrix BPM operator to connect to a ActiveMatrix BPM server and call REST API services with it from your StreamBase application.
TIBCO ActiveSpaces Operator Sample Shows how to use the TIBCO ActiveSpaces operators to connect to a metaspace and exchange tuples with it from your StreamBase application.
TIBCO BusinessEvents Fraud Detection Sample Demonstrates how to use TIBCO BusinessEvents' StreamBase channel to exchange messages between the two products.
TIBCO Spotfire® Automation Services Adapter Samples TIBCO Spotfire® Automation Services output adapter
TERR Sample Shows how to invoke the TIBCO Enterprise Runtime for R (TERR) operators from a StreamBase module.
TIBCO FTL Adapter Sample Demonstrates the TIBCO FTL input and output adapters.
TIBCO LogLogic Unity Query Adapter Samples Demonstrates how to perform queries against the TIBCO Log Log Unity server.
TIBCO Rendezvous Adapter Sample Demonstrates the TIBCO Rendezvous input and output adapters.

Petroleum Industry Adapter Samples

This sample category describes adapters appropriate for oil and gas exploration applications.

Topic Description
OSI PI Adapter Sample Shows how to use the OSI PI adapters.
WITSML Adapter Samples Shows how to use the TIBCO WITSML operators to connect to a WITSML data store from your StreamBase application.

StreamBase Market Data Adapter Samples

Topic Description
ActivFeed Input Adapter Sample Activfeed input adapter
Alpha Trading System EMAPI Market Data Feed Adapter Sample Alpha Trading Systems Market Data Feed adapter
Bloomberg Server API and B-Pipe Adapter Samples Bloomberg Server API/Managed B-Pipe input adapter
BM&FBOVESPA UMDF Input Adapter Sample BM&FBOVESPA UMDF input adapter
CME Market Data Platform FIX/FAST Input Adapter Sample CME Market Data Platform FIX/FAST input adapter
Deutsche Bank AutobahnFX Trading System Adapter Sample Deutsche Bank AutobahnFX Trading System adapter
Digitec D3 Streaming Interface Adapter Sample Digitec D3 Streaming Interface adapter
EBS Live XML Input Adapter Sample EBS Live XML adapter
Exegy Adapter Sample Exegy Input and Monitoring adapters
FIX Adapter Sample FIX adapter
FXall Relationship Trading Provider Adapter Sample FXall Relationship Trading Provider adapter
GAIN GTX Adapters Sample GAIN GTX adapter
Hotspot FX Trading System Adapter Sample Hotspot FX Trading System adapter
Hotspot Itch Input Adapter Sample Hotspot Itch Trading System adapter
Interactive Data PlusFeed Input Adapter Sample Interactive Data PlusFeed input adapter
Lime Citrius Quote Input Adapter Sample Lime Citrius Quote input adapter
MarketFactory Adapters Sample MarketFactory Enhanced Market Data and Trading adapters
Morningstar Quotes Feed Adapter Sample Morningstar Quotes Feed adapter
TBF Input Adapter Sample TBF input adapter
Thomson Reuters Enterprise Platform for Real-Time Subscribing Input Adapter Sample Thomson Reuters Enterprise Platform for Real-Time Subscribing input adapter
Thomson Reuters Enterprise Platform for Real-Time Publishing Output Adapter Sample Thomson Reuters Enterprise Platform for Real-Time Publishing output adapter
Thomson Reuters Enterprise Platform for Real-Time Contribution Output Adapter Sample Thomson Reuters Enterprise Platform for Real-Time Contribution output adapter
Thomson Reuters Velocity Analytics Samples Sample group for the Thomson Reuters Velocity Analytics Broadcast Server input adapter, the Velocity Analytics UTSS output adapter, and query operations against the Velocity Analytics time series data store.
Wombat MAMA Input Adapter Sample Wombat Subscribing input adapter
Wombat MAMA Output Adapter Sample Wombat Publishing output adapter

StreamBase Messaging Adapter Samples

Topic Description
29West LBM Adapter Sample 29West LBM input and output adapters
Apache Flume Input and Output Adapters Sample Apache Flume input and output adapters
IBM WebSphere MQ Adapter Sample IBM WebSphere MQ input and output adapters
MQTT Client Publish And Subscribe Samples MQTT Client subscribe and publish adapters
JMS and EMS Adapter Samples EMS and JMS adapters
Apache Kafka Adapter Samples Apache Kafka input and output adapters
RabbitMQ Adapter Samples RabbitMQ input and output adapters
Tervela Adapter Sample Tervela input and output adapters
Wall Street Systems Adapter Sample Wall Street Systems input and output adapters

StreamBase Standard Adapter Samples

Topic Description
Binary File Reader and Writer Adapter Sample Binary file input and output adapters
Bi-Directional Socket Input/Output Adapter Samples Bi-Directional Socket input/output adapter
Bi-Directional BLOB Socket Input/Output Adapter Samples Bi-Directional BLOB Socket input/output adapter
Bi-Directional CSV Socket Input/Output Adapter Samples Bi-Directional CSV Socket input/output adapter
Bi-Directional JSON Socket Input/Output Adapter Samples Bi-Directional JSON Socket input/output adapter
Bi-Directional Serialized Tuple Socket Input/Output Adapter Samples Bi-Directional Serialized Tuple Socket input/output adapter
CSV File Reader Input Adapter Sample CSV File input adapter
CSV File Writer Output Adapter Sample CSV File output adapter
CSV Socket Reader Input Adapter Sample CSV Socket input adapter
CSV Socket Writer Output Adapter Sample CSV Socket output adapter
File Monitor Input Adapter Sample File Monitor input adapter
File Reader Input Adapter Sample File Reader input adapter
File Template Sample File Template
File Writer Output Adapter Samples File Writer output adapter
E-mail Sender Output Adapter Sample E-mail sending output adapter
Feed Simulation Input Adapter Sample Feed Simulation input adapter
HTTP Reader Input Adapter Sample HTTP Reader input adapter
IRC Reader Input Adapter Sample IRC Reader input adapter
LiveView Adapters Sample LiveView adapters sample
Log Output Adapter Sample Logging output adapter
Once Input Adapter Sample Once input adapter
POP3 Reader Input Adapter Sample POP3 Reader input adapter
Regular Expression File Reader Input Adapter Sample Regular Expressi33on File input adapter
Regular Expression Socket Reader Input Adapter Sample Regular Expression Socket input adapter
RSS Reader Input Adapter Sample RSS Reader input adapter
SMTP Reader Input Adapter Sample SMTP (E-mail) Reader input adapter
SNMP Input Adapter Sample SNMP input adapter
Syslog Input Adapter Sample Syslog input adapter
Twitter Adapter Samples Twitter Adapter
StreamBase to StreamBase Input Adapter Sample StreamBase-to-StreamBase input and output adapters
StreamBase Monitor Adapter Sample StreamBase Monitor input adapter
UDP Input and Output Adapter Sample UDP Input and Output Adapter Sample
UDP Multicast Mode Input and Output Adapter Sample UDP Multicast Mode Input and Output Adapter Sample
Web Reader Input Adapter Samples Web Reader input adapter
Web Server Request And Response Input and Output Adapter Samples Web Server Request Response adapters
WebSocket Client Read and Write Samples WebSocket Client Read and Write adapters
XML File Writer Output Adapter Sample XML File output adapter
XML Over HTTP Output Adapter Sample XML-over-HTTP output adapter

StreamBase Trade Execution Adapter Samples

Topic Description
Alpha Trading System EMAPI Order Entry Adapter Sample Alpha Trading Systems Order Entry Adapter
Deutsche Bank AutobahnFX Trading System Adapter Sample Deutsche Bank AutobahnFX Trading System adapter
FIX Adapter Sample FIX adapter
FXall Relationship Trading Provider Adapter Sample FXall Relationship Trading Provider adapter
GAIN GTX Adapters Sample GAIN GTX adapter
Hotspot FX Trading System Adapter Sample Hotspot FX Trading System adapter
MarketFactory Adapters Sample MarketFactory Enhanced Market Data and Trading adapters

TIBCO Live DataMart Samples

Sample Folder Name Description
LiveView Adapters Sample Shows the use of the TIBCO LiveView Query, Delete, Publish, Ready and Table Create Drop adapters
liveview/sample/lv-sample-activespaces LiveView connecting to an ActiveSpaces Metaspace
liveview/sample/lv-sample-alerting-advanced Shows advanced alerting features with preconfigured alert rules
liveview/sample/lv-sample-auth Shows how to use LiveView authentication
liveview/sample/lv-sample-custom-id-generation Implements a custom primary key ID
liveview/sample/lv-sample-desktop-custom-view Shows how to create a LiveView Desktop plug-in that implements a custom view
liveview/sample/lv-sample-helloliveview Shows a simple Hello World application
liveview/sample/lv-sample-java-clientapi Using the LiveView Java Client API
liveview/sample/lv-sample-javascript Creating web applications with the LiveView JavaScript API
liveview/sample/lv-sample-jdbc-table Using LiveView with a JDBC table
liveview/sample/lv-sample-minimal Shows the minimum configuration to start the LiveView server
liveview/sample/lv-sample-preprocessor Configuring a preprocessor
liveview/sample/lv-sample-publisher Shows an embedded publisher application
liveview/sample/lv-sample-sbd-table Using LiveView with a StreamBase Query Table table back end
liveview/sample/lv-sample-services-only Shows a LiveView server without a data layer back end, but that connects to other LiveView server back ends
liveview/sample/lv-sample-transform Shows how to configure a data transformation application