Fix RabbitMQ queue binding and Gateway GetOriginalStream#498
Fix RabbitMQ queue binding and Gateway GetOriginalStream#498alexeyzimarev merged 2 commits intodevfrom
Conversation
RabbitMQ: QueueBind used SubscriptionId instead of the resolved queue name, breaking message delivery when QueueOptions.Queue was overridden. Gateway: GetOriginalStream() retrieved the header as System.IO.Stream instead of StreamName, so it always returned null. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Review Summary by QodoFix RabbitMQ queue binding and Gateway stream retrieval
WalkthroughsDescription• Fixed RabbitMQ queue binding using resolved queue name instead of subscription ID • Fixed Gateway GetOriginalStream() return type from Stream to StreamName • Corrected logging to display actual queue name in RabbitMQ binding Diagramflowchart LR
A["RabbitMQ QueueBind"] -->|"Use resolved queue name"| B["Correct binding"]
C["Gateway GetOriginalStream"] -->|"Return StreamName type"| D["Correct stream retrieval"]
File Changes1. src/Gateway/src/Eventuous.Gateway/GatewayMetaHelper.cs
|
Code Review by Qodo
1. Public API return-type break
|
| public StreamName? GetOriginalStream() | ||
| => message.AdditionalHeaders?.Get<StreamName>(GatewayContextItems.OriginalStream); |
There was a problem hiding this comment.
1. Public api return-type break 🐞 Bug ⛯ Reliability
ProducedMessageExtensions.GetOriginalStream changed its return type from Stream? to StreamName?, which is a source/binary breaking change for downstream consumers of this library. If this is released as a patch/minor version, it can break compilation and already-built binaries that reference the old signature.
Agent Prompt
## Issue description
`ProducedMessageExtensions.GetOriginalStream()` is marked as public API and its return type was changed from `System.IO.Stream?` to `StreamName?`. This is a breaking change for consumers and must be handled explicitly (SemVer major bump or compatibility shim).
## Issue Context
The old implementation was incorrect because the stored value is `StreamName` (from `IBaseConsumeContext.Stream`) and `Metadata.Get<T>` only returns values when the stored type exactly matches `T`.
## Fix Focus Areas
- src/Gateway/src/Eventuous.Gateway/GatewayMetaHelper.cs[30-35]
- src/Gateway/src/Eventuous.Gateway/GatewayMetaHelper.cs[15-24]
## Suggested approach
Choose one:
1) **Breaking-change approach (preferred if you can bump major):** keep current signature, and add release notes/CHANGELOG entry.
2) **Compatibility approach (preferred for patch/minor):**
- Add `StreamName? GetOriginalStreamName()` (new method).
- Re-introduce old `Stream? GetOriginalStream()` signature, mark `[Obsolete]`, and keep its old behavior (or return `null`) to avoid breaking builds.
- Update internal docs/examples to use `GetOriginalStreamName()`.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
Test Results 57 files 57 suites 34m 10s ⏱️ Results for commit ba7ba9c. ♻️ This comment has been updated with latest results. |
…ream RabbitMQ: integration test that uses a custom QueueOptions.Queue name different from SubscriptionId, verifying messages are still delivered. Gateway: unit tests for ProducedMessageExtensions verifying that GetOriginalStream returns StreamName (not System.IO.Stream), plus tests for other header accessors and null-header edge case. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
/review |
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
Summary
QueueBindusedOptions.SubscriptionIdinstead of the resolvedqueuename, so overriding the queue viaQueueOptions.Queuebroke exchange-to-queue binding and message deliveryGetOriginalStream()retrieved the header asSystem.IO.Streaminstead ofStreamName, causing it to always return nullBoth bugs were identified by Qodo review on #495.
Test plan
QueueOptions.QueuenameGetOriginalStream()returns the correctStreamName🤖 Generated with Claude Code