{"id":13826724,"url":"https://github.com/furdarius/rabbitroutine","last_synced_at":"2026-01-18T06:32:03.946Z","repository":{"id":30432362,"uuid":"106719264","full_name":"furdarius/rabbitroutine","owner":"furdarius","description":"Lightweight library that handles RabbitMQ auto-reconnect and publishing retry routine for you.","archived":false,"fork":false,"pushed_at":"2024-03-03T12:23:30.000Z","size":1722,"stargazers_count":112,"open_issues_count":2,"forks_count":17,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-08-13T18:16:02.981Z","etag":null,"topics":["amqp","failover","go","rabbitmq"],"latest_commit_sha":null,"homepage":"https://pkg.go.dev/github.com/furdarius/rabbitroutine","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/furdarius.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2017-10-12T16:40:06.000Z","updated_at":"2025-05-30T03:13:40.000Z","dependencies_parsed_at":"2024-01-15T15:47:51.294Z","dependency_job_id":"203b8c1d-a453-4ce9-8f5d-8feff2cf4c84","html_url":"https://github.com/furdarius/rabbitroutine","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/furdarius/rabbitroutine","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/furdarius%2Frabbitroutine","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/furdarius%2Frabbitroutine/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/furdarius%2Frabbitroutine/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/furdarius%2Frabbitroutine/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/furdarius","download_url":"https://codeload.github.com/furdarius/rabbitroutine/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/furdarius%2Frabbitroutine/sbom","scorecard":{"id":414155,"data":{"date":"2025-08-11","repo":{"name":"github.com/furdarius/rabbitroutine","commit":"7d494d08535edf319cb52a08e06c77f41f2d5a39"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4.6,"checks":[{"name":"Code-Review","score":2,"reason":"Found 3/15 approved changesets -- score normalized to 2","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Token-Permissions","score":10,"reason":"GitHub workflow tokens follow principle of least privilege","details":["Info: topLevel 'contents' permission set to 'read': .github/workflows/go.yaml:11","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/go.yaml:30: update your workflow using https://app.stepsecurity.io/secureworkflow/furdarius/rabbitroutine/go.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/go.yaml:33: update your workflow using https://app.stepsecurity.io/secureworkflow/furdarius/rabbitroutine/go.yaml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/go.yaml:48: update your workflow using https://app.stepsecurity.io/secureworkflow/furdarius/rabbitroutine/go.yaml/master?enable=pin","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 27 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-18T23:23:56.816Z","repository_id":30432362,"created_at":"2025-08-18T23:23:56.816Z","updated_at":"2025-08-18T23:23:56.816Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28531997,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-18T00:39:45.795Z","status":"online","status_checked_at":"2026-01-18T02:00:07.578Z","response_time":98,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["amqp","failover","go","rabbitmq"],"created_at":"2024-08-04T09:01:43.198Z","updated_at":"2026-01-18T06:32:03.920Z","avatar_url":"https://github.com/furdarius.png","language":"Go","readme":"\u003cp align=\"center\"\u003e\u003cimg src=\"https://habrastorage.org/webt/-0/x1/z4/-0x1z48ndvvopw_baizloa6r1hs.png\"\u003e\u003c/p\u003e\n\n[![PkgGoDev](https://pkg.go.dev/badge/github.com/furdarius/rabbitroutine)](https://pkg.go.dev/github.com/furdarius/rabbitroutine)\n[![rabbitroutine](https://github.com/furdarius/rabbitroutine/actions/workflows/go.yaml/badge.svg)](https://github.com/furdarius/rabbitroutine/actions/workflows/go.yaml)\n[![Go Report Card](https://goreportcard.com/badge/github.com/furdarius/rabbitroutine)](https://goreportcard.com/report/github.com/furdarius/rabbitroutine)\n[![codecov](https://codecov.io/gh/furdarius/rabbitroutine/graph/badge.svg?token=tnraJ2LNqx)](https://codecov.io/gh/furdarius/rabbitroutine)\n\n# Rabbitmq Failover Routine\n\nLightweight library that handles RabbitMQ auto-reconnect and publishing retry routine for you.\nThe library is designed to save the developer from the headache when working with RabbitMQ.\n\n**rabbitroutine** solves your RabbitMQ reconnection problems:\n* Handles connection errors and channels errors separately.\n* Takes into account the need to [re-declare](https://godoc.org/github.com/furdarius/rabbitroutine#Consumer) entities in RabbitMQ after reconnection.\n* Notifies of [errors](https://godoc.org/github.com/furdarius/rabbitroutine#Connector.AddAMQPNotifiedListener) and connection [retry attempts](https://godoc.org/github.com/furdarius/rabbitroutine#Connector.AddRetriedListener).\n* Supports [FireAndForgetPublisher](https://godoc.org/github.com/furdarius/rabbitroutine#FireForgetPublisher) and [EnsurePublisher](https://godoc.org/github.com/furdarius/rabbitroutine#EnsurePublisher), that can be wrapped with [RetryPublisher](https://godoc.org/github.com/furdarius/rabbitroutine#RetryPublisher).\n* Supports pool of channels used for publishing.\n* Provides channels [pool size](https://godoc.org/github.com/furdarius/rabbitroutine#Pool.Size) statistics.\n\n\n## Usage\n\n```\ngo get github.com/furdarius/rabbitroutine\n```\n\n\n### Consuming\nYou need to implement [Consumer](https://godoc.org/github.com/furdarius/rabbitroutine#Consumer) and register\nit with [StartConsumer](https://godoc.org/github.com/furdarius/rabbitroutine#Connector.StartConsumer)\nor with [StartMultipleConsumers](https://godoc.org/github.com/furdarius/rabbitroutine#Connector.StartMultipleConsumers).\nWhen connection is established (*at first time or after reconnect*) `Declare` method is called. It can be used to\ndeclare required RabbitMQ entities ([consumer example](https://github.com/furdarius/rabbitroutine/blob/master/consumer_example_test.go)). \n\n\nUsage example:\n\n```go\n\n// Consumer declares your own RabbitMQ consumer implementing rabbitroutine.Consumer interface.\ntype Consumer struct {}\nfunc (c *Consumer) Declare(ctx context.Context, ch *amqp.Channel) error {}\nfunc (c *Consumer) Consume(ctx context.Context, ch *amqp.Channel) error {}\n\nurl := \"amqp://guest:guest@127.0.0.1:5672/\"\n\nconn := rabbitroutine.NewConnector(rabbitroutine.Config{\n    // How long to wait between reconnect\n    Wait: 2 * time.Second,\n})\n\nctx := context.Background()\n\ngo func() {\n    err := conn.Dial(ctx, url)\n    if err != nil {\n    \tlog.Println(err)\n    }\n}()\n\nconsumer := \u0026Consumer{}\ngo func() {\n    err := conn.StartConsumer(ctx, consumer)\n    if err != nil {\n        log.Println(err)\n    }\n}()\n```\n\n[Full example demonstrates messages consuming](https://github.com/furdarius/rabbitroutine/blob/master/consumer_example_test.go)\n\n\n### Publishing\n\nFor publishing [FireForgetPublisher](https://godoc.org/github.com/furdarius/rabbitroutine#FireForgetPublisher)\nand [EnsurePublisher](https://godoc.org/github.com/furdarius/rabbitroutine#EnsurePublisher) implemented.\nBoth of them can be wrapped with [RetryPublisher](https://godoc.org/github.com/furdarius/rabbitroutine#RetryPublisher)\nto repeat publishing on errors and mitigate short-term network problems.\n\nUsage example:\n```go\nctx := context.Background()\n\nurl := \"amqp://guest:guest@127.0.0.1:5672/\"\n\nconn := rabbitroutine.NewConnector(rabbitroutine.Config{\n    // How long wait between reconnect\n    Wait: 2 * time.Second,\n})\n\npool := rabbitroutine.NewPool(conn)\nensurePub := rabbitroutine.NewEnsurePublisher(pool)\npub := rabbitroutine.NewRetryPublisher(\n    ensurePub,\n    rabbitroutine.PublishMaxAttemptsSetup(16),\n    rabbitroutine.PublishDelaySetup(rabbitroutine.LinearDelay(10*time.Millisecond)),\n)\n\ngo conn.Dial(ctx, url)\n\nerr := pub.Publish(ctx, \"myexch\", \"myqueue\", amqp.Publishing{Body: []byte(\"message\")})\nif err != nil {\n    log.Println(\"publish error:\", err)\n}\n\n```\n\n[Full example demonstrates messages publishing](https://github.com/furdarius/rabbitroutine/blob/master/publisher_example_test.go)\n\n## Contributing\n\nPull requests are very much welcomed.  Create your pull request, make sure a test or example is included that covers your change and\nyour commits represent coherent changes that include a reason for the change.\n\nTo run the integration tests, make sure you have RabbitMQ running on any host\n```\ndocker run -it --rm --name rabbitmq -p 5672:5672 -p 15672:15672 rabbitmq:3.13-management\n```\n\nThen export the environment variable `AMQP_URL=amqp://host/` and run `go test -tags\nintegration`.\n\n```\nAMQP_URL=amqp://guest:guest@127.0.0.1:5672/ go test -v -race -cpu=1,2 -tags integration -timeout 5s\n```\n\nUse [golangci-lint](https://github.com/golangci/golangci-lint) to check code with linters:\n```\ngolangci-lint run ./...\n```\n","funding_links":[],"categories":["Go","Messaging","消息"],"sub_categories":["Search and Analytic Databases","检索及分析资料库"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffurdarius%2Frabbitroutine","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffurdarius%2Frabbitroutine","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffurdarius%2Frabbitroutine/lists"}