Show TOC

Example: Sending, Receiving, and Viewing DataLocate this document in the navigation structure

Use the working example provided in the adapter distribution to learn how to send a SQL query to the adapter, and receive XML-formatted stream data from Event Stream Processor and view it in a Web browser.

Procedure

  1. Set the user name and password for the adapter:
    1. Edit adapter.xml.
    2. In the <User> and <Password> elements, enter a user name and password.
  2. 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.
  3. Start SAP Event Stream Processor.
    Operating System Step
    Windows Open a command window:
    1. Start the cluster:

      start_node.bat

    2. Add project to the cluster, and start it on the cluster:

      start_project.bat

    UNIX Open a terminal window:
    1. Start the cluster:

      ./start_node.sh

    2. Start the project on the cluster:

      ./start_project.sh

  4. Edit the start_adapter.sh script.
  5. Set the JAVA_HOME environment variable to the directory where the Java Runtime Environment (JRE) is installed.
  6. Start the adapter.
    Operating System Step
    Windows Open a command window and enter:

    start_adapter.bat

    UNIX Open a terminal window and enter:

    ./start_adapter.sh

  7. Wait five to ten seconds for the adapter to initialize.
  8. Start uploading stream records.
    Operating System Step
    UNIX Open a terminal window and enter:

    ./upload.sh

    Windows Open a command window and enter:

    upload.bat

  9. Load the HTTPAdapterClient.html page in a Web browser.
  10. Enter a valid SQL query, for example:
    SELECT * FROM Stream1
    Note Queries that return a smaller number of records may not appear on some browsers because those browsers appear to expect a certain amount of data to be present in the buffer cache before they display the data. For example:
    SELECT * FROM Stream1
    where intcol = 10
    • Mozilla FireFox browser -- displays record.
    • Google Chrome browser -- does not display record.
    • Internet Explorer browser -- does not display record.
    SELECT * FROM Stream1
    where intCol > 10
    (executed in debug mode)
    • Mozilla FireFox browser -- records appear after they are sent to the browser.
    • Google Chrome browser -- records appear after the fifth record is sent to the browser.
    • Internet Explorer browser -- records appear after the 20th record is sent to the browser.
  11. Click Submit.
    Note the records being streamed into the Web browser window.