Messaging service is used by created simple message and retrieve message implementation.
- User Post a massage use API
- Message will be store in database
- Message
statusshould besentif message success in publish to kafka. - Message
statusshould bereceivedif message success to consumed withconsumer_message.
- Note: I use delay in 5 second in consumer to be update status message
receivedfor proof.
- Database Mysql (MariaDB)
- Kafka (for data streaming)
I use go version for service compatible go1.12.5 darwin/amd64
I Use Docker for deployment my apps and integration app. Docker is very simple for running this app.
So please install docker into your PC https://docs.docker.com/install
This service using kafka for event streaming. Prepare install please check this link https://kafka.apache.org/quickstart
The firs you must extract this file into your workspace project.
How To run :
Run Mysql
$ docker-compose -f docker-compose-mysql up
Run Kafka
Download dependecies
$ go mod download
Run Http Server
$ go run main.go http
Run Consumer message
$ go run main.go consumer
This service has documentation following swagger for your try. So please se file in path ./api/api_spech.yaml.
To run unit test for the project :
$ go test $(go list ./... | grep -v /vendor/) -cover
In golang they already define the convention style https://golang.org/doc/effective_go.html