hafifamudi / golang-advanced

This a repo for my exploration with Golang Programming Language about advanced concept πŸ”₯

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Goqite message queue library (much simpler usage of queue concept)

β”œβ”€β”€ db                          # Folder related to database migration
    β”œβ”€β”€ db.go                   # File with migration code inside
β”œβ”€β”€ helpers                     # Folder for helper file
    β”œβ”€β”€ queue.go                # File with queue method to create queue message it self
β”œβ”€β”€ goqite.db                   # Database SQlite for goqite persistence message
β”œβ”€β”€ main.go                     # Entry Point file
└── README.md                   # Docs file
  • Installation

    • just go mod tidy
    • then execute go run ./main.go
  • What is this project about ( actually just little bit exploration πŸ˜„ )

    • Simulate how to create message queue, this is simpler implementation about queue message than Kafka, Rabbit MQ (maybe overkill for your small project)
    • Here I already simulate how to send a queue (dont worry it will persistance in our SQlite db), then how to consume it, set time to live of the queue message and so on.
    • Then I also simulate about how the service or backgroud job can running using concurrent process of Golang to keep consume the queue, then you can execute any business logic or API call.
    • Finally, I will keep explore this project on the future, maybe using job scheduler, API call or integrate it with background service, so be ready 😎
  • This an image of how the queue message stored in SQlite (goqite) table


  • This an image of how to queue message consumed

About

This a repo for my exploration with Golang Programming Language about advanced concept πŸ”₯


Languages

Language:Go 100.0%