Running Feed Simulations


Use the Feed Simulations view to send test data to a running StreamBase application. This view shows the available feed simulation files with .sbfs extension in your Studio workspace. The Feed Simulations view allows you to run, pause, and stop a feed simulation, and to dynamically change the data rate.

A companion to the Feed Simulations view is the Feed Simulation Editor, where you can define new feed simulations or edit existing ones. Open the Feed Simulations Editor by double-clicking a feed simulation file in the Feed Simulations view. See Using the Feed Simulation Editor for more on editing a feed simulation's settings.

If your feed simulation takes input from a data file, you can either import an existing one into a project, or create and edit a new one in StreamBase Studio. To create a new one, click File>New>File. In the New File dialog, select the project containing the application, and specify a file name. A new, empty file is opened in a Text Editor, where you can edit and save it.

Running Feed Simulations

Remember that you must run your StreamBase application before you can use the Feed Simulations view. That is, a StreamBase Server process must be running and hosting the application.

In the SB Test/Debug perspective, click the Feed Simulations tab to bring it to the front.

If you have many feed simulations in your workspace, you may see a progress bar in the Feed Simulations view as it loads. StreamBase Server validates each feed simulation in the workspace against the input streams defined in the running application. Feed simulations can be shared between applications and projects, and are not tied to a particular application. However, to successfully run a feed simulation, each stream name configured in the feed simulation file must match an input stream name in the running application.

The figure below shows a sample Feed Simulations view. The workspace in this example contains feed simulations for two projects: sample_operator and sample_bestbidsandasks.

The red X icons () on the left side indicate that those feed simulation files do not have streams compatible with the running application. In this example, the running application is BestBidsAsks.sbapp, from the Best Bids and Asks sample application included in StreamBase.

To run the NYSE.sbfs feed simulation, select it and click the Run button. Another way to start it is to right-click the feed simulation file name, and select Run Feed Simulation from the dropdown menu.

If this feed simulation is configured to log its incoming data to the Input Streams view, you see the inbound generated or trace data shown there while the feed simulation is running. In addition, when processing results occur on the dequeue streams, that data is shown in the Output Streams view.

In the example above, the Feed Simulations view contains a Status column, showing the number of tuples sent to the application thus far (12,000 in this example).

During the running of the feed simulation, you can increase the data rate with the slider in the Feed Simulations view. Click the Stop button to shut down the feed simulation. The server process continues to run until you shut it down separately.

Status Indicators and Display Options

The Feed Simulations view uses icons to indicate whether the listed feed simulation files are compatible with the running application. A feed simulation with a red icon () or yellow icon () does not indicate that the flagged feed simulation has an inherent problem, only that it is incompatible with the currently running application.

The red icon indicates that the simulation was designed for another application that uses different stream names. Select a feed simulation row to see message text below the grid explaining why that simulation cannot run with the current application.

The yellow icon indicates that the input stream name matches an input stream in the currently running application, but one or more fields in the schema are mismatched or have invalid data.

The yellow icon error shown in the example above can happen when you have multiple feed simulations in your workspace, and they share a common stream name (in this example, NYSE_Feed), but the schemas are different. Thus, in the image above, the running application has a schema that matches the schema defined in NYSE.sbfs, but does not match the schema defined in NYSE2.sbfs.

The Run button is disabled when a red icon feed simulation is selected. It is not disabled for yellow icon simulations. That is, It is possible to run a feed simulation with a yellow warning icon, but it is not recommended. Best practice is to only run feed simulations that have no warning icons.

You can temporarily hide feed simulations that have red error icons. In the upper-right corner of the Feed Simulations view, click the down-pointing triangle button and select Hide Feed Simulations with errors. The resulting display is shown here:

The Hide Feed Simulations control is a toggle: select it again to restore the full feed simulations view.

Stopping Feed Simulations

To stop a running feed simulation, click the Stop button in the Feed Simulations view. The running application continues to run.

If you stop the running application, any running feed simulations also stop.

When you re-run a stopped feed simulation, StreamBase Studio starts the feed simulation over from the beginning. There is no mechanism to pause and restart a running simulation.