A Java messaging broker that allows you to create topics, publish messages, and consume them through a simple TCP interface.
javac *.java
java MessagingServer
Server starts on port 9099
nc 127.0.0.1 9099
- Create: create <topic_name> <num_partitions>
# Create a topic with 2 partitions
create mytopic 2
- Publish: publish <topic_name> <partition_index>
# Publish a message to partition 0
publish mytopic 0 "Hello World"
- Consume: consume <topic_name> <partition_index>
# Read messages from partition 0 starting at offset 0
consume mytopic 0 0
- Messages are stored persistently in files under the partitions/ directory
- Each partition has its own file named -partition-.log