{"id":13395108,"url":"https://github.com/ruby-amqp/bunny","last_synced_at":"2026-04-02T22:39:11.260Z","repository":{"id":418648,"uuid":"1430734","full_name":"ruby-amqp/bunny","owner":"ruby-amqp","description":"Bunny is a popular, easy to use, mature Ruby client for RabbitMQ","archived":false,"fork":false,"pushed_at":"2025-04-21T17:59:15.000Z","size":4149,"stargazers_count":1399,"open_issues_count":6,"forks_count":309,"subscribers_count":30,"default_branch":"main","last_synced_at":"2025-04-30T07:03:06.995Z","etag":null,"topics":["amqp","amqp0-9-1","messaging","rabbitmq","ruby"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ruby-amqp.png","metadata":{"files":{"readme":"README.md","changelog":"ChangeLog.md","contributing":"CONTRIBUTING.md","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,"zenodo":null}},"created_at":"2011-03-02T13:40:03.000Z","updated_at":"2025-04-26T16:38:13.000Z","dependencies_parsed_at":"2023-12-21T21:22:44.848Z","dependency_job_id":"35ae67a1-7160-4d32-aaaa-5cc45b7a06a4","html_url":"https://github.com/ruby-amqp/bunny","commit_stats":{"total_commits":2146,"total_committers":137,"mean_commits":"15.664233576642335","dds":0.6304753028890959,"last_synced_commit":"c3025d171660389e005cd4bebee04ba6161fbd26"},"previous_names":[],"tags_count":166,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruby-amqp%2Fbunny","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruby-amqp%2Fbunny/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruby-amqp%2Fbunny/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruby-amqp%2Fbunny/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ruby-amqp","download_url":"https://codeload.github.com/ruby-amqp/bunny/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252860166,"owners_count":21815475,"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","amqp0-9-1","messaging","rabbitmq","ruby"],"created_at":"2024-07-30T17:01:42.291Z","updated_at":"2026-04-02T22:39:11.255Z","avatar_url":"https://github.com/ruby-amqp.png","language":"Ruby","funding_links":[],"categories":["Background Processing","Web 后端","Ruby","Queues and Messaging"],"sub_categories":["Background Jobs"],"readme":"# Bunny, a Ruby RabbitMQ Client\n\nBunny is a RabbitMQ client that focuses on ease of use. It\nis feature complete, supports all recent RabbitMQ features and does not\nhave any heavyweight dependencies.\n\n\n## I Know What RabbitMQ and Bunny are, How Do I Get Started?\n\n[Right here](https://www.rabbitmq.com/getstarted.html)!\n\n\n## What is Bunny Good For?\n\nOne can use Bunny to make Ruby applications interoperate with other\napplications (both built in Ruby and not). Complexity and size may vary from\nsimple work queues to complex multi-stage data processing workflows that involve\nmany applications built with all kinds of technologies.\n\nSpecific examples:\n\n * Events collectors, metrics \u0026 analytics applications can aggregate events produced by various applications\n   (Web and not) in the company network.\n\n * A Web application may route messages to a Java app that works\n   with SMS delivery gateways.\n\n * MMO games can use flexible routing RabbitMQ provides to propagate event notifications to players and locations.\n\n * Price updates from public markets or other sources can be distributed between interested parties, from trading systems to points of sale in a specific geographic region.\n\n * Content aggregators may update full-text search and geospatial search indexes\n   by delegating actual indexing work to other applications over RabbitMQ.\n\n * Companies may provide streaming/push APIs to their customers, partners\n   or just general public.\n\n * Continuous integration systems can distribute builds between multiple machines with various hardware and software\n   configurations using advanced routing features of RabbitMQ.\n\n * An application that watches updates from a real-time stream (be it markets data\n   or Twitter stream) can propagate updates to interested parties, including\n   Web applications that display that information in the real time.\n\n\n## Ports to Other Languages\n\nBunny has inspired a number of other RabbitMQ (AMQP 0-9-1) client libraries\nthat closely follow its feature set and API shape, form and ergonomics.\n\n * [Swift 6](https://github.com/michaelklishin/bunny-swift)\n\n\n## Supported Ruby Versions\n\nModern Bunny versions support\n\n * CRuby 3.2 through 3.4 (inclusive)\n * [TruffleRuby](https://www.graalvm.org/ruby/)\n\nFor environments that use TLS, Bunny expects Ruby installations to use a recent enough OpenSSL version that\n**includes support for [TLS 1.3](https://www.rabbitmq.com/docs/ssl#tls1.3)**.\n\n### JRuby\n\nBunny no longer supports JRuby.\n\nJRuby users should use [March Hare](https://github.com/ruby-amqp/march_hare), which has a similar API\nand is built on top of the RabbitMQ Java client specifically for JRuby.\n\n\n## Supported RabbitMQ Versions\n\nModern Bunny releases target [currently community supported RabbitMQ release series](https://www.rabbitmq.com/release-information).\n\nThe protocol implemented by Bunny was first introduced in RabbitMQ 2.0 and has evolved\nvia extensions and with next to no breaking changes, so all key Bunny operations can be used with a wide range\nof RabbitMQ versions, accounting for the few potentially breaking changes they\nmay introduce, e.g. the idempotency of `queue.delete` operations.\n\n\n## Change Log\n\n[Change log](https://github.com/ruby-amqp/bunny/blob/main/ChangeLog.md).\n\n\n## Installation \u0026 Bundler Dependency\n\n### Most Recent Release\n\n[![Gem Version](https://badge.fury.io/rb/bunny.svg)](http://badge.fury.io/rb/bunny)\n\n### Bundler Dependency\n\nTo use Bunny in a project managed with Bundler:\n\n``` ruby\ngem \"bunny\", \"\u003e= 2.23.0\"\n```\n\n### With Rubygems\n\nTo install Bunny with RubyGems:\n\n```\ngem install bunny\n```\n\n\n## Quick Start\n\nBelow is a small snippet that demonstrates how to publish\nand synchronously consume (\"pull API\") messages with Bunny.\n\nFor a 15 minute tutorial using more practical examples, see [Getting Started with RabbitMQ and Ruby using Bunny](https://www.rabbitmq.com/tutorials/tutorial-one-ruby.html).\n\n``` ruby\nrequire \"bunny\"\n\n# Start a communication session with RabbitMQ\nconn = Bunny.new\nconn.start\n\n# open a channel\nch = conn.create_channel\nch.confirm_select\n\n# declare a queue\nq  = ch.queue(\"test1\")\nq.subscribe(manual_ack: true) do |delivery_info, metadata, payload|\n  puts \"This is the message: #{payload}\"\n  # acknowledge the delivery so that RabbitMQ can mark it for deletion\n  ch.ack(delivery_info.delivery_tag)\nend\n\n# publish a message to the default exchange which then gets routed to this queue\nq.publish(\"Hello, everybody!\")\n\n# await confirmations from RabbitMQ, see\n# https://www.rabbitmq.com/publishers.html#data-safety for details\nch.wait_for_confirms\n\n# give the above consumer some time consume the delivery and print out the message\nsleep 1\n\nputs \"Done\"\n\nch.close\n# close the connection\nconn.close\n```\n\n\n## Documentation\n\n### Getting Started\n\nFor a 15 minute tutorial using more practical examples, see [Getting Started with RabbitMQ and Ruby using Bunny](https://github.com/ruby-amqp/bunny/blob/main/docs/guides/getting_started.md).\n\n### Guides\n\nBunny documentation guides are [under `docs/guides` in this repository](https://github.com/ruby-amqp/bunny/tree/main/docs/guides):\n\n * [Queues and Consumers](https://github.com/ruby-amqp/bunny/tree/main/docs/guides/queues.md)\n * [Exchanges and Publishers](https://github.com/ruby-amqp/bunny/tree/main/docs/guides/exchanges.md)\n * [AMQP 0.9.1 Model Explained](http://www.rabbitmq.com/tutorials/amqp-concepts.html)\n * [Connecting to RabbitMQ](https://github.com/ruby-amqp/bunny/tree/main/docs/guides/connecting.md)\n * [Error Handling and Recovery](https://github.com/ruby-amqp/bunny/tree/main/docs/guides/error_handling.md)\n * [TLS/SSL Support](https://github.com/ruby-amqp/bunny/tree/main/docs/guides/tls.md)\n * [Bindings](https://github.com/ruby-amqp/bunny/tree/main/docs/guides/bindings.md)\n * [Using RabbitMQ Extensions with Bunny](https://github.com/ruby-amqp/bunny/tree/main/docs/guides/extensions.md)\n * [Durability and Related Matters](https://github.com/ruby-amqp/bunny/tree/main/docs/guides/durability.md)\n\nSome highly relevant RabbitMQ documentation guides:\n\n * [Connections](https://www.rabbitmq.com/docs/connections)\n * [Channels](https://www.rabbitmq.com/docs/channels)\n * [Queues](https://www.rabbitmq.com/docs/queues)\n * [Quorum queues](https://www.rabbitmq.com/docs/quorum-queues)\n * [Streams](https://rabbitmq.com/docs/streams) (Bunny can perform basic operations on streams even though it does not implement the [RabbitMQ Stream protocol](https://github.com/rabbitmq/rabbitmq-server/blob/v4.0.x/deps/rabbitmq_stream/docs/PROTOCOL.adoc))\n * [Publishers](https://www.rabbitmq.com/docs/publishers)\n * [Consumers](https://www.rabbitmq.com/docs/consumers)\n * Data safety: publisher and consumer [Confirmations](https://www.rabbitmq.com/docs/confirms)\n * [Production Checklist](https://www.rabbitmq.com/docs/production-checklist)\n\n### API Reference\n\n[Bunny API Reference](http://reference.rubybunny.info/).\n\n\n## Community and Getting Help\n\n### Mailing List\n\nPlease use [GitHub Discussions](https://github.com/ruby-amqp/bunny/discussions) for questions.\n\nGitHub issues should be used for specific, well understood, actionable\nmaintainers and contributors can work on.\n\nWe encourage you to keep an eye on [RabbitMQ Discussions](https://github.com/rabbitmq/rabbitmq-server/discussions),\njoin the [RabbitMQ mailing list](https://groups.google.com/forum/#!forum/rabbitmq-users)\nand the [RabbitMQ Discord server](https://rabbitmq.com/discord).\n\n\n### Reporting Issues\n\nIf you find a bug you understand well, poor default, incorrect or unclear piece of documentation,\nor missing feature, please [file an\nissue](http://github.com/ruby-amqp/bunny/issues) on GitHub.\n\nPlease use [Bunny's mailing list](http://groups.google.com/group/ruby-amqp) for questions,\ninvestigations, and discussions. GitHub issues should be used for specific, well understood, actionable\nmaintainers and contributors can work on.\n\nWhen filing an issue, please specify which Bunny and RabbitMQ versions you\nare using, provide recent RabbitMQ log file contents, full exception stack traces,\nand steps to reproduce (or failing test cases).\n\n\n## Other Ruby RabbitMQ Clients\n\nThe other widely used Ruby RabbitMQ client is [March Hare](http://rubymarchhare.info) (JRuby-only).\nIt's a mature library that require RabbitMQ 3.3.x or later.\n\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md) for more information\nabout running various test suites.\n\n\n## License\n\nReleased under the MIT license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fruby-amqp%2Fbunny","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fruby-amqp%2Fbunny","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fruby-amqp%2Fbunny/lists"}