Inspired by Sidekiq from Ruby, I try to make Simple Task App for Queue Processing with the help of Asynq library and Asynqmon to Serve Monitoring Dashboard. Written with Go language.
- Redis
- Go >= 1.18
- Kraken.io Account
- Firebase Account
To run this project, you will need to add the following environment variables to your .env file
REDIS_URL
KRAKEN_API_KEY
KRAKEN_API_SECRET
FIREBASE_PROJECT_ID
FIREBASE_DATABASE_URL
PORT
<= Optional
Before run this app, you must:
- Create an account at https://kraken.io/ then copy your API Key and Secret.
- Generate Firebase service account key:
- In the Firebase console, open Settings > Service Accounts.
- Click Generate New Private Key, then confirm by clicking Generate Key.
- Copy service account (.json) to go root dir and rename to serviceAccountKey.json
Clone the project
git clone https://github.com/pengdst/task-queue-asynq.git
Or Using SSH
git clone [email protected]:pengdst/task-queue-asynq.git
Go to the project directory
cd task-queue-asynq
Create environment file
cp .env.example .env
Install dependencies
go mod download
go mod tidy
Start the server
go run task-queue-asynq/cmd/client
go run task-queue-asynq/cmd/server
Go to the project directory
cd task-queue-asynq
Create docker-compose.yml file and fill environment
cp docker-compose.yml.example docker-compose.yml
Start the server
docker-compose up
or Start and Build the image
docker-compose up --build
GET /dashboard
Takes user_id and template_id and return message queue task status.
POST /email/delivery
Parameter | Type | Description |
---|---|---|
user_id |
int |
Required. |
template_id |
string |
Required. |
{
"message": "enqueued tasks: id=9130232c-4ebc-4fe9-b8ef-f0ead0c0ec01 queue=low"
}
Takes image_url and return message queue task status.
POST /image/resize
Parameter | Type | Description |
---|---|---|
image_url |
string |
Required. |
{
"message": "enqueued tasks: id=9130232c-4ebc-4fe9-b8ef-f0ead0c0ec01 queue=low"
}
- 📬 Asynq: simple, reliable & efficient distributed task queue for your next Go project
- Simple, reliable & efficient distributed task queue in Go
- Web UI for monitoring & administering Asynq task queue
- Add the Firebase Admin SDK to your server
API Client: Resty
Server: Gin
Image Resize: Kraken
Firebase: Firebase Messaging, Firebase Database
Contributions are always welcome!