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
- Set the user name and password for the adapter:
- Edit adapter.xml.
- In the <User> and <Password> elements, enter a user name
and password.
- 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_node.bat
- Add project to the cluster, and start it on the cluster:
start_project.bat
|
UNIX |
Open a terminal window: - Start the cluster:
./start_node.sh
- Start the project on the cluster:
./start_project.sh
|
- Edit the start_adapter.sh script.
- Set the JAVA_HOME environment variable to the directory where the Java Runtime
Environment (JRE) is installed.
- 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
|
- Wait five to ten seconds for the adapter to initialize.
- 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
|
- Load the HTTPAdapterClient.html page in a Web browser.
- Enter a valid SQL query, for example:
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.
- Click Submit.
Note the records being streamed into the Web browser
window.