Example: Subscribing and Publishing

Subscribe to a subject, upload an outbound record on that subject to Event Stream Processor, send the message to the Rendezvous server, and then receive and publish it as an inbound record.

Prerequisites
You have a network connection to a running instance of the TIBCO Rendezvous server. Operate this example from the command line.
Task
  1. Set the username and password for the adapter:
    1. Edit adapter.xml.
    2. In the <User> and <Password> elements, enter sybase.
  2. 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.
  3. Edit the start_adapter.sh script.
  4. Set the JAVA_HOME environment variable to the directory where the Java Runtime Environment (JRE) is installed.
  5. Start Event Stream Processor.
    Operating System Step
    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

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

      ./start_server_cluster.sh

    2. Start the project on the cluster:

      ./start_project.sh

  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. Upload the outbound record.
    Operating System Step
    UNIX Open a terminal window and enter:

    ./upload.sh

    Windows Open a command window and enter:

    upload.bat

  9. Start the Event Stream Processor subscriber utility to view data stream content.
    Operating System Step
    UNIX Open a terminal window and enter:

    ./esp-subscribe.sh

    Windows Open a command window and enter:

    esp-subscribe.bat

  10. Note the inbound record published to Event Stream Processor.