A simple Java Swing application where multiple instances connect to a shared virtual grid and publish or receive each other’s positions in real time via MQTT. It demonstrates the publish–subscribe pattern using the Eclipse Paho MQTT client library and a public MQTT broker.
MQWorld is an experimentation sandbox:
- Change the topic structure
- Swap the broker
- Adjust the visuals
- Scale the world
- Extend the logic with new agents or interactions
- MQTT publish--subscribe architecture using Paho.
- Real‑time synchronization of multiple clients in the same shared "world".
- Lightweight Java Swing GUI.
- Thread‑safe "Blackboard" shared‑memory model separating model, view, and controller.
- Automatic reconnection and MQTT session management.
- Easily extensible.
java -jar target/MQWorld-1.0.jar player1
java -jar target/MQWorld-1.0.jar player2
| Key | Action |
|---|---|
| ↑ | Move Up |
| ↓ | Move Down |
| ← | Move Left |
| → | Move Right |
- Main.java -- entry point
- Blackboard.java -- shared model
- WorldPanel.java -- renderer
- Player.java -- player model
- Publisher.java -- MQTT publisher
- Subscriber.java -- MQTT subscriber
