An experimental pub/sub client and server project.

update readme

+23 -1
+23 -1
README.md
··· 1 - ## Message broker is my attempt at building client / server pub/sub system written in Go using plain `net.Conn`. 1 + # Message Broker 2 + 3 + Message broker is my attempt at building client / server pub/sub system written in Go using plain `net.Conn`. 4 + 5 + I decided to try to build one to further my understanding of how such a common tool is used in software engineering. 6 + 7 + I realised that I took for granted how complicated other pub / sub message brokers were such as NATs, RabbitMQ and Kafka. By creating my own, I hope to dive into and understand more of how message brokers work. 8 + 9 + ## Concept 10 + 11 + The server accepts TCP connections. When a connection is first established, the client will send an "action" message which determines what type of client it is; subscribe or publish. 12 + 13 + ### Subscribing 14 + Once a connection has declared itself as a subscribing connection, it will need to then send the list of topics it wishes to initally subscribe to. After that the connection will enter a loop where it can then send a new action; subscribe to new topic(s) or unsubscribe from topic(s). 15 + 16 + ### Publishing 17 + Once a subscription has declared itself as a publisher, it will enter a loop where it can then send a message for a topic. Once a message has been received, the server will then send it to all connections that are subscribed to that topic. 18 + 19 + ### Sending data via a connection 20 + 21 + When sending a message representing an action (subscribe, publish etc) then a uint8 binary message is sent. 22 + 23 + When sending any other data, the length of the data is to be sent first using a binary uint32 and then the actual data sent afterwards.