{"id":13651283,"url":"https://github.com/peterfraedrich/consulmq","last_synced_at":"2026-01-14T14:32:25.540Z","repository":{"id":42000173,"uuid":"249786697","full_name":"peterfraedrich/consulmq","owner":"peterfraedrich","description":"Use k/v stores as message queues!","archived":false,"fork":false,"pushed_at":"2024-04-01T23:30:53.000Z","size":71,"stargazers_count":12,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-15T13:59:36.698Z","etag":null,"topics":["consul-kv","filesystem","golang","in-memory","kubernetes","message-queue","redis","task-queue"],"latest_commit_sha":null,"homepage":"https://pkg.go.dev/github.com/peterfraedrich/consulmq","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/peterfraedrich.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-03-24T18:28:31.000Z","updated_at":"2024-03-22T05:23:33.000Z","dependencies_parsed_at":"2024-06-19T03:21:59.184Z","dependency_job_id":null,"html_url":"https://github.com/peterfraedrich/consulmq","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/peterfraedrich/consulmq","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterfraedrich%2Fconsulmq","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterfraedrich%2Fconsulmq/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterfraedrich%2Fconsulmq/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterfraedrich%2Fconsulmq/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/peterfraedrich","download_url":"https://codeload.github.com/peterfraedrich/consulmq/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterfraedrich%2Fconsulmq/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28423373,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T13:30:50.153Z","status":"ssl_error","status_checked_at":"2026-01-14T13:29:08.907Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["consul-kv","filesystem","golang","in-memory","kubernetes","message-queue","redis","task-queue"],"created_at":"2024-08-02T02:00:47.585Z","updated_at":"2026-01-14T14:32:25.523Z","avatar_url":"https://github.com/peterfraedrich.png","language":"Go","funding_links":[],"categories":["Projects"],"sub_categories":["Other"],"readme":"# ConsulMQ is changing to KVMQ!\n### I am working on a new branch of ConsulMQ that allows for different KV backends, not just Consul; please update your code appropriately.\n![ConsulMq](consulmq.png)\n\nDocs -- [https://pkg.go.dev/github.com/peterfraedrich/consulmq](https://pkg.go.dev/github.com/peterfraedrich/consulmq)\n\n![Go](https://github.com/peterfraedrich/consulmq/workflows/Go/badge.svg)\n[![Go Report Card](https://goreportcard.com/badge/github.com/peterfraedrich/consulmq)](https://goreportcard.com/report/github.com/peterfraedrich/consulmq)\n[![Coverage Status](https://coveralls.io/repos/github/peterfraedrich/consulmq/badge.svg?branch=master)](https://coveralls.io/github/peterfraedrich/consulmq?branch=master)\n\nConsulMQ allows you to use [Hashicorp Consul](https://consul.io) as a messaging queue. The idea is that you're already using Consul for configuration, monitoring, key-value DB, service-mesh, and a host of other functions, it would be nice to be able to have a simple message queue also running in Consul and eliminate the need for extra infrastrucutre (like RabbitMQ or Kafka, etc.).\n\n## Features\n* Durable, distributed task/message queue\n* ConsulMQ nodes register with Consul, providing real-time visibility into how many nodes are connected\n* Simple, easy-to-use API\n* Based on well-established devops/infrastructure tools\n\n## TL;DR\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/peterfraedrich/consulmq\"\n)\n\nfunc main() {\n\n\tmq, err := consulmq.Connect(consulmq.Config{\n\t\tAddress:    \"172.17.0.2:8500\",\n\t\tDatacenter: \"dc1\",\n\t\tToken:      \"\",\n\t\tMQName:     \"cmq\",\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\ti := 0\n\tfor i \u003c= 100 {\n\t\t// Put and item on the queue\n\t\tqo, err := mq.Push([]byte(\"Hello, is it me you're looking for?\"))\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tfmt.Println(qo.ID)\n\t\ti++\n\t}\n\tfmt.Println(\"++++++++++++++++++++++++++++++++++++++++++++++++++++++\")\n\tx := 0\n\tfor x \u003c= 100 {\n\t\t// Pop an item off the queue\n\t\t_, qo, err := mq.Pop()\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tfmt.Println(qo.ID)\n\t\tx++\n\t}\n}\n```\n\n## How it works\nConsulMQ uses Consul's key/value store as a messaging queue. Each queue consists of an `index` and the queued messages. The `_index` record  is a JSON list holds the order and mapping for all of the messages in the queue. The queued messages are represented by a unique ID and stored under that ID as the message's key. When an operation is requested (`Push`, `Pop`, etc.), the index is updated with the changes and the message ID used to locate the appropriate message.\n\n## Pro/Con\n\n### Pros\n* Using a tool that's already in production eliminates the need for spinning up yet-another-tool\n* Consul is a well-known entity\n* Changes are distributed to all Consul nodes which eliminates a single point of failure\n\n### Cons\n* Consul wasn't really designed to do this\n* The use of locks means that only one node can write to an index at a time\n* Will not be as performant as a dedicated message broker or stream platform (AMQP, Kafka, etc.)\n\n## Roadmap\n\n* Enforce TTL's\n* Consul Enterprise Namespace compatibility\n* Logging \u0026 Monitoring\n* Additional operations\n    * Search\n    * PushAtIndex\n    * PopFromindex\n    * Drain\n    * ClearQueue\n\n\n### License: MIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeterfraedrich%2Fconsulmq","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpeterfraedrich%2Fconsulmq","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeterfraedrich%2Fconsulmq/lists"}