This Repository contains Web Development Task to be completed as a part of the Inria selection Procedure.
clear
REST API method that cleans all the data in the memory. sequenceDiagram
participant UI
participant WebApp
participant Sensor_1
participant Sensor_2
participant Sensor_3
participant Message Broker
participant Consumer_1
participant Consumer_2
participant Consumer_3
participant Database
UI->>WebApp : HTTP POST Request Input user's name
WebApp-->>UI : Response OK
WebApp->>Sensor_1 : Forward Request 1
WebApp->>Sensor_2 : Forward Request 2
WebApp->>Sensor_3 : Forward Request 3
Sensor_1->>Message Broker: Send Message 1
Sensor_2->>Message Broker: Send Message 2
Sensor_3->>Message Broker: Send Message 3
Message Broker->>Consumer_1: Consume Messgae 1
Message Broker->>Consumer_2: Consume Messgae 2
Message Broker->>Consumer_3: Consume Messgae 3
Consumer_1-->>Message Broker: Acknowledge
Consumer_2-->>Message Broker: Acknowledge
Consumer_3-->>Message Broker: Acknowledge
Consumer_1->>Database : Store Username
Database-->>Consumer_1 : Response OK
Consumer_2->>Database : Clear Username
Database-->>Consumer_2 : Response OK
Consumer_3->>Database : Update Username
Database-->>Consumer_3 : Response OK
docker
rabbitmq/
directory.docker compose up
in the terminal.http://localhost:15672
to get the login page.guest
and password as guest
as well.sensor_1
, sensor_2
and sensor_3
to which 3 different data types are added.direct
exchanger is used so that a particular type of data is given only to its corresponding queue.routing key
and binding key
. The data is published along with the routing key
which when (in direct
case) exactly matches with the binding key
of a queue, it is given to that particular queue.binding keys
were used.sensor_1
-->
first_sensor
sensor_2
-->
second_sensor
sensor_3
-->
third_sensor
Exchanges
tab, and select exchanger
from the list of exchanges.Bindings
drop down menu to see the different queues
and associated Routing key
.Publish message
drop down and type the Routing key
of the associated Queue.Payload
section and finally click on Publish message
. You will get a message published pop up window, close it.Routing key
for sensor_1
the messgae should have been received by sensor_1
only and no other queue since its a direct
exchange.Queues
tab select the sensor_1
queue and expand the Get messages
drop section and click on Get Messages(s)
button.payload
should be the same as you sent in Step 4. And this message should not exist in other queues, repeat the steps 6-7 to confirm this.pip install -r requirements.txt
python run.py
in the terminal.http://127.0.0.1:5000/
Flask, RabbitMQ/Redis, SQLAlchemy