Skip to content

feat: RabbitMQ outbox transport (NetEvolve.Pulse.RabbitMQ) #123

@samtrion

Description

@samtrion

User Story

As a developer using RabbitMQ as a message broker, I want a native RabbitMQ transport for the outbox processor, so that I can deliver outbox messages to RabbitMQ exchanges without routing them through Dapr.


Background

RabbitMQ is a widely adopted on-premise and cloud-agnostic message broker. Teams using RabbitMQ directly (without Dapr) need a first-class transport integration that uses the official .NET client.


Requirements

  • Provide a new NuGet package NetEvolve.Pulse.RabbitMQ targeting net8.0, net9.0, net10.0.
  • Implement RabbitMqMessageTransport : IMessageTransport using RabbitMQ.Client (v7+, async API).
  • Support the following capabilities:
    • SendAsync — publishes a single message to a preconfigured exchange with a routing key.
    • SendBatchAsync — publishes multiple messages in a single channel write.
    • IsHealthyAsync — verifies the connection/channel is open and the broker is reachable.
  • Configurable via RabbitMqTransportOptions:
    • HostName, Port, VirtualHost, UserName, Password.
    • ExchangeName — target exchange.
    • RoutingKey — default routing key (can be overridden per event type via a resolver delegate).
  • Expose registration via IMediatorConfigurator:
    services.AddPulse(c => c.UseRabbitMqTransport(options => { ... }));
  • The package must reference RabbitMQ.Client and NetEvolve.Pulse.Extensibility.

Acceptance Criteria

  • NetEvolve.Pulse.RabbitMQ package builds on all three target frameworks.
  • SendAsync publishes a correctly serialized message to the configured exchange.
  • SendBatchAsync publishes all messages without opening multiple connections.
  • IsHealthyAsync returns false without throwing when the broker is unreachable.
  • Connection/channel lifecycle is managed correctly (reconnect on failure is out of scope but the transport must not crash on disconnect).
  • Unit tests cover SendAsync, SendBatchAsync, and IsHealthyAsync (healthy and unhealthy states).
  • Integration tests use Testcontainers.RabbitMq to verify publishing behavior against a real broker.
  • XML documentation is provided for all public members.

Out of Scope

  • Message consumption/subscription.
  • Exchange or queue auto-declaration.
  • Connection pooling or reconnection policies (recommended to combine with Polly).
  • AMQP 1.0 support.

Metadata

Metadata

Labels

type:featureIndicates a new feature or enhancement to be added.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions