Example: Sending, Receiving, and Viewing Data

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.

Prerequisites
You have a network connection.
Task
  1. Start Event Stream Processor.
    Operating System Step
    UNIX Open a terminal window:
    1. Start the example cluster: start_server_cluster.sh
    2. Start the project on the cluster: start_project.sh
    Windows Open a command window:
    1. Start the example cluster: start_server_cluster.bat
    2. Add project to the cluster, and start it on the cluster: start_project.bat
  2. Edit the adapter.sh script.
  3. Set the JAVA_HOME environment variable to the directory where the Java Runtime Environment (JRE) is installed.
  4. Start the adapter.
    Operating System Step
    UNIX Open a terminal window and enter:

    ./adapter.sh

    Windows Open a command window and enter:

    adapter.bat

  5. Wait five to ten seconds for the adapter to initialize.
  6. 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

  7. Load the HTTPAdapterClient.html page in a Web browser.
  8. 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.

  9. Click Submit.
  10. Note the records being streamed into the Web browser window.