Skip to content

Move AMQP transport settings from NmsConnectionInfo to AmqpProvider - #112

Open
Havret wants to merge 1 commit into
mainfrom
move-amqp-transport-settings-to-provider
Open

Move AMQP transport settings from NmsConnectionInfo to AmqpProvider#112
Havret wants to merge 1 commit into
mainfrom
move-amqp-transport-settings-to-provider

Conversation

@Havret

@Havret Havret commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

It's a follow up for #102.

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.

Copilot AI left a comment

Copy link
Copy Markdown

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 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 AmqpProvider and expose them as provider properties.
  • Update AmqpConnection to source Open-frame transport fields from AmqpProvider instead of NmsConnectionInfo.
  • 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; }
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