Skip to content

feat: implement SendBatchAsync and integration tests for NetEvolve.Pulse.RabbitMQ#423

Open
Copilot wants to merge 1 commit intomainfrom
copilot/add-rabbitmq-outbox-transport
Open

feat: implement SendBatchAsync and integration tests for NetEvolve.Pulse.RabbitMQ#423
Copilot wants to merge 1 commit intomainfrom
copilot/add-rabbitmq-outbox-transport

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 17, 2026

The RabbitMQ transport (NetEvolve.Pulse.RabbitMQ) was missing a SendBatchAsync override, leaving it reliant on the default Parallel.ForEachAsync implementation — which causes concurrent access on a shared IChannel that is not thread-safe. Integration tests against a real broker were also absent.

Transport changes

  • RabbitMqMessageTransport: added SendBatchAsync override that acquires the channel once and publishes all messages sequentially on that single channel
  • Extracted private PublishAsync helper shared by both SendAsync and SendBatchAsync to eliminate duplication
services.AddPulse(c => c.UseRabbitMqTransport(options =>
{
    options.ExchangeName = "events";
}));

// SendBatchAsync now uses one channel, publishes sequentially — safe and efficient
await transport.SendBatchAsync(outboxMessages, ct);

Unit tests (NetEvolve.Pulse.Tests.Unit)

Added five tests for SendBatchAsync covering:

  • Null-argument guard
  • All messages published with correct properties
  • Single channel reused across the entire batch
  • Empty collection produces no publish calls
  • Channel reuse when mixed with prior SendAsync calls

Integration tests (NetEvolve.Pulse.Tests.Integration)

  • RabbitMqContainerFixture: manages a Testcontainers.RabbitMq container lifecycle per test session
  • RabbitMqMessageTransportIntegrationTests: verifies SendAsync, SendBatchAsync, and IsHealthyAsync (before first send → false; after first send with open connection → true) against a live broker

Copilot AI linked an issue Apr 17, 2026 that may be closed by this pull request
8 tasks
Copilot AI changed the title [WIP] Add RabbitMQ transport for outbox processor feat: implement SendBatchAsync and integration tests for NetEvolve.Pulse.RabbitMQ Apr 17, 2026
Copilot AI requested a review from samtrion April 17, 2026 17:52
@samtrion samtrion force-pushed the copilot/add-rabbitmq-outbox-transport branch from ec55d7e to 47ebc70 Compare April 18, 2026 10:52
@samtrion samtrion marked this pull request as ready for review April 18, 2026 10:52
@samtrion samtrion requested a review from a team as a code owner April 18, 2026 10:53
@samtrion samtrion force-pushed the copilot/add-rabbitmq-outbox-transport branch from 47ebc70 to 75000e6 Compare April 19, 2026 19:33
…itMQ transport

Agent-Logs-Url: https://github.com/dailydevops/pulse/sessions/3e8d71d0-5c05-4a68-91c3-639f8e6b0900

Co-authored-by: samtrion <3283596+samtrion@users.noreply.github.com>
@samtrion samtrion force-pushed the copilot/add-rabbitmq-outbox-transport branch from 75000e6 to 1c7b723 Compare April 20, 2026 09:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

2 participants