A Reliable publish-subscribe service that guarantees "exactly-once" delivery of the messages on top of ZeroMQ. Essentially, the system is composed of subscribers and publishers. The publishers can publish a message on a topic and the subscribers of a determined topic receive the messages posted on that topic. Developed in the course of Large Scale Distributed Systems by group T01G14.
Group members:
- Emanuel Trigo (up201605389@edu.fe.up.pt)
- Fábio Huang (up201806829@edu.fe.up.pt)
- Sara Pereira (up202204189@edu.fe.up.pt)
- Valentina Wu (up201907483@edu.fe.up.pt)
- Install Python3, see official website
- Install ZeroMQ, see official website
- Clone this repository:
git clone https://git.fe.up.pt/sdle/2022/t1/g14/proj1.git
- Head inside the this project folder, run the following command to install the necessary libraries:
pip install -r requirements.txt
For this publish-subscribe service:
-
The Clients:
- Are able to do the following operations:
- SUB - Subscribes a Topic
- UNSUB - Unsubscribes a Topic
- PUT - Publishes a Message on a Topic
- GET - Retrieves a Message from a Topic
- Topics are identified by an arbitrary string
- Topics are created implicitly when a subscriber subscribes to a topic that does not exist yet.
- All subscriptions are durable, according to the Java Message Service's (Jakarta Messaging) terminology.
- A topic's subscriber should get all messages put on a topic, as long as it calls GET enough times, until it explicitly unsubscribes the topic
- Are able to do the following operations:
-
The Server:
- Receives the operations mentioned above from the clients and reacts to them accordingly
Using the Command Line, for Windows users, inside the /src
directory:
python server.py
Using the Command Line, for Linux or MacOS users, inside the /src
directory:
python3 server.py
Note: Only one server should be running at a time
Using the Command Line, for Windows users, inside the /src
directory:
python client.py <CLIENT_ID>
Using the Command Line, for Linux or MacOS users, inside the /src
directory:
python3 client.py <CLIENT_ID>
Note: More than one client can be initiated, as long as the <CLIENT_ID> are different from each other
While the Client Application is running, the following operation commands can be sent to the server side:
SUB <TOPIC_NAME>
UNSUB <TOPIC_NAME>
GET <TOPIC_NAME>
PUT <TOPIC_NAME> <MESSAGE_CONTENT>
For example, to PUT a message "Porto is very hot today" to the Topic "weather", enter:
PUT weather Porto is very hot today