Asynchronous real-time chat with RabbitMQ.
Implementation in three different technologies, but the common technology for all three is RabbitMQ.
The operating logic is very simple to understand: A user sends a message to a queue, all users connected to that queue will receive the message if the message consumed is not their own.
Let's assume that user A, B and C sent a message to the queue, user A will receive the message from B and C, user B will receive the message from user A and C, and finally, user C will receive messages from user A and B.
cs-rabbitmq/chat/
Folder | Description |
---|---|
Model |
Stores the entities that will be published in queues and consumed from them. |
Pub |
Encapsulation of the logic of sending messages to a specific queue. |
Sub |
Encapsulation of the logic for consuming messages from a specific queue. |
go-rabbitmq/internal/
Folder | Description |
---|---|
cmd |
Main method of our application. |
model |
Stores the entities that will be published in queues and consumed from them. |
pub |
Encapsulation of the logic of sending messages to a specific queue. |
sub |
Encapsulation of the logic for consuming messages from a specific queue. |
java-rabbitmq/src/main/java/chat
Folder | Description |
---|---|
app |
Main class of our application, the entrypoint. |
model |
Stores the entities that will be published in queues and consumed from them. |
pub |
Encapsulation of the logic of sending messages to a specific queue. |
sub |
Encapsulation of the logic for consuming messages from a specific queue. |
Some external libraries were used, below is a list of them all: