All Projects → naighes → Carrot

naighes / Carrot

Licence: MIT license
Carrot is a .NET lightweight library that provides a couple of facilities over RabbitMQ.

Programming Languages

C#
18002 projects
powershell
5483 projects

Projects that are alternatives of or similar to Carrot

cottontail
Capture all RabbitMQ messages being sent through a broker.
Stars: ✭ 23 (+64.29%)
Mutual labels:  rabbitmq, amqp
Enqueue Bundle
[READ-ONLY] Message queue bundle for Symfony. RabbitMQ, Amazon SQS, Redis, Service bus, Async events, RPC over MQ and a lot more
Stars: ✭ 233 (+1564.29%)
Mutual labels:  rabbitmq, amqp
Enqueue Dev
Message Queue, Job Queue, Broadcasting, WebSockets packages for PHP, Symfony, Laravel, Magento. DEVELOPMENT REPOSITORY - provided by Forma-Pro
Stars: ✭ 1,977 (+14021.43%)
Mutual labels:  rabbitmq, amqp
Spring Boot Amqp Messaging
This is a simple spring-boot app that shows how to configure easily RabbitMQ with AMQP for producing and consuming messages in default format and JSON.
Stars: ✭ 142 (+914.29%)
Mutual labels:  rabbitmq, amqp
nestjs-rmq
A custom library for NestJS microservice. It allows you to use RabbitMQ or AMQP.
Stars: ✭ 182 (+1200%)
Mutual labels:  rabbitmq, amqp
Gen rmq
Elixir AMQP consumer and publisher behaviours
Stars: ✭ 146 (+942.86%)
Mutual labels:  rabbitmq, amqp
Rabtap
RabbitMQ wire tap and swiss army knife
Stars: ✭ 171 (+1121.43%)
Mutual labels:  rabbitmq, amqp
Amqpstorm
Thread-safe Python RabbitMQ Client & Management library
Stars: ✭ 130 (+828.57%)
Mutual labels:  rabbitmq, amqp
tomodachi
💻 Microservice library / framework using Python's asyncio event loop with full support for HTTP + WebSockets, AWS SNS+SQS, RabbitMQ / AMQP, middleware, etc. Extendable for GraphQL, protobuf, gRPC, among other technologies.
Stars: ✭ 170 (+1114.29%)
Mutual labels:  rabbitmq, amqp
roger-rabbit
A module that makes the process of consuming and publishing messages in message brokers easier
Stars: ✭ 12 (-14.29%)
Mutual labels:  rabbitmq, amqp
Rabbitmq Dump Queue
Dump messages from a RabbitMQ queue to files, without affecting the queue.
Stars: ✭ 139 (+892.86%)
Mutual labels:  rabbitmq, amqp
nest-rabbit-tasks
nest-rabbit-worker is a TaskQueue based upon RabbitMQ for NestJS
Stars: ✭ 29 (+107.14%)
Mutual labels:  rabbitmq, amqp
Dotnetlabs
.NET Labs -- Show Me the Tips and Tricks and Code
Stars: ✭ 135 (+864.29%)
Mutual labels:  rabbitmq, dotnetcore
Garagemq
AMQP message broker implemented with golang
Stars: ✭ 153 (+992.86%)
Mutual labels:  rabbitmq, amqp
Eventflow.example
DDD+CQRS+Event-sourcing examples using EventFlow following CQRS-ES architecture. It is configured with RabbitMQ, MongoDB(Snapshot store), PostgreSQL(Read store), EventStore(GES). It's targeted to .Net Core 2.2 and include docker compose file.
Stars: ✭ 131 (+835.71%)
Mutual labels:  rabbitmq, dotnetcore
Cony
Simple AMQP wrapper around github.com/streadway/amqp
Stars: ✭ 158 (+1028.57%)
Mutual labels:  rabbitmq, amqp
Amqproxy
An intelligent AMQP proxy, with connection and channel pooling/reusing
Stars: ✭ 115 (+721.43%)
Mutual labels:  rabbitmq, amqp
Bitnami Docker Rabbitmq
Bitnami Docker Image for RabbitMQ
Stars: ✭ 120 (+757.14%)
Mutual labels:  rabbitmq, amqp
rejected
rejected is a consumer framework for RabbitMQ
Stars: ✭ 56 (+300%)
Mutual labels:  rabbitmq, amqp
postman
Reverse proxy for async microservice communication
Stars: ✭ 30 (+114.29%)
Mutual labels:  rabbitmq, amqp

Carrot

Carrot is a .NET lightweight library that provides a couple of facilities over RabbitMQ.

install from nugetdownloads

What is it?

Prompted 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. Inspired by MassTransit.

Getting started

Just mark your POCO message contracts with MessageBinding attribute:

[MessageBinding("urn:message:foo")]
public class Foo
{
    public Int32 Bar { get; set; }
}

Define your message consumer:

class FooConsumer : Consumer<Foo>
{
    public override Task ConsumeAsync(ConsumingContext<Foo> context)
    {
        return Task.Factory.StartNew(() =>
                                     {
                                         Console.WriteLine("received '{0}'",
                                                           context.Message.Headers.MessageId);
                                     });
    }
}

Create an instance of Broker providing the RabbitMQ host as input.

var broker = Broker.New(_ =>
                        {
                            _.Endpoint(new Uri("amqp://guest:guest@localhost:5672/", UriKind.Absolute));
                            _.ResolveMessageTypeBy(new MessageBindingResolver(typeof(Foo).GetTypeInfo().Assembly));
                        });

Declare your AMQP entities as the following:

var exchange = broker.DeclareDirectExchange("source_exchange");
var queue = broker.DeclareQueue("my_test_queue");

Bind entities, subscribe your queue and call IBroker.Connect:

broker.DeclareExchangeBinding(exchange, queue, "routing_key");
broker.SubscribeByAtLeastOnce(queue, _ => _.Consumes(new FooConsumer()));
var connection = broker.Connect();

You're up 'n running! Do not forget to call IConnection.Dispose() when your application exits.

Please note that exchanges, queues and messages are not durable by default. You can create durable entities by calling the proper builder methods.

var durableExchange = broker.DeclareDurableDirectExchange("source_exchange");
var durableQueue = broker.DeclareDurableQueue("my_test_queue");

You can publish messages as the following:

connection.PublishAsync(new OutboundMessage<Foo>(new Foo { Bar = 2 }),
                        exchange);

Please note that messages are not durable by default. If you need durable messaging, make use of DurableOutboundMessage<T>:

connection.PublishAsync(new DurableOutboundMessage<Foo>(new Foo { Bar = 2 }),
                        exchange);

To activate publisher confirms, configure a reliable outbound channel when creating the broker:

var broker = Broker.New(_ =>
                        {
                            _.Endpoint(new Uri("amqp://guest:guest@localhost:5672/", UriKind.Absolute));
                            _.ResolveMessageTypeBy(new MessageBindingResolver(typeof(Foo).GetTypeInfo().Assembly));
                            _.PublishBy(OutboundChannel.Reliable());
                        });

Building from Source

Clone the source down to your machine.

git clone https://github.com/naighes/Carrot.git

Run .\build.ps1

Resources

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].