Samples Guide Contents

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.
Deployment File Sample Includes a simple, multi-container application that demonstrates how two StreamBase deployment files can be used to run the same top-level application with different sub-modules for different purposes.
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.
Round Robin Dequeuer Sample Demonstrates the use of round robin robin dequeuer applications, which control the destination of output tuples based on the connected clients, so that each output message is delivered to a single, subscribed client.
TIBCO BusinessEvents Fraud Detection Sample Demonstrates how to use TIBCO BusinessEvents' StreamBase channel to exchange messages between the two products.
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.
StreamBase .NET Client Sample Provides sample .NET enqueue, dequeue clients, and a monitor client that displays system, operator, and thread information. This sample requires the StreamBase .NET Client library, which is installed only for Windows.
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
Avro to Tuple and Tuple to Avro Operator Sample Demonstrates the Tuple to Avro and Avro to Tuple operators.
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.
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.
Shared Tables Across Containers Sample Demonstrates how applications running in separate containers can access the same Query Table. In the sample, one application creates a table, a second one writes to the table, and a third one reads from the table.
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.
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.
Operator Sample Group Provides one small EventFlow application for each operator and most data constructs in the Palette view in StreamBase Studio, and illustrates the use of StreamBase deployment files to define the modules to be run by an Extension Point operator.
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.
Salesforce Streaming API Adapter Sample Demonstrates listen to streaming events from the Salesforce platform based on a given topic.
TERR Samples Shows how to invoke the TIBCO Enterprise Runtime for R (TERR) operators from a StreamBase module.
TIBCO LogLogic Query Adapter Samples Demonstrates how to perform queries against the TIBCO Log Log Unity server.
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 C++ Simple Function Sample Shows how to provide a custom simple function written in C++.
Custom Java Aggregate Function Sample Shows how to provide a custom aggregate function written in Java.
Custom C++ Aggregate Function Sample Shows how to provide a custom aggregate function written in C++.
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.
Custom Embedded Adapter Sample Shows how to provide a custom embedded adapter.
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 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.
Apache Cassandra Operator Sample Shows how to use the Apache Cassandra operators to connect to a Cassandra cluster and exchange tuples with it from your StreamBase application.
CME Order Routing Adapter Sample Shows how to use the CME iLink Order Entry platform and exchange messages with it from your StreamBase application.
Apache Kudu Operator Sample Shows how to use the Apache Kudu operators to connect to a Kudu cluster and exchange tuples with it from your StreamBase application.
Drools Operator Sample Shows how to use the Drools operator to integrate a business rule interpreted by the Drools Core rules engine.
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.
FTP Operator Sample Shows how to use the FTP operator to execute simple FTP client commands programmatically.
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.
H2O Operator Sample Demonstrates the H2O operator.
JPMML Operator Sample Demonstrates the PMML operator.
Spark MLlib Operator Sample Demonstrates the Spark operator.
Python Operator Samples Demonstrates the Python operator.
WITS Adapter Samples Shows how to use the TIBCO WITS operators to get data from a WITS serial comm port connection.
WITSML Adapter Samples Shows how to use the TIBCO WITSML operators to connect to a WITSML data store from your StreamBase application.

High Availability Samples

This category of samples demonstrate best practices for implementing highly available clusters of StreamBase Servers. They show how to separate the high availability logic from the rest of the application logic, and show design patterns you can use to address specific high-availability requirements. The samples also demonstrate how to specify automatic high availability, and how to set the properties for a Query Table to use automatic table replication.

Topic Description
High Availability Sample

The HA sample shows how to enable automatic high availability for two StreamBase Server instances running together in a Hot/Warm high-availability cluster. The sample runs the same simple application in two servers, one designated primary and the other designated secondary. There are two parts to the sample: a basic sample and custom sample. There is also an application that you can run to examine how the HA Heartbeat adapter works.

High Availability Finite State Machine Sample

The HA FSM sample shows the use of a Finite State Machine (FSM) to deal with state transitions in an HA design pattern. The behavior of the sample is similar to the behavior of the HA Sample, but the implementation of the HA FSM sample is more powerful and complex. Also, unlike the HA sample, leadership status is not based on a setting in the startup script. The server that starts first is designated as the leader, and any server that starts next is the nonleader.

High Availability Shared Disk Access Sample This sample shows:
  • How to ensure that an application is running on one of two servers, where the application requires access to a disk-based Query Table.

  • How to test for the presence of an application in another container and start the application if it is not found.

  • How to use the External Process operator to run commands specific to high availability design patterns.

This sample requires a license that enables the use of disk-based Query Tables.

Query Table Replication Sample This sample shows the use of automatic table replication by setting properties for a Query Table and using the configuration file for the servers. The sample also shows a design pattern for table replication in the same setup without using automatic table replication. The design pattern is two servers in a high availability (HA) cluster. The schemas in the sample table are order schemas typically used in an application for trading.

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.

StreamBase Market Data Adapter Samples

Topic Description
ActivFeed Input Adapter Sample Activfeed input 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 MDP3 Adapter Sample CME Market Data Platform 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
IEX Adapter Samples IEX Data adapter
Morningstar Quotes Feed Adapter Sample Morningstar Quotes Feed adapter
SNMP Input Adapter Sample SNMP input adapter
Syslog Input Adapter Sample Syslog input 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 JMS adapter
JMS Legacy Input And Output Adapters Sample JMS Legacy embedded input and output adapters
Apache Kafka Adapter Samples Kafka input and output adapters
OSI PI Adapter Sample OSI PI adapters
RabbitMQ Adapter Samples RabbitMQ input and output adapters
TIBCO FTL Adapter Sample TIBCO FTL input and output adapters
TIBCO eFTL Adapter Sample TIBCO eFTL publish and subscribe adapters
TIBCO Rendezvous Adapter Sample TIBCO Rendezvous 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 Length Based Socket Input/Output Adapter Samples Bi-Directional Length Based 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
Diameter Client/Server Input, Output, Controller Adapter Samples Diameter Adapters
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
HBase Operator Samples HBase Operators
HDFS File Writer and File System Adapter Sample Apache Hadoop Distributed File System (HDFS) Adapters
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
Amazon S3 File System Access via HDFS Adapters Amazon S3 file system access using the HDFS File Reader and File Writer adapters.
HTTP Reader Input Adapter Sample HTTP Reader input adapter
HTTP Client Input Adapter Samples HTTP Client 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
TIBCO Adapters for Google Protocol Buffers Sample TIBCO Output/input Adapter for Google Protocol Buffers
Regular Expression File Reader Input Adapter Sample Regular Expression 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
TIBCO Spotfire® Automation Services Adapter Samples TIBCO Spotfire® Automation Services output adapter
TERR Samples TIBCO Enterprise Runtime for R adapter
Task Scheduler Adapter Samples Task Scheduler 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
Web Streams Adapter Sample Web Streams Input Output adapters
WebSocket Client Read and Write Samples WebSocket Client Read and Write adapters
Wikimedia EventStreams Adapter Sample Wikimedia EventStreams adapter
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
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

TIBCO Live Datamart Samples

Sample Folder Name Description
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
sample/adapter/embedded/lv-sbd Show the use of the TIBCO LiveView Query, Delete, Publish, and Ready adapters