- Index

< Previous |  | Next >

# Running Fragments vs StreamBase Applications

Fragments cannot actually run in the form of a fragment outside of StreamBase Studio. So far in this Guide, we have let StreamBase Studio do the work of packaging an EventFlow fragment into a node and letting the fragment run by itself — but this only works in Studio. This feature allows you to develop, test, and debug fragments independent of other components.

For real-world deployment, StreamBase and LiveView fragments but must be packaged as part of a StreamBase Application. As with fragments in Studio, StreamBase Applications must be installed into a StreamBase Runtime node. You then start the node to run the fragments contained in the node.

The next several pages go through the steps to create and run a StreamBase Application that contains a single EventFlow fragment dependency.

The primary method of deploying and running a StreamBase Application is to generate the application in Studio, then run the application on the command line.

Starting with StreamBase 10.3.0, you can also run StreamBase Applications in Studio.

### Note

For QA and production deployment, deploy from the command line with the epadmin tool, as described in the Concepts Overview.

## Steps to Deploy on the Command Line

To deploy a StreamBase Application on the command line, you build an application archive file in Studio that contains the application ready to run, then use epadmin command to install this archive into a node. The overall steps are:

In StreamBase Studio:

  1. Create a new, separate project in StreamBase Studio of type StreamBase Application.

  2. Add a Maven dependency on the fragments you want to include in this StreamBase Application project.

  3. Create an application archive file for the StreamBase Application project.

At the command prompt:

  4. Install a node containing the application archive file, using `epadmin install node`.

  5. Start the node, thereby starting the fragment running, using `epadmin start node`.

These steps are covered in more detail in the next few pages.

## Steps to Deploy in Studio

Running Applications in Studio provides a simple visual interface to run and debug your application, including multiple fragment applications, during development. For advanced cases, you can run two or more instances of the same StreamBase Application in Studio to verify and debug HA and partitioning configurations.

The overall steps have the same beginning: generate a StreamBase Application archive in Studio:

In StreamBase Studio:

  1. Create a new, separate project in StreamBase Studio of type StreamBase Application.

  2. Add a Maven dependency on the fragments you want to include in this StreamBase Application project.

  3. Create an application archive file for the StreamBase Application project.

Then still in StreamBase Studio, run the archive as follows:

- Right-click the generated application archive file to open the Run Configuration dialog.

- Create a new Run Configuration of type StreamBase Application.

- Specify the path to the application archive generated earlier.

- Click Run.

Further details can be found in Run StreamBase Application in Studio.