{"id":29890008,"url":"https://github.com/aoxetech/aoxe.rabbitmq","last_synced_at":"2025-07-31T22:23:21.355Z","repository":{"id":56304583,"uuid":"135975576","full_name":"AoxeTech/Aoxe.RabbitMQ","owner":"AoxeTech","description":"Message bus base by RabbitMQ for dotnet standard 2.0","archived":false,"fork":false,"pushed_at":"2024-11-18T12:42:39.000Z","size":412,"stargazers_count":8,"open_issues_count":0,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-29T10:42:36.134Z","etag":null,"topics":["message","messagebus","messagequeue","queue","rabbitmq","zaabee"],"latest_commit_sha":null,"homepage":"","language":"C#","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/AoxeTech.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,"zenodo":null}},"created_at":"2018-06-04T05:39:20.000Z","updated_at":"2025-04-18T07:05:48.000Z","dependencies_parsed_at":"2023-12-26T08:40:20.133Z","dependency_job_id":"b6e7a3c0-57fa-4e57-b831-dd8370806735","html_url":"https://github.com/AoxeTech/Aoxe.RabbitMQ","commit_stats":{"total_commits":293,"total_committers":3,"mean_commits":97.66666666666667,"dds":"0.40614334470989766","last_synced_commit":"f87997f24960f305c95a18f3bdc58cff89df08cd"},"previous_names":["mutuduxf/zaabee.rabbitmq","picohex/zaabee.amqp","picohex/zaabee.rabbitmq"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/AoxeTech/Aoxe.RabbitMQ","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AoxeTech%2FAoxe.RabbitMQ","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AoxeTech%2FAoxe.RabbitMQ/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AoxeTech%2FAoxe.RabbitMQ/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AoxeTech%2FAoxe.RabbitMQ/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AoxeTech","download_url":"https://codeload.github.com/AoxeTech/Aoxe.RabbitMQ/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AoxeTech%2FAoxe.RabbitMQ/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268126583,"owners_count":24200290,"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","status":"online","status_checked_at":"2025-07-31T02:00:08.723Z","response_time":66,"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":["message","messagebus","messagequeue","queue","rabbitmq","zaabee"],"created_at":"2025-07-31T22:23:16.094Z","updated_at":"2025-07-31T22:23:21.343Z","avatar_url":"https://github.com/AoxeTech.png","language":"C#","readme":"# Aoxe.RabbitMQ\n\n[RabbitMQ](http://www.rabbitmq.com/) is the most widely deployed open source message broker.\n\nWith more than 35,000 production deployments of RabbitMQ world-wide at small startups and large enterprises, RabbitMQ is the most popular open source message broker.\n\nRabbitMQ is lightweight and easy to deploy on premises and in the cloud. It supports multiple messaging protocols. RabbitMQ can be deployed in distributed and federated configurations to meet high-scale, high-availability requirements ([GitHub](https://github.com/rabbitmq/rabbitmq-server)).\n\n## QuickStart\n\n### NuGet\n\n```CLI\nInstall-Package Aoxe.RabbitMQ\nInstall-Package Aoxe.NewtonsoftJson\n```\n\nIn addition we have the following json serializers:\n\n[Aoxe.Jil](https://github.com/AoxeTech/Aoxe.Serialization/tree/master/src/Aoxe.MsgPack)\n\n[Aoxe.SystemTextJson](https://github.com/AoxeTech/Aoxe.Serialization/tree/master/src/Aoxe.SystemTextJson)\n\n[Aoxe.Utf8Json](https://github.com/AoxeTech/Aoxe.Serialization/tree/master/src/Aoxe.Utf8Json)\n\n### Asp.net core\n\nImport reference in startup.cs\n\n```CSharp\nusing Aoxe.RabbitMQ;\nusing Aoxe.RabbitMQ.Abstractions;\nusing Aoxe.NewtonsoftJson;\n```\n\nRegister AoxeRabbitMqClient in ConfigureServices method\n\n```CSharp\nservices.AddSingleton\u003cIAoxeRabbitMqClient\u003e(_ =\u003e\n    new AoxeRabbitMqClient(new AoxeRabbitMqOptions\n    {\n        AutomaticRecoveryEnabled = true,\n        Hosts = new List\u003cstring\u003e { `192.168.78.130` },\n        UserName = `admin`,\n        Password = `123`,\n        Serializer = new NewtonsoftJson.Serializer()\n    }));\n```\n\nCreate a message class named `TestEvent` and version control it with the `MessageVersion` attribute.\n\n```CSharp\npublic class TestEvent\n{\n    public Guid Id { get; set; }\n    public DateTime CreateTime { get; set; }\n}\n```\n\n```csharp\n[MessageVersion(`3.14`)]\npublic class TestEventWithVersion\n{\n    public Guid Id { get; set; }\n    public DateTime CreateTime { get; set; }\n}\n```\n\n### Publish\n\nIn Aoxe.RabbitMQ we distinguish the different publishing methods by message type and message sending type as follows:\n\n```csharp\nvoid PublishEvent\u003cT\u003e(T @event);\nvoid PublishEvent\u003cT\u003e(string topic, T @event);\nvoid PublishEvent(string topic, byte[] body);\n\nvoid SendCommand\u003cT\u003e(T command);\nvoid SendCommand(string topic, T command);\nvoid SendCommand(string topic, byte[] body);\n\nvoid PublishMessage\u003cT\u003e(T message);\nvoid PublishMessage\u003cT\u003e(string topic, T message);\nvoid PublishMessage(string topic, byte[] body);\n```\n\nThere are two concepts here, `message type` and `message sending type`：\n\n- Message type\n  - Message: The `Message` type will not be persisted for throughput and performance purposes, and messages will not be transferred to the dead message queue in the event of a consumption exception. The message's exchange is also Durable to false, so the exchange will be lost after the broker restarts.\n  - Event: Messages of event type will be persisted and will be transferred to the corresponding dead message queue in case of consumption exceptions. The Durable of event's exchange is true, so that it is not lost when the broker restarts.\n  - Command: An `Event` represents something that has already happened, and the publisher does not care whether or not any consumer cares about the event, or what it does with the event. A `command` represents a message that the publisher expects a consumer to process. So `PublishEvent` just posts the event to the exchange, and doesn't create a queue; send command creates a queue with the same name as the exchange / topic, and expects someone to handle it.\n- Message sending type\n  - Publish: The message will be posted to the corresponding Topic (which is actually the wrapper for the exchange in RabbitMQ), and if there is no queue binding to the exchange, the message will be discarded.\n  - Send: When messages are sent to RabbitMQ, a default queue is created in addition to the corresponding exchange (if there is none), and the exchange and queue will be named after the topic.\n\n### Subscribe\n\nAs with publish, there are several different methods of subscribing:\n\n```csharp\nvoid SubscribeEvent\u003cT\u003e(Func\u003cAction\u003cT?\u003e\u003e resolve, ushort prefetchCount = 10, int consumeRetry = Consts.DefaultConsumeRetry, bool dlx = true);\nvoid SubscribeEvent\u003cT\u003e(Func\u003cFunc\u003cT?, Task\u003e\u003e resolve, ushort prefetchCount = 10, int consumeRetry = Consts.DefaultConsumeRetry, bool dlx = true);\nvoid SubscribeEvent\u003cT\u003e(string topic, Func\u003cAction\u003cT?\u003e\u003e resolve, ushort prefetchCount = 10, int consumeRetry = Consts.DefaultConsumeRetry, bool dlx = true);\nvoid SubscribeEvent\u003cT\u003e(string topic, Func\u003cFunc\u003cT?, Task\u003e\u003e resolve, ushort prefetchCount = 10, int consumeRetry = Consts.DefaultConsumeRetry, bool dlx = true);\n\nvoid ReceiveCommand\u003cT\u003e(Func\u003cAction\u003cT?\u003e\u003e resolve, ushort prefetchCount = 10);\nvoid ReceiveCommand\u003cT\u003e(Func\u003cFunc\u003cT?, Task\u003e\u003e resolve, ushort prefetchCount = 10);\nvoid ReceiveCommand\u003cT\u003e(string topic, Func\u003cAction\u003cT?\u003e\u003e resolve, ushort prefetchCount = 10);\nvoid ReceiveCommand\u003cT\u003e(string topic, Func\u003cFunc\u003cT?, Task\u003e\u003e resolve, ushort prefetchCount = 10);\n\nvoid ListenMessage\u003cT\u003e(Func\u003cAction\u003cT?\u003e\u003e resolve, ushort prefetchCount = 10);\nvoid ListenMessage\u003cT\u003e(Func\u003cFunc\u003cT?, Task\u003e\u003e resolve, ushort prefetchCount = 10);\nvoid ListenMessage\u003cT\u003e(string topic, Func\u003cAction\u003cT?\u003e\u003e resolve, ushort prefetchCount = 10);\nvoid ListenMessage\u003cT\u003e(string topic, Func\u003cFunc\u003cT?, Task\u003e\u003e resolve, ushort prefetchCount = 10);\n```\n\n- Subscribe: Will automatically create (if not already) a queue named by resolve to bind to the exchange and consume it. And it can set the consume retry count, if it still process fail, the `event` will be sent to the dlx queue.\n- Receive: As opposed to `Send`, will consume messages from the queue created by send.\n- Listen: We know that multiple nodes subscribe / receive to the same queue, the messages in this queue will be pushed to these nodes to achieve a balanced load, that is, a single message will only be consumed by a single node in the cluster; while `Listen` allows a single node to have an independent exclusive queue, and automatically delete this queue when the connection is disconnected, usually used in scenarios where all nodes need to be notified.\n\nAlso these methods corresponding asynchronous versions too.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faoxetech%2Faoxe.rabbitmq","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faoxetech%2Faoxe.rabbitmq","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faoxetech%2Faoxe.rabbitmq/lists"}