Recording and Playing Back Data Streams

StreamBase allows you to record data enqueued onto one or more input streams, and subsequently play the recorded data back on the same application, at the original speed or an accelerated speed. Among its many uses, this feature allows you to test alternative processing strategies in the StreamBase operators, to see the effect of changes, given the same set of recorded data. This topic explains how you can use the graphical Recordings View in StreamBase Studio, or the corresponding, command-based sbrecord and sbfeedsim features in a terminal windows.

Using the Recordings View in StreamBase Studio

By default, the Recordings View is located near the upper left corner of the SB Test/Debug perspective.

To record tuples using the Recordings View, an application must be running. The sequence of steps is:

  1. Start the StreamBase Server for an EventFlow or StreamSQL application. (See Running Applications in Studio for instructions.)

  2. In the Recordings View, click the New Recording button.

  3. In the New Recording dialog, accept the provided default file name for your recording, or enter a new name, as shown below.

  4. Click OK.

  5. The Recording begins when StreamBase detects that data has been enqueued onto one of the input streams of the running application. Enqueue data to an input stream; for example, you can start a Feed Simulation for a specific input stream, as described in Running Feed Simulations.

  6. If the application has more input streams, you can record the data sent to them as well. For each input stream, StreamBase creates a separate comma-separated value (CSV) file. By default, each CSV file is named applicationName-timestamp-streamName.csv in your project folder.

  7. When you have finished recording the inbound data, click the Stop button on the Recordings View.

  8. You can now replay the recording on the StreamBase application.

    The Replay speed option's default is to replay the recorded data at 1x, its original speed. You can increase the replay speed by selected one of the provided multiples.


    If the replay involves multiple input streams, it is possible that the streams will not be synchronized with each other. Thus the recorded data from different streams may arrive in the StreamBase application in different order from one replay to another.

Using Commands to Perform Recordings and Playbacks

You can use the sbrecord and sbfeedsim commands to perform the recording and playback steps, instead of using StreamBase Studio. You can see a reminder of the syntax of these commands in one of several ways:

  • In man pages on UNIX installations.

  • By the sbrecord -h and sbfeedsim -h commands.

  • By the sbrecord --help and sbfeedsim --help commands.

  • In the sbrecord command reference.

  • In the sbfeedsim command reference.

The command-based record and playback steps are:

  1. In a terminal window or StreamBase Command Prompt, start a StreamBase Server instance for your application. Before you can record tuples on the input streams, the application must be running. For example:

    sbd MyApplication.sbapp
  2. Use the sbrecord command to start the recording. You can use the --name parameter to set a non-default name for the recording. For example:

    sbrecord --name feedproc01aug09

    The recording begins once StreamBase detects that data has been enqueued onto one of the input streams. By default, each recording is named applicationName-timestamp.sbrec, and is stored in your project's directory in your Studio workspace.

  3. Enqueue data to one or more input streams. For example, you can run a StreamBase producer client that enqueues data onto streams, or you can use sbfeedsim:

    sbfeedsim -f feedproc.sbfs

    For each input stream in the running application, sbrecord generates a separate comma-separated value (CSV) file. By default, each CSV file is named applicationName-timestamp-streamName.csv. If you used the --name parameter on the sbrecord command, the CSV files are named yourName-streamName.csv.

  4. When you have finished enqueuing data, stop the client or the sbfeedsim command that is sending data to the running application.

  5. Shut down the StreamBase Server with:

    sbadmin shutdown
  6. You can now replay the recording on the StreamBase application, using the sbfeedsim-old command.


    The note above about multiple input streams applies equally to recordings made with sbrecord.

    Before you can run sbfeedsim, you must restart the StreamBase Server instance.