Skip to content

Add version-gated deprecation handling for rabbitmq_delayed_message_exchange plugin - #71

Merged
niemyjski merged 6 commits into
mainfrom
deprecate-delayed-exchange-plugin
Apr 13, 2026
Merged

niemyjski merged 6 commits into
mainfrom
deprecate-delayed-exchange-plugin

Conversation

@niemyjski

@niemyjski niemyjski commented Apr 13, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Detect RabbitMQ server version via IConnection.ServerProperties on first connection
  • Skip the delayed exchange plugin probe entirely on RabbitMQ >= 4.3 (Mnesia removed, plugin incompatible)
  • Log a deprecation warning when the plugin is successfully detected on RabbitMQ < 4.3
  • Fall back to the existing in-memory delay mechanism (MessageBusBase.SendDelayedMessage) automatically
  • Add ParseServerVersion public static method with comprehensive unit tests
  • Document delayed message delivery behavior, plugin deprecation, and migration guidance in README

Context

The rabbitmq_delayed_message_exchange plugin is archived and no longer maintained. It depends on Mnesia, which is removed in RabbitMQ 4.3. This PR ensures users are warned on older versions and the library gracefully handles the transition without breaking changes.

Test plan

  • Verify ParseServerVersion unit tests pass (13 tests covering valid versions, null/missing/invalid inputs, and version comparison)
  • Integration test against RabbitMQ < 4.3 with plugin: delayed exchange is used, deprecation warning logged
  • Integration test against RabbitMQ < 4.3 without plugin: falls back to in-memory delay
  • Integration test against RabbitMQ >= 4.3: plugin probe skipped, info message logged, in-memory fallback used

…xchange plugin

The plugin depends on Mnesia which is removed in RabbitMQ 4.3, making it
incompatible. This change detects the server version on connection and:

- Skips the delayed exchange plugin probe on RabbitMQ >= 4.3
- Logs a deprecation warning when the plugin is detected on older versions
- Falls back to the existing in-memory delay mechanism automatically
- Documents delayed message behavior and migration guidance in README
Comment thread src/Foundatio.RabbitMQ/Messaging/RabbitMQMessageBus.cs
Comment thread src/Foundatio.RabbitMQ/Messaging/RabbitMQMessageBus.cs
Comment thread src/Foundatio.RabbitMQ/Messaging/RabbitMQMessageBus.cs Outdated
Comment thread src/Foundatio.RabbitMQ/Messaging/RabbitMQMessageBus.cs

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds RabbitMQ server-version detection to version-gate probing of the rabbitmq_delayed_message_exchange plugin, warning users on older servers and documenting the fallback behavior.

Changes:

  • Detect RabbitMQ server version from IConnection.ServerProperties and skip delayed-exchange probing on RabbitMQ ≥ 4.3.
  • Emit a deprecation warning when the delayed-exchange plugin is successfully used on RabbitMQ < 4.3.
  • Add unit tests for ParseServerVersion and document delayed message delivery behavior/migration guidance in the README.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
src/Foundatio.RabbitMQ/Messaging/RabbitMQMessageBus.cs Adds server version detection, version-gated delayed-exchange probe, deprecation warning, and ParseServerVersion API.
tests/Foundatio.RabbitMQ.Tests/Messaging/RabbitMqServerVersionTests.cs Adds unit coverage for ParseServerVersion inputs and basic version threshold comparisons.
README.md Documents delayed delivery behavior across RabbitMQ versions and migration guidance away from the deprecated plugin.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/Foundatio.RabbitMQ/Messaging/RabbitMQMessageBus.cs
Comment thread src/Foundatio.RabbitMQ/Messaging/RabbitMQMessageBus.cs
Comment thread src/Foundatio.RabbitMQ/Messaging/RabbitMQMessageBus.cs
Comment thread README.md Outdated
… fix typo

- Add DetectServerVersion calls in publisher and subscriber fallback
  reconnection paths so _serverVersion is populated even when the first
  connection failed to create the delayed exchange
- Clarify XML doc on CreateDelayedExchangeAsync to note that the probe
  is still attempted when version detection fails
- Fix README typo: "delay delivery" to "delayed delivery"

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

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


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/Foundatio.RabbitMQ/Messaging/RabbitMQMessageBus.cs
Comment thread src/Foundatio.RabbitMQ/Messaging/RabbitMQMessageBus.cs Outdated
Comment thread src/Foundatio.RabbitMQ/Messaging/RabbitMQMessageBus.cs Outdated
…-disabled

- Change CreateDelayedExchangeAsync to return bool? (true = plugin
  declared, null = skipped/cached-disabled with channel still healthy,
  false = probe threw and channel is likely closed)
- Publisher and subscriber init paths now only tear down and reconnect
  when the probe actually failed (false); when skipped (null) they
  declare the regular exchange on the existing healthy channel
- Improve catch block log message to be neutral ("Unable to declare
  delayed exchange") and include ShutdownReason ReplyCode/ReplyText
  for better operator diagnostics
Comment thread src/Foundatio.RabbitMQ/Messaging/RabbitMQMessageBus.cs Fixed

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

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


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

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


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread README.md Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@niemyjski
niemyjski merged commit e5cd184 into main Apr 13, 2026
1 check passed
@niemyjski
niemyjski deleted the deprecate-delayed-exchange-plugin branch April 13, 2026 18:18
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