A simple app to produce messages to SQS by using aws sdk v2 package for Golang in performatic meaning.
| go 1.17 or above is required.
Just run the command go run .
at the root directory
Build the image
docker build . producer-sqs:snapshot
Execute a docker run
docker run -i -d -t -p 8080:9292 -e AWS_ACCESS_KEY_ID=access_key -e AWS_SECRET_ACCESS_KEY=access_secret -e AWS_DEFAULT_REGION=region producer-sqs:snapshot
The service were implemented by using gin as http Router to the api.
- GET /send/:qtd Generates and send messages async in parallel
- GET /send/batch/:qtd Generates and send messages in batch of 10 messages each, sapaws a hardcoded number of workers into a pool to fan-out messages to sqs.
The server metrics will be at the port 8080, to scrap metrics can simply open the url:
http://localhost:8080/metrics
| As I told early, /send/batch route implementes a performatic way to send milions of messages to SQS by using goroutines, channels and an worker pool strategy to send messages in batch and parallel, with this we can produce 1000000 (One milion) messages in less than 180 seconds, thats means we can produce 5500 messages per second with that simple implementation of go routines and channels.
working in progress...