Move AMQP transport settings from NmsConnectionInfo to AmqpProvider - #112
Open
Havret wants to merge 1 commit into
Open
Move AMQP transport settings from NmsConnectionInfo to AmqpProvider#112Havret wants to merge 1 commit into
Havret wants to merge 1 commit into
Conversation
ChannelMax, MaxFrameSize, and IdleTimeout are AMQP transport-level settings and belong on AmqpProvider rather than NmsConnectionInfo. Defaults are now initialized once via a static constructor on AmqpProvider by reading from AmqpNetLite's ConnectionFactory.
There was a problem hiding this comment.
Pull request overview
This PR relocates AMQP transport negotiation settings (channel max, max frame size, idle timeout) from NmsConnectionInfo into AmqpProvider, aligning them with existing amqp.* URI option parsing and updating tests to validate the Open-frame behavior (notably for idle-timeout handling as a follow-up to #102).
Changes:
- Move default AMQP transport settings initialization to
AmqpProviderand expose them as provider properties. - Update
AmqpConnectionto source Open-frame transport fields fromAmqpProviderinstead ofNmsConnectionInfo. - Replace/remove the prior unit test and add/extend integration + factory tests to cover the new behavior and URI option parsing.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| test/Apache-NMS-AMQP-Test/TestAmqp/TestAmqpPeer.cs | Extends ExpectOpen to allow custom Open-frame assertions in integration tests. |
| test/Apache-NMS-AMQP-Test/Provider/Amqp/AmqpProviderFactoryTest.cs | Adds coverage for amqp.channelMax, amqp.maxFrameSize, and amqp.idleTimeout parsing and defaults. |
| test/Apache-NMS-AMQP-Test/Provider/Amqp/AmqpConnectionTest.cs | Removes a unit test that validated idle-timeout behavior at the AmqpConnection level. |
| test/Apache-NMS-AMQP-Test/Integration/IntegrationTestFixture.cs | Makes BuildUri reusable by derived tests and allows optional options string. |
| test/Apache-NMS-AMQP-Test/Integration/ConnectionIntegrationTest.cs | Adds integration tests that assert Open-frame idle-timeout behavior (default / configured cases). |
| src/NMS.AMQP/Provider/Amqp/AmqpProvider.cs | Introduces provider-level defaults/properties for channel max, max frame size, and idle timeout. |
| src/NMS.AMQP/Provider/Amqp/AmqpConnection.cs | Uses provider properties to populate Open-frame settings. |
| src/NMS.AMQP/Meta/NmsConnectionInfo.cs | Removes transport-related defaults and properties from NmsConnectionInfo. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
114
to
117
| open.ContainerId = Info.ClientId; | ||
| open.ChannelMax = Info.ChannelMax; | ||
| open.MaxFrameSize = (uint) Info.MaxFrameSize; | ||
| open.ChannelMax = Provider.ChannelMax; | ||
| open.MaxFrameSize = (uint) Provider.MaxFrameSize; | ||
| open.HostName = String.IsNullOrWhiteSpace(this.Provider.VHost) ? remoteUri.Host : this.Provider.VHost; |
Comment on lines
58
to
62
| public bool LocalMessageExpiry { get; set; } | ||
| public string QueuePrefix { get; set; } | ||
| public string TopicPrefix { get; set; } | ||
| public ushort ChannelMax { get; set; } = DEFAULT_CHANNEL_MAX; | ||
| public int MaxFrameSize { get; set; } = DEFAULT_MAX_FRAME_SIZE; | ||
| public int IdleTimeOut { get; set; } = DEFAULT_IDLE_TIMEOUT; | ||
|
|
||
| public bool AnonymousRelaySupported { get; set; } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
It's a follow up for #102.