TIBCO StreamBase 10.2 Building and Running Applications in Studio, Studio Projects and Project Structure November 2017
TIBCO StreamBase 10 Experience 1. Build a StreamBase 10 Project 2. Run/Debug an StreamBase 10 Project 3. Comparisons to StreamBase 7 4. Project Structure: What is Where & Why (Maven-driven) 5. Execute & Test within Studio (Development) 6. Importing Projects and Samples
StreamBase 10 What is a StreamBase Application?
BACKGROUND: What was a StreamBase 7 Application? A single.sbapp file itself or.ssql file smallest unit possible A module unit of composition on application side A container s worth: a top-level application that runs in a single container, including all the sub-modules called A business application: whatever definition given by user, the logical application that provides meaningful value We will see, in StreamBase 10, an application is yet again a different concept
StreamBase 10 Getting Started and the Studio Experience
Start Studio Splash Screen Appears while loading
Workspace Dialog
StreamBase 10 Projects Create an EventFlow Fragment Project with StreamBase Studio
New StreamBase Project dialog File->New->StreamBase Project Project name: MUST NOT have spaces StreamBase EventFlow Fragment
New StreamBase Project > Configure Maven Artifact dialog
New StreamBase Project (Bad Project Name Error)
New StreamBase Project (cont d)
Subversive Team Provider Install Connectors Dialog
New StreamBase Project (not ready to hit Finish yet)
New StreamBase Project: Archetype Properties In the Archetype Properties dialog: testnodes: Change from A,B,C to A (faster) builddocker: Change from false to true Press the Finish button
New StreamBase Project
New StreamBase Empty Project
StreamBase 10 First App Build FirstApp
FirstApp
LAB Build FirstApp (do not run yet, please)
StreamBase 10 Application Fragment Execution From StreamBase Studio
Run As Right click Project EventFlow Fragment Run From Studio NOT deployed as an application
Perspective Switch in Studio
Launching FirstApp
ASIDE: What is Happening in the StreamBase 10 Runtime Must install a node with your EventFlow fragment in order to run it Studio handles installation and starting of fragment into a node Stop: Studio stops the node, but does NOT remove it (available for reuse) Studio shutdown removes the node (end of lifecycle of a node) Will cover how to deploy outside of Studio later (epadmin command line tool)
Performance Dialog
Run As Clusters, Nodes and Fragments
Run As StreamBase Client Listen Port Number
Terminate the Fragment Launch OR BUT NOT THESE (usually):
Debug As
StreamBase 10 Project Structure
Project Structure Comparison to StreamBase 7 Project Explorer instead of Package Explorer No Outline View on left (moved to right) resources folder has.sbfs Maven project - top level pom.xml fragment.conf & other HOCON files (replace.sbconf)
StreamBase 10 Just Enough Maven
Project Structure (What Goes Where and Why (Maven)) Studio projects use the Maven Standard Directory Layout All projects are built, packaged, and run under Maven control Maven provides well-known, standard way to specify project dependencies Top level pom.xml defines fixed lifecycle for stages of building EventFlow project An EventFlow Fragment project, installed, creates and artifact that is an EventFlow Fragment Archive zip EventFlow Fragment archives are generated in project target folder (install copies to local Maven repository) Default local maven repository is.m2 folder in home directory on local machine; default may be overridden
Project Structure (What Goes Where and Why (Maven)).sbapps (and sbints) go in scr/main/eventflow/packagename All files in src/main/eventflow are automatically on classpath HOCON config files go in src/main/configurations (more on these files later) Java files for extensions go into src/main/java > package-name Files in src/main/resources are automatically on Maven resource search path Feedsims, CSV files, image files, SQL scripts, ** adapter config XML files ** StreamBase JUnit test files run with Maven Test cmd go in src/test/java/package-name src/test/resources required by StreamBase JUnit test files
Project Structure (Adapters) Some adapters require access to JAR files (example JDBC) Add Maven Dependency in pom.xml JAR available in public repository: make repository part of dependency JAR not publicly available: specify system dependency Short term, testing ONLY option: place JAR in src/main/resources folder
StreamBase 10: Importing Projects and Samples Notes
Sample Project Importing Typecheck Errors (while loading) Building workspaces (progress bar)