{"id":34246539,"url":"https://github.com/naighes/carrot","last_synced_at":"2026-03-11T21:02:13.230Z","repository":{"id":2789794,"uuid":"44656370","full_name":"naighes/Carrot","owner":"naighes","description":"Carrot is a .NET lightweight library that provides a couple of facilities over RabbitMQ.","archived":false,"fork":false,"pushed_at":"2022-12-07T18:36:58.000Z","size":980,"stargazers_count":13,"open_issues_count":3,"forks_count":9,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-12-19T14:59:19.837Z","etag":null,"topics":["amqp","csharp","dotnet","dotnetcore","rabbitmq"],"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/naighes.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-10-21T06:14:58.000Z","updated_at":"2024-12-02T23:33:17.000Z","dependencies_parsed_at":"2023-01-11T16:12:30.665Z","dependency_job_id":null,"html_url":"https://github.com/naighes/Carrot","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/naighes/Carrot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/naighes%2FCarrot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/naighes%2FCarrot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/naighes%2FCarrot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/naighes%2FCarrot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/naighes","download_url":"https://codeload.github.com/naighes/Carrot/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/naighes%2FCarrot/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30400656,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-11T18:46:22.935Z","status":"ssl_error","status_checked_at":"2026-03-11T18:46:17.045Z","response_time":84,"last_error":"SSL_read: 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":["amqp","csharp","dotnet","dotnetcore","rabbitmq"],"created_at":"2025-12-16T07:10:05.181Z","updated_at":"2026-03-11T21:02:13.225Z","avatar_url":"https://github.com/naighes.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Carrot\n\nCarrot is a .NET lightweight library that provides a couple of facilities over RabbitMQ.\n\n[![install from nuget](https://img.shields.io/nuget/v/Carrot.svg?style=flat-square)](https://www.nuget.org/packages/Carrot)[![downloads](http://img.shields.io/nuget/dt/Carrot.svg?style=flat-square)](https://www.nuget.org/packages/Carrot)\n\n## What is it? ##\n\nPrompted by the need for an easy-to-use RabbitMQ access component not requiring lots of boilerplate code in order to accomplish basic operations with RabbitMQ broker.\nInspired by [MassTransit](https://github.com/MassTransit/MassTransit \"MassTransit\").\n\n## Getting started ##\n\nJust mark your POCO message contracts with `MessageBinding` attribute:\n\n```csharp\n[MessageBinding(\"urn:message:foo\")]\npublic class Foo\n{\n    public Int32 Bar { get; set; }\n}\n```\n\nDefine your message consumer:\n\n```csharp\nclass FooConsumer : Consumer\u003cFoo\u003e\n{\n    public override Task ConsumeAsync(ConsumingContext\u003cFoo\u003e context)\n    {\n        return Task.Factory.StartNew(() =\u003e\n                                     {\n                                         Console.WriteLine(\"received '{0}'\",\n                                                           context.Message.Headers.MessageId);\n                                     });\n    }\n}\n```\n\nCreate an instance of `Broker` providing the RabbitMQ host as input.\n\n```csharp\nvar broker = Broker.New(_ =\u003e\n                        {\n                            _.Endpoint(new Uri(\"amqp://guest:guest@localhost:5672/\", UriKind.Absolute));\n                            _.ResolveMessageTypeBy(new MessageBindingResolver(typeof(Foo).GetTypeInfo().Assembly));\n                        });\n```\n\nDeclare your AMQP entities as the following:\n\n```csharp\nvar exchange = broker.DeclareDirectExchange(\"source_exchange\");\nvar queue = broker.DeclareQueue(\"my_test_queue\");\n```\n\nBind entities, subscribe your queue and call `IBroker.Connect`:\n\n```csharp\nbroker.DeclareExchangeBinding(exchange, queue, \"routing_key\");\nbroker.SubscribeByAtLeastOnce(queue, _ =\u003e _.Consumes(new FooConsumer()));\nvar connection = broker.Connect();\n```\n\nYou're up 'n running!\nDo not forget to call `IConnection.Dispose()` when your application exits.\n\nPlease note that exchanges, queues and messages are not durable by default.\nYou can create durable entities by calling the proper builder methods.\n\n```csharp\nvar durableExchange = broker.DeclareDurableDirectExchange(\"source_exchange\");\nvar durableQueue = broker.DeclareDurableQueue(\"my_test_queue\");\n```\n\nYou can publish messages as the following:\n\n```csharp\nconnection.PublishAsync(new OutboundMessage\u003cFoo\u003e(new Foo { Bar = 2 }),\n                        exchange);\n```\n\nPlease note that messages are not durable by default.\nIf you need durable messaging, make use of `DurableOutboundMessage\u003cT\u003e`:\n\n```csharp\nconnection.PublishAsync(new DurableOutboundMessage\u003cFoo\u003e(new Foo { Bar = 2 }),\n                        exchange);\n```\n\nTo activate publisher confirms, configure a reliable outbound channel when creating the broker:\n\n```csharp\nvar broker = Broker.New(_ =\u003e\n                        {\n                            _.Endpoint(new Uri(\"amqp://guest:guest@localhost:5672/\", UriKind.Absolute));\n                            _.ResolveMessageTypeBy(new MessageBindingResolver(typeof(Foo).GetTypeInfo().Assembly));\n                            _.PublishBy(OutboundChannel.Reliable());\n                        });\n```\n\n## Building from Source ##\n\nClone the source down to your machine.\n\n```sh\ngit clone https://github.com/naighes/Carrot.git\n```\n\nRun `.\\build.ps1`\n\n## Resources ##\n\n- Carrot can be installed from [NuGet](https://www.nuget.org/packages/Carrot \"Carrot\")\n- Find more information in the [wiki](https://github.com/naighes/Carrot/wiki \"Carrot wiki\")\n- Follow [@nicolabaldi on Twitter](https://twitter.com/nicolabaldi \"@nicolabaldi\") for updates\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnaighes%2Fcarrot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnaighes%2Fcarrot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnaighes%2Fcarrot/lists"}