Skip to content

Navigation Menu

Sign in
Sign up

Latest commit

History

16 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

Distributed Publisher-Subscriber System! πŸ“¬

This Java-based project enables real-time communication between multiple publishers and subscribers using a network of Brokers to handle message routing with flexibility and efficiency.

System Design

  • Decoupled Architecture
    The system decouples publishers and subscribers through a network of Brokers, allowing for asynchronous communication and reducing direct dependencies between components.
  • Multi-Broker Synchronization
    Brokers communicate with each other to ensure message consistency across the network, so subscribers can always receive relevant messages, regardless of which Broker they're connected to.
  • Fault Tolerance & Scalability
    Fault-tolerant mechanisms are in place to handle disconnections of publishers or subscribers, automatically removing related topics and subscriptions to maintain system consistency. Additionally, using a thread-per-client model ensures that each connection is handled independently, enhancing scalability.
  • TCP Socket Communication
    The system uses TCP sockets for reliable, connection-oriented communication between publishers, subscribers, and brokers. This design choice ensures that messages are reliably delivered and that real-time updates are consistently synchronized across all brokers.

πŸ“€ Publisher Functionality

  • Create Topics
  • Publish Messages
  • Show Subscriber Count
  • Delete Topics

πŸ“₯ Subscriber Functionality

  • List Topics
  • Subscribe to Topics
  • Receive Real-Time Messages
  • Unsubscribe from Topics

πŸ’‘ Getting Started

Make sure you have JDK 21.0.3 installed. Then, follow these steps:

  1. Download the following files and place them in a folder:

    • broker.jar
    • publisher.jar
    • subscriber.jar
  2. Navigate to the folder in your terminal:

    cd /path/to/your/folder
  3. Start the Broker by specifying the port:

    java -jar broker.jar <port>
  4. Start the Publisher and connect it to a Broker:

    java -jar publisher.jar <broker-ip> <broker-port>
  5. Start the Subscriber and connect it to a Broker:

    java -jar subscriber.jar <broker-ip> <broker-port>

Feel free to reach out with any questions or feedback.πŸ‘‹

About

This Java-based project enables real-time communication between multiple publishers and subscribers using a network of Brokers to handle message routing with flexibility and efficiency.

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /