Task Summary • THREE (3) separate tasks make up this assessment. Each of the tasks deals with different domains: 1) chatting; 2) trading; and 3) contact tracing. • In each of the three (3) tasks, you will be required to get middleware up and running to enable the applications you develop to communicate with one another. • You will develop command line–based applications that will do one or both of the following: o Subscribe to topics in the middleware; and/or o Perform behaviours based on messages received. • You will publish to topics in middleware based on user input or start-up parameters. It is a prerequisite that: o You have access to a machine that is capable of running Docker or similar containerisation software (e.g., Podman). However, it should be noted that the instructions provided here are for Docker only. • In relation to the middleware: o RabbitMQ is the prescribed middleware; and o You can reuse the middleware from the first prototype for allsubsequent prototypes. Please refer to the Task Instructions (below) for details on how to complete this task. Context The assumptions for all of the following three (3) tasks is that you already have some basic programming knowledge from prior courses and are able to use some general-purpose language (e.g., C++, Java or JavaScript). Some prior knowledge of basic programming and general purpose language (i.e., C++, Java or JavaScript) will prove advantageous in completing the task requirements. In the course of completing all three (3) tasks, you will need to divide the work appropriately among your team members to complete the assignments. The areas of focus may include: eliciting requirements from the instructor, understanding the chosen middleware technology being used (e.g., RabbitMQ), determining the choice of serialisation (e.g., JSON), defining contracts and protocols between systems, designing GUIs and planning for the demonstration. Note: The instructor may choose to switch or fix some of these technology decisions. (e.g., this may occur if the company you joined already has a middleware solution). It is also likely and anticipated that you will need to develop parts of the solution(s) independently and then test them against one another (i.e., you will need to engage in integration testing). Teams should recognise that integration is a key area of risk (from the first or second prototype) and allow ample time for it in subsequent assignments. Hopefully, you will quickly realise that you wi

University/Course: PBT205

Uploaded: October 30, 2024

Files: 2

✓ Solution:

 

 

 

 

 

 

 

 

 

 

 

1. Introduction

This report presents the design, implementation, and validation of three distributed applications developed using RabbitMQ as the middleware to enable asynchronous message-based communication. The applications—Chatting Application, Trading System, and Contact Tracing System—demonstrate various use cases, including real-time chat, stock trading, and contact tracing in a grid-based environment. Each application includes both a command-line interface (CLI) and a graphical user interface (GUI) to enhance functionality and user experience.

 

 REPORT:

2. Task 1: Chatting Application

2.1 Overview

The Chatting Application allows multiple users to exchange messages within virtual chat rooms. Each user selects a chat room upon login, ensuring that messages are only shared among participants in the same room. This task demonstrates topic-based messaging and real-time communication.

2.2 Design and Architecture

  • Middleware: RabbitMQ is used as the message broker to manage message distribution within rooms. Each chat room corresponds to a separate fanout exchange in RabbitMQ.
  • Topic-Based Messaging: Each room has its own exchange, which isolates conversations and allows only users in the same room to receive messages.
  • Components:
    • CLI Client: Handles user input and prints messages to the console, based on the selected room.
    • GUI Client: Provides a graphical login screen and chat interface with real-time message display.
  • Message Flow:
    • Publish: Users send messages to the room’s exchange.
    • Subscribe: Each user creates an exclusive queue bound to the exchange, receiving messages only for the room they joined.

2.3 Code Implementation

  • CLI Version: The CLI version takes username and room as input arguments. After starting, it subscribes to the specified room’s exchange, receiving and displaying messages in real-time.
    • Room-based Isolation: Each room has its own RabbitMQ exchange, ensuring messages are isolated by room.
    • Message Format: Messages are sent in the format <username>: <message>, making it easy to identify the sender.
  • Error Handling: Ensures valid input for username and room, with error messages guiding the user.

 

 

2.4 GUI Features

  • User Login Screen: Provides input fields for username and room selection. Users are prompted to enter valid details before joining the chat.
  • Chat Interface:
    • Chat Display Area: Shows incoming messages in a scrollable text box.
    • Message Input: Allows users to send messages to the room by typing in an entry field.
    • Room Isolation: When users select a room, they only see messages from that room, ensuring a seamless user experience.

 

🔒 Whatsapp us for the full file.