Skip to content

Comments

#585 #2338 Quality of Service global configuration#2339

Merged
raman-m merged 23 commits intodevelopfrom
feature/2338-qos-opts
Dec 4, 2025
Merged

#585 #2338 Quality of Service global configuration#2339
raman-m merged 23 commits intodevelopfrom
feature/2338-qos-opts

Conversation

@raman-m
Copy link
Member

@raman-m raman-m commented Nov 26, 2025

Closes #2338

Ocelot now fully supports global QoS options for both static and dynamic routing, with the ability to override options at the route level when needed. In the past, only route-level QoS options were available for static routing, while global QoS was limited to dynamic routing. The current challenge is to unify everything into a single QoSOptions model as part of the DownstreamRoute business object.

Proposed Changes

  • The Ocelot.Provider.Polly project code has been updated to reflect changes in the QoSOptions business model schema. Notably, this breaking change requires users to recompile their solutions when upgrading to the current version, if a custom PollyQoSResiliencePipelineProvider was developed.
  • Removed QoSOptionsBuilder from the codebase to eliminate unnecessary clutter, opting instead for native QoSOptions constructors to fully leverage Object initializers during construction. As the result, the new micro-constructors cover 90% of user cases. This nice C# feat, Object initializers were added in C# 3.0 with the .NET Framework 3.5 SDK in 2007! There's no need to build objects using the outdated Builder anti-pattern.
  • ❗Feature: QoSOptionsCreator 👈
  • Both FileRoute and FileDynamicRoute inherit from FileRouteBase abstract class
  • The FileGlobalConfiguration doesn't inherit from anything, allowing the flexibility to add more complex models as properties. Finally, the new qualifier was removed, which previously hid base properties from the old inherited FileGlobalDynamicRouting class, to address issues with polymorphic JSON (de)serialization of the FileGlobalConfiguration properties which types inherit the IRouteGroup interface, so called FileGlobal* classes.
  • ❗Feature: FileGlobalQoSOptions
  • ❗Feature: The deprecated FileQoSOptions properties include DurationOfBreak (now BreakDuration), ExceptionsAllowedBeforeBreaking (now MinimumThroughput), and TimeoutValue (now Timeout). The original names were suggested by a Chinese developer in PR Circuit breaker pattern #27. So, now the QoS models align with the Polly schema.
  • The QoSOptions business model now aligns with the Polly schema. Note: this IBC requires users to recompile their solutions when upgrading to the current version.
  • Created a new QualityOfService folder to house the QoS feature in its own dedicated code area. Previously, the QoS functionality was scattered across various folders within the main project.
  • Unit testing. Created a new QualityOfService folder to organize all QoS feature unit tests under a single Ocelot.UnitTests.QualityOfService namespace.
  • Unit testing. The main unit tests covering the feature code are written in the QoSOptionsCreatorTests class, while the remaining unit tests are located in the QualityOfService namespace.
  • Acceptance testing. PollyQoSTests and DynamicRoutingTests which writing was a real challenge.
  • Documentation. Added commit 69944b8qualityofservice.rsthtml docs in developQuality of Service

@raman-m raman-m added this to the Summer'25 milestone Nov 26, 2025
@raman-m raman-m self-assigned this Nov 26, 2025
@raman-m raman-m added QoS Ocelot feature: Quality of Service aka Polly Configuration Ocelot feature: Configuration Summer'25 Summer 2025 release Dynamic Routing Ocelot feature: Dynamic Routing labels Nov 26, 2025
@raman-m raman-m changed the title Feature/2338 qos opts #585 #2338 Quality of Service global configuration Nov 26, 2025
@coveralls
Copy link
Collaborator

coveralls commented Nov 26, 2025

Coverage Status

coverage: 93.442% (+0.05%) from 93.391%
when pulling 69944b8 on feature/2338-qos-opts
into 4730613 on develop.

@raman-m raman-m requested review from RaynaldM and ggnaegi November 26, 2025 16:21
@raman-m
Copy link
Member Author

raman-m commented Nov 29, 2025

@RaynaldM Are you interested in quality of this PR? This is Polly provider which is used by your dev team.

raman-m and others added 3 commits December 1, 2025 13:46
Co-authored-by: Raynald Messié <redbird_project@yahoo.fr>
Co-authored-by: Raynald Messié <redbird_project@yahoo.fr>
@ggnaegi
Copy link
Collaborator

ggnaegi commented Dec 3, 2025

I'm going to have a look at this tomorrow, cheers!

@raman-m
Copy link
Member Author

raman-m commented Dec 3, 2025

Development Complete ✅

@ggnaegi commented on December 3

You might be late, as I am currently writing the docs and the status is "Dev Complete".
Once I push a commit with the updated docs, I'll proceed to merge.

Copy link
Member Author

@raman-m raman-m left a comment

Choose a reason for hiding this comment

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

Ready for delivery ✅

@raman-m raman-m merged commit 35dbc9d into develop Dec 4, 2025
6 of 9 checks passed
@raman-m raman-m deleted the feature/2338-qos-opts branch December 4, 2025 14:25
raman-m added a commit that referenced this pull request Dec 9, 2025
…ronment (#2342)

* Fixing ShouldHighlyLoadOnUnstableKubeProvider_WithRoundRobinLoadBalancing for PollKube: PollingInterval workaround
* Fixing PollyQoSTests: IsCiCd helper and wait more for circuit closing
* Fixing Should_open_circuit_breaker_for_DefaultBreakDuration
* Fixing ShouldApplyGlobalQosOptions_ForAllDynamicRoutes_WithGroupedOpts
* Improve code coverage
* Update develop workflow: job runs on linux+windows+macos
raman-m added a commit that referenced this pull request Dec 9, 2025
…ronment (#2342)

* Fixing ShouldHighlyLoadOnUnstableKubeProvider_WithRoundRobinLoadBalancing for PollKube: PollingInterval workaround
* Fixing PollyQoSTests: IsCiCd helper and wait more for circuit closing
* Fixing Should_open_circuit_breaker_for_DefaultBreakDuration
* Fixing ShouldApplyGlobalQosOptions_ForAllDynamicRoutes_WithGroupedOpts
* Improve code coverage
* Update develop workflow: job runs on linux+windows+macos
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Configuration Ocelot feature: Configuration Dynamic Routing Ocelot feature: Dynamic Routing QoS Ocelot feature: Quality of Service aka Polly Summer'25 Summer 2025 release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

#585 Quality of Service global configuration

4 participants