Getting Started with Streaming Analytics
Also available as:
PDF
loading table of contents...

Running the Stream Simulator

Now that you have developed and deployed the NiFi Flow Application and the Stream Analytics Application, you can run a data simulator that generates truck geo events and sensor events for the apps to process.

To generate the raw truck events serialized into Avro objects using the Schema registry and publish them into the raw Kafka topics, do the following:

  1. Download the Data-Loader.
  2. Unzip the Data Loader file and copy it to the cluster. Lets call the directory to which you unzipped the file as $DATA_LOADER_HOME.
  3. Change into the Data Loader directory:
    cd $DATA_LOADER_HOME
  4. Untar the route.tar.gz file:
    tar -zxvf $DATA_LOADER_HOME/routes.tar.gz
  5. Open the file startTruckGenerators.sh and make the following changes:
    1. Modify the kafkaBrokers value based on your cluster
    2. If your cluster is not secure, set the value of SECURE_MODE to NONSECURE and set JAAS_CONFIG to an empty space
    3. Set the value of ROUTES_LOCATION to the location where you untar the routes in step 4 and then (e.g: $DATA_LOADER_HOME/routes/midwest)
  6. Run the simulator/data generator:
    ./startTruckGenerators.sh

You should see events being sent to the gateway kafka topics. NiFi should consume the events, enrich them, and then push them into the syndicate topics. SAM, Spark Streaming and other apps should consume from these syndicate topics