Example: Subscribing to and Publishing Data

Subscribe to real-time market data on two symbols and order book data on one symbol, and publish the incoming data to Event Stream Processor.

Prerequisites
A network connection to the NYSE datafeed.
Task
  1. Set the username and password in the example environment:
    Operating System Step
    UNIX
    1. Edit the set_example_env.sh script
    2. Set the ADAPTER_EXAMPLE_USERNAME and ADAPTER_EXAMPLE_PASSWORD variables to sybase.
    Windows
    1. Edit the set_example_env.bat script
    2. Set the ADAPTER_EXAMPLE_USERNAME and ADAPTER_EXAMPLE_PASSWORD variables to sybase.
  2. Edit the start_adapter.sh script.
  3. Set the JAVA_HOME environment variable to the directory where Java Runtime Environment (JRE) is installed.
    Note: The NYSE libraries are available in both 32- and 64-bit versions. If your libraries are 32-bit, use a 32-bit JRE. If your libraries are 64-bit, use a 64-bit JRE.
  4. Start Event Stream Processor.
    Operating System Step
    UNIX Open a terminal window:
    1. Start the example cluster:

      start_node.sh

    2. Start the project on the cluster:

      start_project.sh

    Windows Open a command window:
    1. Start the example cluster:

      start_node.bat

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

      start_project.bat

  5. Edit the mama.properties file in the adapter lib/wombat directory to ensure the subscribe_address and subscribe_port properties point to a NYSE data feed.
  6. Start the adapter.
    Operating System Step
    UNIX Open a terminal window and enter:

    start_adapter.sh

    Windows Open a command window and enter:

    start_adapter.bat

  7. Wait five to ten seconds for the adapter to initialize.
  8. Upload a stream record.
    Operating System Step
    UNIX ./upload.sh
    Windows upload.bat
  9. Start the subscriber utility to view data stream content.
    Operating System Step
    UNIX ./esp-subscribe.sh
    Windows esp-subscribe.bat