Deploy and Test the Streaming Lite Custom Adapter
- 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
Jarfile, and click Next.
On the subsequent screen, make sure to check off only the
"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.
Connect to your
Copy over the entire
custom_java_adapterfolder onto your
Raspberry Pi, into the
- 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
isFreezerTemperatureReadingstream of our
First, start up the freezer monitoring lite program in
$STREAMING_HOME/bin/streamingproject --ccx $HOME/freezer_monitoring_lite.ccx --command-port 9230
Open up another
PuTTY/SSHwindow to run our Custom Java Adapter. To run our adapter, run this command:BashCopy
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:
Next, we will subscribe to the
streamingsubscribeexecutable 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/SSHwindow, and run it using the following command. Make sure to replace
FQDN(Fully Qualified Domain Name):BashCopy
$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:
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?