Skip to content

Conversation

@everttimmer1963
Copy link
Owner

…itMQ.Client behavior.

The regular client does not evaluate x-... headers when 'all' or 'any' was applied. It uses 'all-with-x' or 'any-with-x' for that.

The mocking library did not check for the 'x-...' filters when matching, and checked all headers, including the x-... headers.

…itMQ.Client behavior.

The regular client does not evaluate x-... headers when 'all' or 'any' was applied. It uses 'all-with-x' or 'any-with-x' for that.

The mocking library did not check for the 'x-...' filters when matching, and checked all headers, including the x-...  headers.
@everttimmer1963 everttimmer1963 requested a review from Copilot May 23, 2025 21:48
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 PR aligns the mock library’s headers exchange matching behavior with the official RabbitMQ.Client by introducing “all-with-x” and “any-with-x” modes, ensuring ‘x-’ prefixed headers are handled correctly by default and only considered when explicitly requested.

  • Support for “all-with-x” and “any-with-x” match modes in both queue and exchange matching methods
  • Updated header filtering logic to exclude ‘x-’ headers for the default “all”/“any” modes
  • Version bump to 1.2.5 and release notes update

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
RabbitMQ.Client.Mock/Server/Exchanges/HeadersExchange.cs Add “all-with-x”/“any-with-x” options and filter ‘x-’ headers appropriately
RabbitMQ.Client.Mock/Releasenotes.txt Add entry for header-matching bug fix in 1.2.5 release
RabbitMQ.Client.Mock/RabbitMQ.Client.Mock.csproj Bump package version from 1.2.4 to 1.2.5
Comments suppressed due to low confidence (1)

RabbitMQ.Client.Mock/Server/Exchanges/HeadersExchange.cs:126

  • New 'all-with-x' and 'any-with-x' behaviors introduce additional branching; please add unit tests covering these scenarios to ensure correct header matching.
if (match.Equals("any") || match.Equals("any-with-x"))

@everttimmer1963 everttimmer1963 merged commit b680ed8 into main May 23, 2025
@everttimmer1963 everttimmer1963 deleted the issues/12-headers-exchange--matching branch May 23, 2025 21:54
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