Skip to content

Conversation

@everttimmer1963
Copy link
Owner

Fixed issue where message delivery isn't started immediately when consumer added on existing queue containing messages.

…sumer added on existing queue containing messages.
@everttimmer1963 everttimmer1963 requested a review from Copilot May 23, 2025 09:07
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request addresses the issue where a new consumer on an existing queue did not receive messages immediately by ensuring the queue notifies when a consumer is added.

  • Added a call to _waitHandle.Set() in both message requeue and when a consumer is added.
  • Updated the consume operation to notify the queue upon consumer addition.
  • Introduced a new test to verify immediate message delivery.

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
RabbitMQ.Client.Mock/Server/Queues/RabbitQueue.cs Added _waitHandle.Set() in RequeueMessageAsync and a new NotifyConsumerAdded method to trigger immediate delivery.
RabbitMQ.Client.Mock/Server/Operations/BasicConsumeOperation.cs Updated consumer binding and invoked NotifyConsumerAdded to ensure prompt message delivery.
RabbitMQ.Client.Mock/Releasenotes.txt Updated release notes to reflect the fix for immediate message delivery.
RabbitMQ.Client.Mock/RabbitMQ.Client.Mock.csproj Updated version number to 1.2.4.
RabbitMQ.Client.Mock.Tests/ConsumerTests.cs Added test to validate that messages are delivered immediately when a consumer is added.
Comments suppressed due to low confidence (1)

RabbitMQ.Client.Mock/Server/Queues/RabbitQueue.cs:128

  • [nitpick] Consider renaming 'NotifyConsumerAdded' to 'NotifyConsumerAddedAsync' to more clearly indicate its asynchronous nature.
public ValueTask NotifyConsumerAdded()

@everttimmer1963 everttimmer1963 merged commit ef663ed into main May 23, 2025
@everttimmer1963 everttimmer1963 deleted the issues/consumer-starts-unsignalled branch May 23, 2025 09:08
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