{"id":28149635,"url":"https://github.com/piquette/msgr","last_synced_at":"2025-05-15T02:14:10.368Z","repository":{"id":57551716,"uuid":"221140699","full_name":"piquette/msgr","owner":"piquette","description":"Beginner-friendly bindings for rabbitmq in go :rabbit: :zap:","archived":false,"fork":false,"pushed_at":"2019-11-13T00:56:57.000Z","size":9,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-06-20T01:50:20.490Z","etag":null,"topics":["amqp","amqp-client","go","library","messaging","rabbitmq","rabbitmq-client"],"latest_commit_sha":null,"homepage":"https://piquette.io/projects/msgr","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/piquette.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}},"created_at":"2019-11-12T05:54:17.000Z","updated_at":"2024-02-02T14:51:24.000Z","dependencies_parsed_at":"2022-09-20T13:06:50.876Z","dependency_job_id":null,"html_url":"https://github.com/piquette/msgr","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/piquette%2Fmsgr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/piquette%2Fmsgr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/piquette%2Fmsgr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/piquette%2Fmsgr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/piquette","download_url":"https://codeload.github.com/piquette/msgr/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254259430,"owners_count":22040822,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["amqp","amqp-client","go","library","messaging","rabbitmq","rabbitmq-client"],"created_at":"2025-05-15T02:14:09.934Z","updated_at":"2025-05-15T02:14:10.361Z","avatar_url":"https://github.com/piquette.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# msgr | AMQP Client\n\n[![GoDoc](http://img.shields.io/badge/godoc-reference-blue.svg)](http://godoc.org/github.com/piquette/msgr) [![Build Status](https://travis-ci.org/piquette/msgr.svg?branch=master)](https://travis-ci.org/piquette/msgr) [![Coverage Status](https://coveralls.io/repos/github/piquette/msgr/badge.svg?branch=master)](https://coveralls.io/github/piquette/msgr?branch=master)\n\n## Summary\n\nThis go module is a tiny wrapper around the [streadway/amqp](https://github.com/streadway/amqp), the standard low level golang client for [rabbitmq](https://www.rabbitmq.com/), the open source message broker. \n\n`msgr` abstracts away a few of the complexities of rabbitmq and exposes a slightly friendlier interface, intended for simple applications.\n\n## Documentation\n\nFor details on all the functionality in this library, see the [GoDoc][godoc] documentation.\n\n## Installation\n\nThis project supports modules and Go 1.13+. Add `msgr` to your own project the usual way -\n\n```sh\ngo get github.com/piquette/msgr\n```\n\n## Usage example\n\n### Producer\n\n```go\n// Instantiate and connect to the server.\nconf := \u0026msgr.Config{\n    URI:     \"amqp://localhost:5672\",\n    Channel: \"queue_name\",\n}\nproducer = msgr.ConnectP(conf)\ndefer producer.Close()\n\n// Send a message.\nEnqueue:\n{\n    success := producer.Post([]byte(\"hi\")])\n    if !success {\n        // Retry for all eternity.\n        log.Println(\"could not enqueue msg\")\n        time.Sleep(time.Second * 3)\n        goto Enqueue\n    }\n}\n```\n\n### Consumer\n\n```go\n// Instantiate and connect to the server.\nconf := \u0026msgr.Config{\n    URI:     \"amqp://localhost:5672\",\n    Channel: \"queue_name\",\n}\nconsumer = msgr.ConnectC(conf)\ndefer consumer.Close()\n\n// Receive messages.\nopen, messages := s.Consumer.Accept()\nif !open {\n    return\n}\n// Range over the messages chan.\nfor recv := range messages {\n    // Got one.\n    fmt.Println(string(recv.Body)) // prints 'hi'.\n\n    // Don't forget to acknowledge.\n    recv.Ack(false)\n}\n```\n\n\n## Contributing\n\nThis modules is a work in progress and needs a lot of refinement. Please [submit an issue][issues] if you need help! \n\n\n[godoc]: http://godoc.org/github.com/piquette/msgr\n[issues]: https://github.com/piquette/msgr/issues/new\n[pulls]: https://github.com/piquette/msgr/pulls","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpiquette%2Fmsgr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpiquette%2Fmsgr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpiquette%2Fmsgr/lists"}