The main idea is to send CSV data (or the CSV itself, this will be discussed later) to other sources in order to import the data into databases. For now we are going to have PostgreSQL and Redis.
The client will continuously send the CSV data to RMQ's specified queue's which every service has it's own separated queue. The data will remain in the RMQ section until servers fetch it. After fetching, the server will send ack packet to RMQ asking to clear the queue.
RabbitMQ service should be installed on master server, then the script will connect to it via pika python module.
pip3 install pika
We need to enable listening on all interfaces:
{tcp_listeners, [{"0.0.0.0", 5672}, {"::1", 5672}]},
Allow guest remote access:
{loopback_users, []},
Currently we don't need hearbeat functionality in RMQ so disable it:
{heartbeat, 0}
Finally restart the service:
service rabbitmq restart
For the Redis, it's better to disable disk writing in redis.conf file.
Comment the following options:
# save 900 1
# save 300 10
# save 60 10000

