Skip to content

Conversation

@gimlichael
Copy link
Member

@gimlichael gimlichael commented Jun 7, 2025

This pull request introduces RabbitMQ support to the project by adding new implementations for a command queue and an event bus, along with the necessary configuration options. It also includes updates to package dependencies and solution files to accommodate the new functionality.

RabbitMQ Integration:

  • Added RabbitMqCommandQueue class to implement a point-to-point command queue using RabbitMQ. This includes methods for sending and receiving command messages asynchronously. (src/Savvyio.Extensions.RabbitMQ/Commands/RabbitMqCommandQueue.cs)
  • Added RabbitMqEventBus class to implement a publish-subscribe event bus for integration events using RabbitMQ. This includes methods for publishing and subscribing to integration events. (src/Savvyio.Extensions.RabbitMQ/EventDriven/RabbitMqEventBus.cs)

Configuration Options:

  • Added RabbitMqCommandQueueOptions class for configuring RabbitMqCommandQueue with properties such as QueueName and AutoAcknowledge. (src/Savvyio.Extensions.RabbitMQ/Commands/RabbitMqCommandQueueOptions.cs)
  • Added RabbitMqEventBusOptions class for configuring RabbitMqEventBus with properties such as ExchangeName. (src/Savvyio.Extensions.RabbitMQ/EventDriven/RabbitMqEventBusOptions.cs)

Solution and Dependency Updates:

  • Updated Directory.Packages.props to include new versions of dependencies and add RabbitMQ.Client version 7.1.2. (Directory.Packages.props) [1] [2]
  • Updated Savvyio.sln to include new projects for Savvyio.Extensions.RabbitMQ and its functional tests. (Savvyio.sln) [1] [2] [3]

Summary by CodeRabbit

  • New Features

    • Introduced RabbitMQ integration supporting work queue and publish-subscribe messaging patterns.
    • Added configurable RabbitMQ command queue and event bus with options for connectivity, queue, and exchange settings.
    • Provided asynchronous message sending, receiving, publishing, and subscribing capabilities with message serialization and signing support.
    • Added dependency injection extensions for easy registration of RabbitMQ services.
  • Tests

    • Added extensive functional tests covering RabbitMQ command queue and event bus scenarios with JSON and Newtonsoft.Json serialization, including message signing and concurrency.
  • Chores

    • Upgraded package dependencies and added RabbitMQ client library.
    • Added new projects for RabbitMQ integration, dependency injection, and functional testing to the solution.
    • Updated CI workflows to include RabbitMQ integration tests using Docker.

@gimlichael gimlichael self-assigned this Jun 7, 2025
@coderabbitai
Copy link

coderabbitai bot commented Jun 7, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

This update introduces a new RabbitMQ integration for the Savvyio framework, adding both source and functional test projects. It implements point-to-point command queues and publish-subscribe event bus patterns using RabbitMQ, with configurable options and marshaller support. Comprehensive functional tests validate serialization, signing, and concurrent message handling.

Changes

File(s) / Group Change Summary
Directory.Packages.props Updated package versions for AWS SDKs, test frameworks, and added RabbitMQ.Client package.
Savvyio.sln Added Savvyio.Extensions.RabbitMQ and related test projects to the solution and nested them appropriately.
src/Savvyio.Extensions.RabbitMQ/... Added RabbitMqMessage base class, RabbitMqCommandQueue and RabbitMqEventBus with their options classes, implementing RabbitMQ messaging patterns.
src/Savvyio.Extensions.RabbitMQ/Savvyio.Extensions.RabbitMQ.csproj New project file for RabbitMQ extension, with dependencies and metadata.
src/Savvyio.Extensions.DependencyInjection.RabbitMQ/... Added generic RabbitMqCommandQueue and RabbitMqEventBus with options and dependency injection service registration extensions.
src/Savvyio.Extensions.DependencyInjection.RabbitMQ/Savvyio.Extensions.DependencyInjection.RabbitMQ.csproj New project file for DI RabbitMQ extension referencing core RabbitMQ extension and DI base.
src/Savvyio.Extensions.DependencyInjection.RabbitMQ/ServiceCollectionExtensions.cs Added IServiceCollection extension methods to register RabbitMQ command queue and event bus services with optional configuration.
test/Savvyio.Extensions.RabbitMQ.FunctionalTests/Assets/... Added internal records CreateMemberCommand and MemberCreated for test message payloads.
test/Savvyio.Extensions.RabbitMQ.FunctionalTests/Commands/... Added functional tests for RabbitMQ command queue with JSON and Newtonsoft JSON serialization, including single and batch message tests.
test/Savvyio.Extensions.RabbitMQ.FunctionalTests/EventDriven/... Added functional tests for RabbitMQ event bus with JSON and Newtonsoft JSON serialization, testing publish-subscribe, signing, CloudEvents, and batch scenarios.
test/Savvyio.Extensions.RabbitMQ.FunctionalTests/Savvyio.Extensions.RabbitMQ.FunctionalTests.csproj New functional test project file with necessary references and packages.
test/Savvyio.Extensions.DependencyInjection.RabbitMQ.Tests/... Added marker structs and tests verifying DI service registrations for RabbitMQ command queue and event bus with and without markers.
test/Savvyio.Extensions.RabbitMQ.Tests/... Added unit tests for RabbitMQ options classes validating defaults and validation logic.
.github/workflows/pipelines.yml Added integration test job for RabbitMQ functional tests using Docker RabbitMQ container; updated reusable workflows to v2 and dotnet-test to v4.
.nuget/* Added new version 4.1.0 release notes and updated README.md files across many Savvyio packages to include references to RabbitMQ extensions.
CHANGELOG.md Added version 4.1.0 entry documenting RabbitMQ support with command queue and event bus implementations, options, DI extensions, and dependency upgrades.
src/Savvyio.App/Savvyio.App.csproj Updated project references and metadata to include RabbitMQ extensions and related tags.

Sequence Diagram(s)

Command Queue: Send and Receive Flow

sequenceDiagram
    participant Producer as Command Sender
    participant RabbitMqCommandQueue
    participant RabbitMQ as RabbitMQ Broker
    participant Consumer as Command Receiver

    Producer->>RabbitMqCommandQueue: SendAsync(commands)
    RabbitMqCommandQueue->>RabbitMQ: Publish messages to queue

    Consumer->>RabbitMqCommandQueue: ReceiveAsync()
    RabbitMqCommandQueue->>RabbitMQ: Consume messages from queue
    RabbitMqCommandQueue-->>Consumer: Yield deserialized messages
    Consumer->>RabbitMqCommandQueue: Acknowledge (if enabled)
Loading

Event Bus: Publish and Subscribe Flow

sequenceDiagram
    participant Publisher as Event Publisher
    participant RabbitMqEventBus
    participant RabbitMQ as RabbitMQ Broker
    participant Subscriber as Event Subscriber

    Publisher->>RabbitMqEventBus: PublishAsync(event)
    RabbitMqEventBus->>RabbitMQ: Publish message to fanout exchange

    Subscriber->>RabbitMqEventBus: SubscribeAsync(handler)
    RabbitMqEventBus->>RabbitMQ: Bind temporary queue to exchange
    RabbitMQ-->>RabbitMqEventBus: Deliver messages to queue
    RabbitMqEventBus-->>Subscriber: Invoke handler with deserialized message
Loading

Possibly related PRs

  • V4.1.0/support for rabbitmq #35: Introduces core RabbitMQ support features including RabbitMqCommandQueue, RabbitMqEventBus, their options classes, and solution/project file updates, directly related to this PR.

Poem

In the warren of code, a new path appears,
With queues and events, the RabbitMQ cheers!
Commands hop swiftly, events leap in delight,
JSON and signatures, all handled just right.
Tests multiply like bunnies—robust and profound—
In this Savvyio meadow, new features abound!
🐇✨


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 312659f and 0c131fd.

⛔ Files ignored due to path filters (2)
  • .nuget/Savvyio.Extensions.DependencyInjection.RabbitMQ/icon.png is excluded by !**/*.png
  • .nuget/Savvyio.Extensions.RabbitMQ/icon.png is excluded by !**/*.png
📒 Files selected for processing (85)
  • .github/workflows/pipelines.yml (6 hunks)
  • .nuget/Savvyio.App/PackageReleaseNotes.txt (1 hunks)
  • .nuget/Savvyio.App/README.md (1 hunks)
  • .nuget/Savvyio.Commands.Messaging/PackageReleaseNotes.txt (1 hunks)
  • .nuget/Savvyio.Commands.Messaging/README.md (1 hunks)
  • .nuget/Savvyio.Commands/PackageReleaseNotes.txt (1 hunks)
  • .nuget/Savvyio.Commands/README.md (1 hunks)
  • .nuget/Savvyio.Core/PackageReleaseNotes.txt (1 hunks)
  • .nuget/Savvyio.Core/README.md (1 hunks)
  • .nuget/Savvyio.Domain.EventSourcing/PackageReleaseNotes.txt (1 hunks)
  • .nuget/Savvyio.Domain.EventSourcing/README.md (2 hunks)
  • .nuget/Savvyio.Domain/PackageReleaseNotes.txt (1 hunks)
  • .nuget/Savvyio.Domain/README.md (1 hunks)
  • .nuget/Savvyio.EventDriven.Messaging/PackageReleaseNotes.txt (1 hunks)
  • .nuget/Savvyio.EventDriven.Messaging/README.md (1 hunks)
  • .nuget/Savvyio.EventDriven/PackageReleaseNotes.txt (1 hunks)
  • .nuget/Savvyio.EventDriven/README.md (1 hunks)
  • .nuget/Savvyio.Extensions.Dapper/PackageReleaseNotes.txt (1 hunks)
  • .nuget/Savvyio.Extensions.Dapper/README.md (1 hunks)
  • .nuget/Savvyio.Extensions.DapperExtensions/PackageReleaseNotes.txt (1 hunks)
  • .nuget/Savvyio.Extensions.DapperExtensions/README.md (1 hunks)
  • .nuget/Savvyio.Extensions.DependencyInjection.Dapper/PackageReleaseNotes.txt (1 hunks)
  • .nuget/Savvyio.Extensions.DependencyInjection.Dapper/README.md (1 hunks)
  • .nuget/Savvyio.Extensions.DependencyInjection.DapperExtensions/PackageReleaseNotes.txt (1 hunks)
  • .nuget/Savvyio.Extensions.DependencyInjection.DapperExtensions/README.md (1 hunks)
  • .nuget/Savvyio.Extensions.DependencyInjection.Domain/PackageReleaseNotes.txt (1 hunks)
  • .nuget/Savvyio.Extensions.DependencyInjection.Domain/README.md (1 hunks)
  • .nuget/Savvyio.Extensions.DependencyInjection.EFCore.Domain.EventSourcing/PackageReleaseNotes.txt (1 hunks)
  • .nuget/Savvyio.Extensions.DependencyInjection.EFCore.Domain.EventSourcing/README.md (1 hunks)
  • .nuget/Savvyio.Extensions.DependencyInjection.EFCore.Domain/PackageReleaseNotes.txt (1 hunks)
  • .nuget/Savvyio.Extensions.DependencyInjection.EFCore.Domain/README.md (1 hunks)
  • .nuget/Savvyio.Extensions.DependencyInjection.EFCore/PackageReleaseNotes.txt (1 hunks)
  • .nuget/Savvyio.Extensions.DependencyInjection.EFCore/README.md (1 hunks)
  • .nuget/Savvyio.Extensions.DependencyInjection.QueueStorage/PackageReleaseNotes.txt (1 hunks)
  • .nuget/Savvyio.Extensions.DependencyInjection.QueueStorage/README.md (1 hunks)
  • .nuget/Savvyio.Extensions.DependencyInjection.RabbitMQ/PackageReleaseNotes.txt (1 hunks)
  • .nuget/Savvyio.Extensions.DependencyInjection.RabbitMQ/README.md (1 hunks)
  • .nuget/Savvyio.Extensions.DependencyInjection.SimpleQueueService/PackageReleaseNotes.txt (1 hunks)
  • .nuget/Savvyio.Extensions.DependencyInjection.SimpleQueueService/README.md (1 hunks)
  • .nuget/Savvyio.Extensions.DependencyInjection/PackageReleaseNotes.txt (1 hunks)
  • .nuget/Savvyio.Extensions.DependencyInjection/README.md (1 hunks)
  • .nuget/Savvyio.Extensions.Dispatchers/PackageReleaseNotes.txt (1 hunks)
  • .nuget/Savvyio.Extensions.Dispatchers/README.md (1 hunks)
  • .nuget/Savvyio.Extensions.EFCore.Domain.EventSourcing/PackageReleaseNotes.txt (1 hunks)
  • .nuget/Savvyio.Extensions.EFCore.Domain.EventSourcing/README.md (1 hunks)
  • .nuget/Savvyio.Extensions.EFCore.Domain/PackageReleaseNotes.txt (1 hunks)
  • .nuget/Savvyio.Extensions.EFCore.Domain/README.md (1 hunks)
  • .nuget/Savvyio.Extensions.EFCore/PackageReleaseNotes.txt (1 hunks)
  • .nuget/Savvyio.Extensions.EFCore/README.md (1 hunks)
  • .nuget/Savvyio.Extensions.Newtonsoft.Json/PackageReleaseNotes.txt (1 hunks)
  • .nuget/Savvyio.Extensions.Newtonsoft.Json/README.md (1 hunks)
  • .nuget/Savvyio.Extensions.QueueStorage/PackageReleaseNotes.txt (1 hunks)
  • .nuget/Savvyio.Extensions.QueueStorage/README.md (1 hunks)
  • .nuget/Savvyio.Extensions.RabbitMQ/PackageReleaseNotes.txt (1 hunks)
  • .nuget/Savvyio.Extensions.RabbitMQ/README.md (1 hunks)
  • .nuget/Savvyio.Extensions.SimpleQueueService/PackageReleaseNotes.txt (1 hunks)
  • .nuget/Savvyio.Extensions.SimpleQueueService/README.md (1 hunks)
  • .nuget/Savvyio.Extensions.Text.Json/PackageReleaseNotes.txt (1 hunks)
  • .nuget/Savvyio.Extensions.Text.Json/README.md (1 hunks)
  • .nuget/Savvyio.Messaging/PackageReleaseNotes.txt (1 hunks)
  • .nuget/Savvyio.Messaging/README.md (1 hunks)
  • .nuget/Savvyio.Queries/PackageReleaseNotes.txt (1 hunks)
  • .nuget/Savvyio.Queries/README.md (1 hunks)
  • CHANGELOG.md (1 hunks)
  • Savvyio.sln (3 hunks)
  • src/Savvyio.App/Savvyio.App.csproj (2 hunks)
  • src/Savvyio.Extensions.DependencyInjection.RabbitMQ/Commands/RabbitMqCommandQueue.cs (1 hunks)
  • src/Savvyio.Extensions.DependencyInjection.RabbitMQ/Commands/RabbitMqCommandQueueOptions.cs (1 hunks)
  • src/Savvyio.Extensions.DependencyInjection.RabbitMQ/EventDriven/RabbitMqEventBus.cs (1 hunks)
  • src/Savvyio.Extensions.DependencyInjection.RabbitMQ/EventDriven/RabbitMqEventBusOptions.cs (1 hunks)
  • src/Savvyio.Extensions.DependencyInjection.RabbitMQ/Savvyio.Extensions.DependencyInjection.RabbitMQ.csproj (1 hunks)
  • src/Savvyio.Extensions.DependencyInjection.RabbitMQ/ServiceCollectionExtensions.cs (1 hunks)
  • src/Savvyio.Extensions.RabbitMQ/Commands/RabbitMqCommandQueue.cs (1 hunks)
  • src/Savvyio.Extensions.RabbitMQ/Commands/RabbitMqCommandQueueOptions.cs (1 hunks)
  • src/Savvyio.Extensions.RabbitMQ/EventDriven/RabbitMqEventBus.cs (1 hunks)
  • src/Savvyio.Extensions.RabbitMQ/RabbitMqMessageOptions.cs (1 hunks)
  • src/Savvyio.Extensions.RabbitMQ/Savvyio.Extensions.RabbitMQ.csproj (1 hunks)
  • test/Savvyio.Extensions.DependencyInjection.RabbitMQ.Tests/Assets/BusMarker.cs (1 hunks)
  • test/Savvyio.Extensions.DependencyInjection.RabbitMQ.Tests/Assets/QueueMarker.cs (1 hunks)
  • test/Savvyio.Extensions.DependencyInjection.RabbitMQ.Tests/Savvyio.Extensions.DependencyInjection.RabbitMQ.Tests.csproj (1 hunks)
  • test/Savvyio.Extensions.DependencyInjection.RabbitMQ.Tests/ServiceCollectionExtensionsTest.cs (1 hunks)
  • test/Savvyio.Extensions.RabbitMQ.Tests/Commands/RabbitMqCommandQueueOptionsTest.cs (1 hunks)
  • test/Savvyio.Extensions.RabbitMQ.Tests/EventDriven/RabbitMqEventBusOptionsTest.cs (1 hunks)
  • test/Savvyio.Extensions.RabbitMQ.Tests/RabbitMqMessageOptionsTest.cs (1 hunks)
  • test/Savvyio.Extensions.RabbitMQ.Tests/Savvyio.Extensions.RabbitMQ.Tests.csproj (1 hunks)
✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 6

🧹 Nitpick comments (6)
src/Savvyio.Extensions.RabbitMQ/Savvyio.Extensions.RabbitMQ.csproj (1)

4-5: Include 'rabbitmq' in PackageTags.
For better NuGet discoverability, consider appending rabbitmq (and/or messaging) to <PackageTags>.

-  <PackageTags>azure queue storage event-grid bus</PackageTags>
+  <PackageTags>azure queue storage event-grid bus rabbitmq messaging</PackageTags>
src/Savvyio.Extensions.RabbitMQ/Commands/RabbitMqCommandQueue.cs (1)

59-66: Consider making message persistence configurable.

The Persistent property is commented out, which means messages won't survive RabbitMQ restarts. Consider making this configurable through options or documenting why persistence is disabled.

 await RabbitMqChannel.BasicPublishAsync("", _options.QueueName, true, basicProperties: new BasicProperties()
 {
-    //Persistent = true,
+    Persistent = _options.PersistentMessages ?? true,
     Headers = new Dictionary<string, object>()
     {
         { MessageType, message.GetType().ToFullNameIncludingAssemblyName() }
     }
test/Savvyio.Extensions.RabbitMQ.FunctionalTests/Commands/RabbitMqCommandQueueNewtonsoftJsonSerializerContextTest.cs (2)

30-72: Consider more robust synchronization instead of fixed delays.

The test uses fixed delays (Task.Delay(200)) which could be unreliable in CI environments or under load. Consider using more deterministic synchronization mechanisms.

- await Task.Delay(200); // wait briefly to ensure subscription setup
+ // Wait for subscription to be ready with timeout
+ var subscriptionReady = new TaskCompletionSource<bool>();
+ Task.Run<Task>(async () =>
+ {
+     subscriptionReady.SetResult(true);
+     await foreach (var msg in queue.ReceiveAsync().ConfigureAwait(false))
+     {
+         await receivedMessages.Writer.WriteAsync(msg).ConfigureAwait(false);
+     }
+ });
+ await subscriptionReady.Task.WaitAsync(TimeSpan.FromSeconds(5));

119-165: Enhance bulk test with better concurrency validation.

The bulk test sends 100 messages but doesn't validate that all messages are processed correctly in a concurrent scenario. Consider adding timeout handling and ensuring message ordering isn't assumed.

+ var timeout = TimeSpan.FromSeconds(10);
+ var receivedCount = 0;
  Task.Run<Task>(async () =>
  {
      await foreach (var msg in queue.ReceiveAsync().ConfigureAwait(false))
      {
+         Interlocked.Increment(ref receivedCount);
          await receivedMessages.Writer.WriteAsync(msg).ConfigureAwait(false);
+         if (receivedCount >= messages.Count)
+         {
+             receivedMessages.Writer.Complete();
+             break;
+         }
      }
  });
test/Savvyio.Extensions.RabbitMQ.FunctionalTests/Commands/RabbitMqCommandQueueJsonSerializerContextTest.cs (1)

144-162: Validate concurrent consumer implementation.

The bulk test introduces concurrent consumers but doesn't ensure proper load balancing verification. The count variables count1 and count2 are tracked but not asserted against expected distribution.

Consider validating that both consumers processed messages:

  TestOutput.WriteLine(count1.ToString());
  TestOutput.WriteLine(count2.ToString());
+ 
+ // Verify both consumers processed messages (for point-to-point, only one should process each message)
+ Assert.True(count1 > 0, "First consumer should have processed some messages");
+ Assert.True(count2 > 0, "Second consumer should have processed some messages");
+ Assert.Equal(100, count1 + count2); // Total should equal sent messages
test/Savvyio.Extensions.RabbitMQ.FunctionalTests/EventDriven/RabbitMqEventBusNewtonsoftJsonSerializerContextTest.cs (1)

28-30: Fix indentation inconsistency.

There's an extra space in the constructor declaration that's inconsistent with the coding style used elsewhere.

- public RabbitMqEventBusNewtonsoftJsonSerializerContextTest(ITestOutputHelper output) : base(output)
+ public RabbitMqEventBusNewtonsoftJsonSerializerContextTest(ITestOutputHelper output) : base(output)
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a186e80 and 312659f.

📒 Files selected for processing (16)
  • Directory.Packages.props (2 hunks)
  • Savvyio.sln (3 hunks)
  • src/Savvyio.Extensions.RabbitMQ/Commands/RabbitMqCommandQueue.cs (1 hunks)
  • src/Savvyio.Extensions.RabbitMQ/Commands/RabbitMqCommandQueueOptions.cs (1 hunks)
  • src/Savvyio.Extensions.RabbitMQ/EventDriven/RabbitMqEventBus.cs (1 hunks)
  • src/Savvyio.Extensions.RabbitMQ/EventDriven/RabbitMqEventBusOptions.cs (1 hunks)
  • src/Savvyio.Extensions.RabbitMQ/RabbitMqMessage.cs (1 hunks)
  • src/Savvyio.Extensions.RabbitMQ/RabbitMqMessageOptions.cs (1 hunks)
  • src/Savvyio.Extensions.RabbitMQ/Savvyio.Extensions.RabbitMQ.csproj (1 hunks)
  • test/Savvyio.Extensions.RabbitMQ.FunctionalTests/Assets/CreateMemberCommand.cs (1 hunks)
  • test/Savvyio.Extensions.RabbitMQ.FunctionalTests/Assets/MemberCreated.cs (1 hunks)
  • test/Savvyio.Extensions.RabbitMQ.FunctionalTests/Commands/RabbitMqCommandQueueJsonSerializerContextTest.cs (1 hunks)
  • test/Savvyio.Extensions.RabbitMQ.FunctionalTests/Commands/RabbitMqCommandQueueNewtonsoftJsonSerializerContextTest.cs (1 hunks)
  • test/Savvyio.Extensions.RabbitMQ.FunctionalTests/EventDriven/RabbitMqEventBusJsonSerializerContextTest.cs (1 hunks)
  • test/Savvyio.Extensions.RabbitMQ.FunctionalTests/EventDriven/RabbitMqEventBusNewtonsoftJsonSerializerContextTest.cs (1 hunks)
  • test/Savvyio.Extensions.RabbitMQ.FunctionalTests/Savvyio.Extensions.RabbitMQ.FunctionalTests.csproj (1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (5)
src/Savvyio.Extensions.RabbitMQ/RabbitMqMessageOptions.cs (2)
src/Savvyio.Extensions.RabbitMQ/Commands/RabbitMqCommandQueueOptions.cs (1)
  • ValidateOptions (59-63)
src/Savvyio.Extensions.RabbitMQ/EventDriven/RabbitMqEventBusOptions.cs (1)
  • ValidateOptions (45-49)
src/Savvyio.Extensions.RabbitMQ/Commands/RabbitMqCommandQueueOptions.cs (2)
src/Savvyio.Extensions.RabbitMQ/RabbitMqMessageOptions.cs (3)
  • RabbitMqMessageOptions (11-53)
  • RabbitMqMessageOptions (29-32)
  • ValidateOptions (49-52)
src/Savvyio.Extensions.RabbitMQ/EventDriven/RabbitMqEventBusOptions.cs (1)
  • ValidateOptions (45-49)
src/Savvyio.Extensions.RabbitMQ/EventDriven/RabbitMqEventBusOptions.cs (2)
src/Savvyio.Extensions.RabbitMQ/RabbitMqMessageOptions.cs (3)
  • RabbitMqMessageOptions (11-53)
  • RabbitMqMessageOptions (29-32)
  • ValidateOptions (49-52)
src/Savvyio.Extensions.RabbitMQ/Commands/RabbitMqCommandQueueOptions.cs (1)
  • ValidateOptions (59-63)
src/Savvyio.Extensions.RabbitMQ/EventDriven/RabbitMqEventBus.cs (3)
src/Savvyio.Extensions.RabbitMQ/RabbitMqMessage.cs (3)
  • RabbitMqMessage (13-111)
  • RabbitMqMessage (35-44)
  • Task (66-83)
src/Savvyio.Extensions.RabbitMQ/EventDriven/RabbitMqEventBusOptions.cs (2)
  • RabbitMqEventBusOptions (10-50)
  • RabbitMqEventBusOptions (28-30)
src/Savvyio.Extensions.RabbitMQ/Commands/RabbitMqCommandQueue.cs (2)
  • Task (49-68)
  • Task (113-119)
test/Savvyio.Extensions.RabbitMQ.FunctionalTests/Commands/RabbitMqCommandQueueJsonSerializerContextTest.cs (1)
test/Savvyio.Extensions.RabbitMQ.FunctionalTests/Assets/CreateMemberCommand.cs (1)
  • CreateMemberCommand (7-12)
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: call-build (Debug) / 🛠️ Build
  • GitHub Check: call-build (Release) / 🛠️ Build
🔇 Additional comments (33)
test/Savvyio.Extensions.RabbitMQ.FunctionalTests/Assets/MemberCreated.cs (2)

1-4: No issues with the using directive or namespace declaration.


5-16: Record implementation looks good.
The MemberCreated record correctly extends IntegrationEvent and exposes immutable properties for functional tests.

src/Savvyio.Extensions.RabbitMQ/Savvyio.Extensions.RabbitMQ.csproj (2)

8-11: Validate PackageReferences.
Using central package management is correct—Cuemon.Extensions.IO and RabbitMQ.Client will pick up versions from Directory.Packages.props.


13-19: Project references look accurate.
References to core Savvyio projects are in place for the RabbitMQ extension.

test/Savvyio.Extensions.RabbitMQ.FunctionalTests/Savvyio.Extensions.RabbitMQ.FunctionalTests.csproj (2)

7-9: PackageReference usage is correct.
System.Linq.Async is specified without a version, leveraging the centralized package management in Directory.Packages.props.


11-19: ProjectReference paths are valid.
The references target the correct functional and core projects needed for testing the RabbitMQ extension.

test/Savvyio.Extensions.RabbitMQ.FunctionalTests/Assets/CreateMemberCommand.cs (2)

1-4: No concerns with the using directive or namespace declaration.


5-19: Command record is well-defined.
CreateMemberCommand correctly inherits from Command and exposes immutable test parameters.

Directory.Packages.props (5)

7-8: Verify AWS SDK version updates.
AWSSDK.SQS and AWSSDK.SimpleNotificationService have been bumped—confirm these version changes are intentional and compatible.


13-13: Review Codebelt.Extensions.Xunit.App update.
Upgrading to 10.0.2 may alter test behavior; ensure there are no regressions.


25-26: Validate test framework package versions.
Microsoft.NET.Test.Sdk and Microsoft.TestPlatform.ObjectModel were updated; verify that the CI/test runners remain compatible.


28-28: New RabbitMQ.Client package added.
Dependency RabbitMQ.Client (7.1.2) aligns with the new extension; central version management is correctly applied.


36-36: Verify xunit.runner.visualstudio version.
Updating to 3.1.1 may affect test discovery; ensure the pipeline supports this runner.

Savvyio.sln (3)

122-125: LGTM! Project additions follow established patterns.

The new RabbitMQ projects are correctly added with proper project type GUIDs and paths.


356-363: LGTM! Build configurations are properly defined.

Both Debug and Release configurations are correctly set up for the new RabbitMQ projects.


425-426: LGTM! Solution folder nesting is correct.

The projects are appropriately nested under the "src" and "test" solution folders.

src/Savvyio.Extensions.RabbitMQ/RabbitMqMessageOptions.cs (2)

29-32: LGTM! Sensible default configuration.

The constructor provides a reasonable default AMQP URL for local development.


49-52: LGTM! Proper validation implementation.

The validation correctly ensures AmqpUrl is not null, following the framework's validation patterns.

src/Savvyio.Extensions.RabbitMQ/EventDriven/RabbitMqEventBusOptions.cs (3)

10-10: LGTM! Proper inheritance design.

The class correctly inherits from RabbitMqMessageOptions to reuse common RabbitMQ configuration.


28-30: LGTM! Constructor design follows inheritance best practices.

The empty constructor appropriately relies on the base class for common initialization.


45-49: LGTM! Validation follows established pattern.

The validation override correctly validates the event bus-specific property before calling base validation, consistent with the pattern used in RabbitMqCommandQueueOptions.

src/Savvyio.Extensions.RabbitMQ/Commands/RabbitMqCommandQueueOptions.cs (3)

10-10: LGTM! Consistent inheritance design.

The class properly inherits from RabbitMqMessageOptions, maintaining consistency with RabbitMqEventBusOptions.


42-50: LGTM! Well-defined command queue properties.

Both QueueName and AutoAcknowledge properties are appropriately documented and typed for command queue functionality.


59-63: LGTM! Validation pattern is consistent.

The validation override follows the same pattern as RabbitMqEventBusOptions, ensuring required properties are validated before calling base validation.

src/Savvyio.Extensions.RabbitMQ/RabbitMqMessage.cs (3)

35-44: LGTM! Well-structured constructor with proper validation.

The constructor properly validates inputs and initializes the connection factory with the provided AMQP URL.


66-83: LGTM! Thread-safe connection initialization with proper async locking.

The double-checked locking pattern is correctly implemented for async scenarios, ensuring only one initialization occurs while avoiding unnecessary lock acquisitions.


106-110: LGTM! Proper async disposal implementation.

The disposal order is correct (channel before connection) and null checks prevent exceptions for uninitialized resources.

src/Savvyio.Extensions.RabbitMQ/Commands/RabbitMqCommandQueue.cs (1)

77-111: LGTM! Well-implemented async message consumption with proper acknowledgment handling.

The implementation correctly handles message deserialization, metadata attachment, and conditional auto-acknowledgment. The async enumerable pattern provides a clean API for consumers.

src/Savvyio.Extensions.RabbitMQ/EventDriven/RabbitMqEventBus.cs (2)

50-65: LGTM! Correct implementation of fanout exchange publishing.

The method properly declares a fanout exchange and publishes messages with appropriate metadata.


73-106: LGTM! Well-implemented subscription with temporary queues.

The implementation correctly creates temporary queues for each subscriber and uses auto-acknowledgment, which is appropriate for event bus scenarios. The fanout exchange ensures all subscribers receive published messages.

test/Savvyio.Extensions.RabbitMQ.FunctionalTests/EventDriven/RabbitMqEventBusJsonSerializerContextTest.cs (2)

269-276: Excellent use of parallel publishing for stress testing.

The bulk test correctly uses ParallelFactory.ForEachAsync to publish messages concurrently, which properly tests the event bus under load and validates the publish-subscribe pattern with multiple subscribers.


287-295: Verify publish-subscribe semantics correctly.

The assertions properly validate that in a publish-subscribe pattern, both subscribers receive all 100 messages, which is the expected behavior for event bus patterns.

test/Savvyio.Extensions.RabbitMQ.FunctionalTests/EventDriven/RabbitMqEventBusNewtonsoftJsonSerializerContextTest.cs (1)

32-296: Consistent test implementation across serializers.

The test methods are well-structured and consistent with the JsonSerializer version, providing comprehensive coverage of event bus functionality with proper validation of publish-subscribe semantics.

@codecov
Copy link

codecov bot commented Jun 9, 2025

Codecov Report

Attention: Patch coverage is 46.03175% with 102 lines in your changes missing coverage. Please review.

Project coverage is 75.59%. Comparing base (a186e80) to head (28c455e).

Files with missing lines Patch % Lines
...tensions.RabbitMQ/Commands/RabbitMqCommandQueue.cs 17.85% 46 Missing ⚠️
...xtensions.RabbitMQ/EventDriven/RabbitMqEventBus.cs 15.90% 37 Missing ⚠️
src/Savvyio.Extensions.RabbitMQ/RabbitMqMessage.cs 44.11% 19 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main      #35       +/-   ##
===========================================
- Coverage   86.69%   75.59%   -11.10%     
===========================================
  Files         158      167        +9     
  Lines        3284     3483      +199     
  Branches      332      348       +16     
===========================================
- Hits         2847     2633      -214     
- Misses        435      848      +413     
  Partials        2        2               

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Jun 9, 2025

Quality Gate Failed Quality Gate failed

Failed conditions
38.8% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@gimlichael gimlichael merged commit b3b1867 into main Jun 9, 2025
3 of 4 checks passed
@gimlichael gimlichael deleted the v4.1.0/support-for-rabbitmq branch June 9, 2025 19:30
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.

2 participants