This repository contains the material build for the 2016 Red Hat Summit.
The following sub-projects have been created
-
Software Sensors: a software sensor who could can be used to simulate sensor data creation.
-
Rules Service: a service which receives data from a defined AMQ-Queue, validates those against Business Rules and drops the results in another defined AMQ-Queue
-
Routing Service: the service who receives, transforms and routes messages from one destination to the next.
If you should do these labs on an environment, which was not prepared for it, please follow the instructions on how to setup a lab environment.
In our lab environment, we do need to have a running instance of Red Hat JBoss Fuse. To install this, please perform the following steps
-
Login to you lab-environment with
username = 'demo-user' password = 'change12_me'
-
Open a terminal
-
In the shell perform the following steps
[demo-user@localhost ~]$ cd [demo-user@localhost ~]$ unzip jboss-fuse-full-6.2.1.redhat-084.zip [demo-user@localhost ~]$ ln -s jboss-fuse-6.2.1.redhat-084 fuse
-
Close the shell
[demo-user@localhost ~]$ exit
These simple steps complete the installation of Red Hat JBoss Fuse.
We will start the JBoss Fuse server and will leave it running in the background. Deployment to the server will be done "hot", which is definately not a best-practice, but for the sake of this lab, it’s absolutely sufficient.
To start JBoss Fuse, please follow these simple steps
-
Open a new shell, as described in the previous section
-
Enter the following commands
[demo-user@localhost ~]$ cd [demo-user@localhost ~]$ cd IoT_Summit_Lab [demo-user@iotlab IoT_Summit_Lab]$ ./runJBossFuse.sh
-
Wait for the Red Hat JBoss Fuse to complete the start procedure
-
To be able to process MQTT messages, Red Hat JBoss Fuse needs to install the 'camel-mqtt' OSGi features. To to this, enter the following simple command on the 'JBossFuse' command prompt
JBossFuse:karaf@root> features:install camel-mqtt
-
Minimize this shell, as we don’t need it at the moment
The instructions on building and running the Software Sensor are located here.
The instructions on building and running the first Flow are located here.
The instructions on building and running the Business Rules Service are located here.
In this lab we will use the Software Sensor
from Lab 3 to create a stream
of sensordata and will observe the effect our Business Rules from Lab 7 has
on the data.
Please follow the following steps
-
Open a Terminal session or click on an open one
-
In the Terminal session, run the following commands
[demo-user@iotlab Desktop]$ cd [demo-user@iotlab ~]$ cd IoT_Summit_Lab/ [demo-user@iotlab IoT_Summit_Lab]$ ./runSensor.sh
You will see the sensordata being produced and received by the Business Rules Service
, as
documented in the following image.
-
You can use the number of messages in the various Queues to verify that the
Business Rules Service
did filter the messages as expected. To do so, go back to your browser windows and navigate to the page showing the Queues and their content.
In this case, you can see that all produced 50 messages were place into and
consumed from the queue message.to.rules
but not a single one was placed
into the queue message.to.datacenter
by the Business Rules Service
.
The reason for this are our implemented rules, which considered these values to be in range and therefor not required for further processing.
-
To get a different result you could update the rules to something like in the following image
-
Now you just need to
-
stop the running
Business Rules Service
task by hittingCTRL-C
in the right terminal session -
re-build and start the updated
Business Rules Service
as described and done in Lab 5 -
re-run the sensor
-
validate the number of messages per Queue in the JBoss Fuse Browser
-