Skip to content

Latest commit

 

History

History
63 lines (42 loc) · 2.46 KB

File metadata and controls

63 lines (42 loc) · 2.46 KB

Message-Broker-Using-Postgres

Introduction

This is a simple message broker system that uses Postgres as the message broker. The system is composed of two services, the producer and the consumer. The producer sends messages to the message broker and the consumer reads the messages from the message broker. The producer and the consumer are implemented in Python and the message broker is implemented in Postgres.

Flow

Setting up an Cron Job in Ubuntu

Ubuntu Docker

Install ubuntu docker image

docker pull ubuntu

Run the ubuntu docker image

docker run -it ubuntu bash

Install the cron package

apt-get install cron

Download the script

wget -O myscript https://raw.githubusercontent.com/MercyShark/Message-Broker-Using-Postgres/main/cronjobscript.sh

Add the Environment Variables to the script

nano myscript.sh

Permission to execute the script

chmod +x myscript.sh

Add the script to the crontab

crontab -e

Add the following line to the crontab to run the script every minute

* * * * * /myscript.sh
service cron restart
service cron status