You can use the BeanShellPipe component between the AsapSource and FileSink components. BeanShellPipe executes some commands in shell after it receives data from AsapSource, and before publishing data to FileSink.
Prerequisites
The cluster database stores configuration information. Ensure that the cluster is
running, so that the adapter can interact with the projects on the
cluster.
Procedure
- Set the user name and password in the example environment:
Operating System |
Step |
Windows |
- Edit the set_example_env.bat script
- Set the ADAPTER_EXAMPLE_USERNAME and ADAPTER_EXAMPLE_PASSWORD
variables to the desired user name/password combination.
- If SSL is enabled, set
ADAPTER_EXAMPLE_CLUSTER_NODE_PROTOCOL to esps. If it is
disabled, set it to esp.
|
UNIX |
- Edit the set_example_env.sh script
- Set the ADAPTER_EXAMPLE_USERNAME and ADAPTER_EXAMPLE_PASSWORD
variables to the desired user name/password combination.
- If SSL is enabled, set
ADAPTER_EXAMPLE_CLUSTER_NODE_PROTOCOL to esps. If it is
disabled, set it to esp.
|
- Start SAP Event Stream Processor.
Operating System |
Step |
Windows |
Open a command window:- Start the cluster:
start_server_cluster.bat
- Add project to the cluster, and start it on the cluster:
start_project.bat
|
UNIX |
Open a terminal window: - Start the
cluster:
./start_server_cluster.sh
- Start the project on the cluster:
./start_project.sh
|
- Start streamingsubscribe to subscribe to the project that is
running on the cluster.
Operating System |
Step |
Windows |
Open a command window and
enter: streamingsubscribe.bat
|
UNIX |
Open a terminal window and enter:
./streamingsubscribe.sh
|
- Start the AsapSource, FileSink and BeanShellPipe components.
Operating System |
Step |
UNIX |
Open a terminal window and enter: ./asapToFile.sh
|
Windows |
Open a command window and enter: asapToFile.bat
|
- Upload data from the esp_insert.txt file to Server.
Operating System |
Step |
UNIX |
Open a terminal window and enter:
./streamingupload.sh
|
Windows |
Open a command window and enter: streamingupload.bat
|
AsapSource reads this data and passes it to BeanShellPipe, which then
passes it to FileSink, which writes it to the out.txt file.
BeanShellPipe outputs the text to the command prompt.