The Save Stream and Replay Stream operators are intended to help you perform diagnostics. For example, you can use these operators when the output from an IEP Module project is not the expected output.
You first enable the Save Stream operator to begin saving an input stream to a database table. You then use the Replay Stream operator to replay the events that the Save Stream operator saved to the database table.
Before you begin, you must deploy an event process that contains a Stream Input operator.
If you know up front that you want to save an input stream to a database table, then you can use the Save Stream operator at design time. The property editor enables you to configure the same properties described in the following procedure.
Start the IEP monitoring and debugging tool. For detailed information about this tool, see the Open ESB wiki.
Run the listIEP command. You must specify the IEP service unit name as a parameter. You can find the service unit name by going to the Services window of the IDE and expanding the Servers node, the GlassFish V2 node, the JBI node, the Service Assemblies node, and the individual service assembly node.
The command returns a list of plan names. For example:
[IEP] listIEP CompositeApp1-IepModule1 test_iep |
Run the listOperators command. You must specify the plan name as a parameter.
The command returns a list of the operators in the event process. For example:
[IEP] listOperators test_iep StreamInput0 StreamOutput0 |
Run the addSaveStream command. You must specify the following parameters: the plan name, the name of the Stream Input operator, the JNDI name of the database resource, and the name of the database table where the input stream will be saved. You can optionally specify a boolean parameter called Is Global, which indicates whether the table and its data are kept between deployments. By default, the Is Global parameter is set to true.
The command returns the name of the Save Stream operator that was added. For example:
[IEP] addSaveStream test_iep StreamInput0 jdbc/iepseDerbyNonXA STOCKTRANSACTIONS false The result is StreamInput0SaveStream0 |
The Save Stream operator begins saving the input stream to the database table. If the table name that you specified does not exist, then the table is created.
Start the IEP monitoring and debugging tool. For detailed information about this tool, see the Open ESB wiki.
Run the removeSaveStream command. You must specify the following parameters: the plan name and the name of the Save Stream operator. For example:
[IEP] removeSaveStream test_iep StreamInput0SaveStream0 |
The Save Stream operator stops saving the input stream to the database table.
If the Is Global parameter of the addSaveStream command was set to true, then the table and its data are not deleted. However, if you subsequently modify the schema of the stream input (for example, by adding a column) and re-enable the Save Stream operator, then the table and its data are deleted at that time.
If the Is Global parameter of the addSaveStream command was set to false, then the table and its data are deleted.