Skip to Content

Deploy and Test the Streaming Lite Custom Adapter

Learn how to deploy our Custom Java Adapter by creating a .jar file and transferring it to our Raspberry Pi, and to test it using the streamingsubscribe executable.
You will learn
  • How to deploy our Custom Java Adapter into a .jar file
  • How to transfer the .jar file to our Raspberry Pi
  • How to test our Custom Java Adapter by subscribing to the event streams
  • Step 1

    After we have finished coding the adapter, we can go ahead and create a jar file.

    Right click the project name in the Package Explorer and click "Export".

    Export Custom Java Adapter

    Choose Jar file, and click Next.

    Select Jar File

    On the subsequent screen, make sure to check off only the "src" folder under "Select the resources to export".

    Under “Select the export destination”, put our folder name (custom_java_adapter), and then the name of the jar file we want to create. We will be calling it "java_adapter_runnable.jar". Click Finish.

    Jar File Specification

    Connect to your Raspberry Pi using WinSCP.

    Copy over the entire custom_java_adapter folder onto your Raspberry Pi, into the /home/pi directory

    Copy Custom Java Adapter
  • Step 2

    We will now start Streaming Lite and run our Custom Java Adapter. To see what our Custom Java Adapter is inputting, we will subscribe to the isFreezerTemperatureReading stream of our freezer_monitoring_lite project.

    First, start up the freezer monitoring lite program in PuTTY/SSH by running:

    Bash
    Copy

    $STREAMING_HOME/bin/streamingproject --ccx $HOME/freezer_monitoring_lite.ccx --command-port 9230

    Open up another PuTTY/SSH window to run our Custom Java Adapter. To run our adapter, run this command:

    Bash
    Copy

    java -cp "$HOME/custom_java_adapter/java_adapter_runnable.jar:$HOME/custom_java_adapter/libj/streaming-client.jar" custom_java_adapter.JavaAdapter

    If it is successful, you should see this:

    Message Published Successfully

    Next, we will subscribe to the isFreezerTemperatureReading stream. The streamingsubscribe executable comes with the installation of Streaming Lite, and is used to view the contents of any stream in a running project.

    Open up a third PuTTY/SSH window, and run it using the following command. Make sure to replace <host> with your FQDN (Fully Qualified Domain Name):

    Bash
    Copy

    $STREAMING_HOME/bin/streamingsubscribe -s isFreezerTemperatureReading -p <host>:9230/freezer_monitoring_lite

    If our Custom Java Adapter is working correctly, you will be able to see the rows being written into our input stream:

    Custom Adapter Working Successfully

    For the question below, select the correct answer, and click Validate.

    Which stream is subscribed to see the rows being written into our input stream, using the streamingsubscribe executable?

Back to top