Show TOC

Example: Using the XPathXmlStreamReader ComponentLocate this document in the navigation structure

XPathXmlStreamReader parses a single row of data from a single XML input file and sends the row to the ESP project. Then, the streamingsubscribe.sh (Linux, Solaris) or streamingsubscribebat (Windows) file reads the row and displays it in the console.

Prerequisites

Create a cluster database and deploy a cluster to it. See SAP Event Stream Processor: Configuration and Administration Guide for more information.

Set JAVA_HOME:
  • On Linux or Solaris, export JAVA_HOME=$STREAMING_HOME/lib/jre
  • On Windows, set JAVA_HOME=%STREAMING_HOME%\lib\jre

Procedure

  1. Set the user name and password in the example environment:
    Operating System Step
    Windows
    1. Edit the set_example_env.bat script
    2. Set the ADAPTER_EXAMPLE_USERNAME and ADAPTER_EXAMPLE_PASSWORD variables to the desired user name/password combination.
    3. If SSL is enabled, set ADAPTER_EXAMPLE_CLUSTER_NODE_PROTOCOL to esps. If it is disabled, set it to esp.
    UNIX
    1. Edit the set_example_env.sh script
    2. Set the ADAPTER_EXAMPLE_USERNAME and ADAPTER_EXAMPLE_PASSWORD variables to the desired user name/password combination.
    3. If SSL is enabled, set ADAPTER_EXAMPLE_CLUSTER_NODE_PROTOCOL to esps. If it is disabled, set it to esp.
  2. On Windows only, modify the set_example_env.bat file:
    • Remove the line:
      call "%~dp0..\..\..\set_adapter_env.bat"
    • Add the lines:
      call set_example_env.bat
      call %ADAPTER_EXAMPLE_DEPTH%\set_adapter_env.bat
  3. In the XPathXmlStreamReader.props file, append the desired user name and password to the following lines to set the user and password variables:
    adapter.ASAPSINK.User = 
    adapter.ASAPSINK.Passwd = 
  4. Run the example:
    Operating System Step
    UNIX
    1. Open a terminal window and run ./start_server_cluster.sh to start the server cluster.
    2. In a second terminal window, run ./start_project.sh to start the project.
    3. In the same terminal window, run ./streamingsubscribe.sh to subscribe to the project running on the cluster.
    4. In a third terminal window, run ./XPathXmlStreamReader.sh to start the FilePollSource (with XPathXmlStreamReader) and AsapSink components.
    Windows
    1. Open a command window and run start_server_cluster.bat to start the server cluster.
    2. In a second command window run start_project.bat to start the project.
    3. In the same command window, run streamingsubscribe.bat to subscribe to the project running on the cluster.
    4. In a third command window, run XPathXmlStreamReader.bat to start the FilePollSource (with XPathXmlStreamReader) and AsapSink components.
    The example runs and the output displays in the second terminal/command window.