-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Dynamic reconfiguration during running
PolicyRegistry
can also be used as a way to introduce dynamic reconfiguration of Polly policies during the running of an application.
A typical pattern with Polly is to configure policies once at startup, then apply those where needed.
PolicyRegistry
is a common way of enabling that scenario, with policies configured into PolicyRegistry
at startup, then extracted at call site.
A natural extension of this pattern is to use a PolicyRegistry
for dynamic reconfiguration during running.
In some applications, it can be useful to have the ability to reconfigure policies dynamically without the disturbance of restarting the process to pick up new configuration. For example, you may want to tweak circuit-breaking thresholds to be more or less sensitive according to conditions in production.
Polly policies however were intentionally designed so that a policy's configuration is immutable: this avoids pitfalls which could arise with mutable configuration such as how to update the configuration atomically; and what the effect might or should be on operations that are mid-running when the configuration is updated.
PolicyRegistry
provides a route to dynamic reconfiguration in that you can simply replace the policy in the registry with a new one, when the underlying configuration source is detected to have changed. Next time the call site pulls the policy from the registry, it will pull the newly configured version. This works particularly well with configuration sources which can raise an event when the underlying configuration source is detected to have changed.
- Home
- Polly RoadMap
- Contributing
- Transient fault handling and proactive resilience engineering
- Supported targets
- Retry
- Circuit Breaker
- Advanced Circuit Breaker
- Timeout
- Bulkhead
- Cache
- Rate-Limit
- Fallback
- PolicyWrap
- NoOp
- PolicyRegistry
- Polly and HttpClientFactory
- Asynchronous action execution
- Handling InnerExceptions and AggregateExceptions
- Statefulness of policies
- Keys and Context Data
- Non generic and generic policies
- Polly and interfaces
- Some policy patterns
- Debugging with Polly in Visual Studio
- Unit-testing with Polly
- Polly concept and architecture
- Polly v6 breaking changes
- Polly v7 breaking changes
- DISCUSSION PROPOSAL- Polly eventing and metrics architecture