The TIBCO StreamBase® Feed Simulation Input adapter is an embedded adapter that uses Feed Simulation configuration files to define the adapter's output ports and their schemas, and to determine what data is emitted from each adapter port. Feed simulation configuration files are created with the StreamBase Feed Simulation Editor as described in Using the Feed Simulation Editor. Feed simulation configuration files can be used interchangeably with this Feed Simulation adapter and with the command line tool, sbfeedsim. Any data sources, generation methods, and emission rates can be used with either this adapter or the command line tool.
The Feed Simulation Editor uses stream names, each with a defined schema, to represent output streams. The Feed Simulation adapter creates an output port for each stream in the configuration file, using the defined schema as the output schema.
The first output port of the adapter is always a status port. Each subsequent output port of the adapter represents a stream defined in the feed simulation configuration file, in the order in which they appear in the Editor.
An optional control input port is available for pausing and resuming, as defined below.
The Feed Simulation input adapter has the following properties on the General tab in its Properties View in StreamBase Studio:
Name: Use this field to specify or change the component's name, which must be unique in the application. The name must contain only alphabetic characters, numbers, and underscores, and no hyphens or other special characters. The first character must be alphabetic or an underscore.
Operator: A read-only field that shows the formal name of the adapter and the fully qualified class name that implements the functionality of this adapter. If you need to reference this class name elsewhere in your application, you can right-click this field and select Copy from the context menu to place the full class name in the system clipboard.
Class: A field that shows the fully qualified class name that implements the functionality of this adapter. If you need to reference this class name elsewhere in your application, you can right-click this field and select Copy from the context menu to place the full class name in the system clipboard.
Start with application: If this field is set to Yes (default) or to a module parameter that evaluates to
true, this instance of this adapter starts as part of the JVM engine that runs this EventFlow fragment. If this field is set to
No or to a module parameter that evaluates to
false, the adapter instance is loaded with the engine, but does not start until you send an epadmin container resume command (or its sbadmin equivalent), or until you start the component with StreamBase Manager.
Enable Error Output Port: Select this check box to add an Error Port to this component. In the EventFlow canvas, the Error Port shows as a red output port, always the last port for the component. See Using Error Ports to learn about Error Ports.
Description: Optionally enter text to briefly describe the component's purpose and function. In the EventFlow canvas, you can see the description by pressing Ctrl while the component's tooltip is displayed.
The Feed Simulation adapter has the following properties on the Adapter Settings tab in its Properties View in StreamBase Studio:
|Feed Simulation File||string||The name of the feed simulation configuration file to use, which must be present on the resource search path. The number of output ports and their schemas are defined in this file.|
|Enable Control Port||check box||If selected, this setting adds an input port to the adapter with the schema and meanings defined below.|
|Report Period||integer value||Specifies the number of seconds to elapse before emitting a control tuple that contains the number of data tuples sent since the last control tuple. Zero means never report.|
|Wait for Start Command||check box||If selected, the simulation does not start until a
|File Name Field||string||The name in the input schema that specifies the file to load. If empty this feature is disabled.|
|Log Level||Drop-down list||Controls the level of verbosity the adapter uses to issue informational traces to the console. This setting is independent of the containing application's overall log level. Available values, in increasing order of verbosity, are: OFF, ERROR, WARN, INFO, DEBUG, TRACE.|
Use the Concurrency tab to specify parallel regions for this instance of this component, or multiplicity options, or both. The Concurrency tab settings are described in Concurrency Options, and dispatch styles are described in Dispatch Styles.
Concurrency settings are not suitable for every application, and using these settings requires a thorough analysis of your application. For details, see Execution Order and Concurrency, which includes important guidelines for using the concurrency options.
The Feed Simulation input adapter always has a status output port, which is always the first output port. Subsequent output ports are added for each data stream defined in the feed simulation configuration file. The number of data stream output ports, and their schemas, are completely determined by the supplied feed simulation configuration file.
The schema of the status output port is defined as follows:
|Type||string||The basic state reported, always one of the following:
|Object||string||The name on the EventFlow canvas of the adapter reporting the status.|
|Action||string||The action that occurred, one of the following:
The LASTNUMTUPLES action contains the number of data tuples emitted for the most recent Report Period.
|Message||string||A human-readable string that provides additional context for the status message.|
|Time||timestamp||The time the action occurred.|
By default, the Feed Simulation input adapter has no input ports. You can optionally add a control port by checking the Enable Control Port property.
The schema of the control input port is defined as follows:
|command||string||The basic state reported, always one of the following, which are not case sensitive:
|value or scale||double||Only used with the
|filename||string||Only used with the
This value determines the new feed simulation file to load.
Typechecking fails if the feed simulation configuration file cannot be found, or if referenced resources such as CSV files cannot be found.
On suspend, the Feed Simulation input adapter finishes processing the current simulation window (10 ms by default), and then pauses.