This project implements a simplified, in-memory message queue system using gRPC in Go, inspired by AWS Simple Queue Service (SQS). The goal of the project is to create a basic task queue system where producers can send messages to a queue, consumers can retrieve those messages with a visibility timeout, and once a task is complete, the messages can be deleted from the queue.
protoc --go_out=. --go-grpc_out=. --proto_path=. queue.proto
go run cmd/server/main.go
go run cmd/producer/main.go
go run cmd/consumer/main.go
Create a database named test.db using the following command:
sqlite3 db/queue.db
The command outputs the following:
SQLite version 3.16.2 2017-01-06 16:32:41
Enter ".help" for usage hints.
sqlite>
sqlite> .databases
sqlite> .exit
$ ls /db
queue.db
CREATE TABLE messages (
ID TEXT,
Body TEXT,
PRIMARY KEY(ID)
);
CREATE TABLE queues (
ID TEXT,
Name TEXT,
PRIMARY KEY(ID)
);