An open API service indexing awesome lists of open source software.

https://github.com/eneskzlcn/message-receiver-processor

3 application inside. First one is message receiver that receives messages from user and publishes a rabbitmq message with the message, sender and receiver content. Second one is message processor that consumes the messages from rabbitmq and saves them to the redis. The third one is message lister that lists all the messages between given two user.
https://github.com/eneskzlcn/message-receiver-processor

gin golang messaging-api rabbitmq redis

Last synced: 4 months ago
JSON representation

3 application inside. First one is message receiver that receives messages from user and publishes a rabbitmq message with the message, sender and receiver content. Second one is message processor that consumes the messages from rabbitmq and saves them to the redis. The third one is message lister that lists all the messages between given two user.

Awesome Lists containing this project

README

          

### About Project
The project is like a backend-service of a message program.
It serves an endpoint to accept messages then it produces
a rabbitmq message. Another service that consumes rabbitmq
catches that message and write the message to the redis in a
format that each sender-receiver grouped messages are sorted
in chronological descending order. The last service is
the reporting service which serves an endpoint to list
all messages in chonological descending order with corresponding
sender-receiver pair.

### Local Setup

Firstly, you need to up the redis and rabbitmq containers
which are configured in docker-compose.yml

```shell
docker compose up -d
```

Then Execute:

```shell
go run main.go
```

### Endpoints

`GET: /message:` When you hit that endpoint with the request
has body like `{sender:"", receiver:"", message:""}`, it takes
that message and publishes that message to the rabbitmq.

**GET: /message/list?sender=x&receiver=y** When you hit that
endpoint with query params **sender:string**, **received: string**,It
reads the redis for senders message sent to receiver and returns a list of object
array in a format like
`[{sender:"", receiver:"", message:""},
{sender:"", receiver:"", message:""}
]` and in a chronological descending order.