The most significant changes involve updates to the OcelotBuilderExtensions and PollyQoSResiliencePipelineProvider classes, as well as modifications to the PollyQoSTests class.
In the OcelotBuilderExtensions class, the GetDelegatingHandler method is now used instead of GetDelegatingHandlerV7 in the AddPolly methods. The AddPolly method without parameters has been simplified using a lambda expression. The GetDelegatingHandler method now returns a new instance of PollyResiliencePipelineDelegatingHandler instead of PollyPoliciesDelegatingHandler.
In the PollyQoSResiliencePipelineProvider class, a comment has been added suggesting the use of ResiliencePipelineRegistry<TKey>.GetOrAddPipeline due to its thread-safe nature. The MinimumThroughput property in circuitBreakerStrategyOptions now uses the value from route.QosOptions.ExceptionsAllowedBeforeBreaking.
In the PollyQoSTests class, the QoSOptions used in the test configurations have been updated. Two tests, Should_open_circuit_breaker_then_close and Open_circuit_should_not_effect_different_route, have been modified to repeat the same request as the minimum ExceptionsAllowedBeforeBreaking is now 2. The GivenThereIsAPossiblyBrokenServiceRunningOn method now delays for 2.1 seconds when the request count is 2, to ensure the circuit is open.
Proposed Changes
OcelotBuilderExtensions class updated to use GetDelegatingHandler method.
AddPolly methods in OcelotBuilderExtensions class simplified.
GetDelegatingHandler method in OcelotBuilderExtensions class now returns a new instance of PollyResiliencePipelineDelegatingHandler.
Comment added in PollyQoSResiliencePipelineProvider class suggesting the use of ResiliencePipelineRegistry<TKey>.GetOrAddPipeline.
MinimumThroughput property in circuitBreakerStrategyOptions updated to use value from route.QosOptions.ExceptionsAllowedBeforeBreaking.
QoSOptions in PollyQoSTests class updated.
Should_open_circuit_breaker_then_close and Open_circuit_should_not_effect_different_route tests in PollyQoSTests class updated.
GivenThereIsAPossiblyBrokenServiceRunningOn method in PollyQoSTests class updated to delay for 2.1 seconds when request count is 2.
Fixes / New Feature #
The most significant changes involve updates to the
OcelotBuilderExtensions
andPollyQoSResiliencePipelineProvider
classes, as well as modifications to thePollyQoSTests
class.In the
OcelotBuilderExtensions
class, theGetDelegatingHandler
method is now used instead ofGetDelegatingHandlerV7
in theAddPolly
methods. TheAddPolly
method without parameters has been simplified using a lambda expression. TheGetDelegatingHandler
method now returns a new instance ofPollyResiliencePipelineDelegatingHandler
instead ofPollyPoliciesDelegatingHandler
.In the
PollyQoSResiliencePipelineProvider
class, a comment has been added suggesting the use ofResiliencePipelineRegistry<TKey>.GetOrAddPipeline
due to its thread-safe nature. TheMinimumThroughput
property incircuitBreakerStrategyOptions
now uses the value fromroute.QosOptions.ExceptionsAllowedBeforeBreaking
.In the
PollyQoSTests
class, theQoSOptions
used in the test configurations have been updated. Two tests,Should_open_circuit_breaker_then_close
andOpen_circuit_should_not_effect_different_route
, have been modified to repeat the same request as the minimumExceptionsAllowedBeforeBreaking
is now 2. TheGivenThereIsAPossiblyBrokenServiceRunningOn
method now delays for 2.1 seconds when the request count is 2, to ensure the circuit is open.Proposed Changes
OcelotBuilderExtensions
class updated to useGetDelegatingHandler
method.AddPolly
methods inOcelotBuilderExtensions
class simplified.GetDelegatingHandler
method inOcelotBuilderExtensions
class now returns a new instance ofPollyResiliencePipelineDelegatingHandler
.PollyQoSResiliencePipelineProvider
class suggesting the use ofResiliencePipelineRegistry<TKey>.GetOrAddPipeline
.MinimumThroughput
property incircuitBreakerStrategyOptions
updated to use value fromroute.QosOptions.ExceptionsAllowedBeforeBreaking
.QoSOptions
inPollyQoSTests
class updated.Should_open_circuit_breaker_then_close
andOpen_circuit_should_not_effect_different_route
tests inPollyQoSTests
class updated.GivenThereIsAPossiblyBrokenServiceRunningOn
method inPollyQoSTests
class updated to delay for 2.1 seconds when request count is 2.