Running the application
As mentioned in the previous section, we need to run the Pub/Sub server for the WebSocket communication to happen. Let's do that:
bash> git clone https://github.com/atrato/pubsub-server
Then build and run the pub/sub server (the message broker):
bash> cd pubsub-server; mvn compile exec:java
The pub/sub server is now running, listening to the default port 8890 on localhost.
Now that the server is all set up, let's open the Apex CLI command prompt (refer back to Chapter 2, Getting Started with Application Development, for instructions on setting up Apache Apex, if necessary) and actually run the application:
bash> apex
apex> launch target/malhar-examples-nyc-taxi-3.8.0-SNAPSHOT.apa
After the application runs for one minute, we can start querying the data. The reason why we need to wait for one minute is that we need to wait for the first window to pass the watermark for the triggers to be fired by WindowedOperator
.
Note
Note that since we are using sliding windows...