Targets
Named policies are applied to targets. Dapr supports three target types that apply all Dapr building block APIs:
components
actors
Apps
With the apps
target, you can apply retry
, timeout
, and circuitBreaker
policies to service invocation calls between Dapr apps. Under targets/apps
, policies are applied to each target service’s app-id
. The policies are invoked when a failure occurs in communication between sidecars, as shown in the diagram below.
Example of policies to a target app with the app-id
“appB”:
Components
With the target, you can apply retry
, timeout
and circuitBreaker
policies to component operations.
Outbound
outbound
operations are calls from the sidecar to a component, such as:
- Persisting or retrieving state.
- Publishing a message on a PubSub component.
Inbound
inbound
operations are calls from the sidecar to your application, such as:
- PubSub subscriptions when delivering a message.
- Input bindings.
PubSub
Actors
With the target, you can apply retry
, timeout
, and circuitBreaker
policies to actor operations.
When using a circuitBreaker
policy for the actors
target, you can specify how circuit breaking state should be scoped by using circuitBreakerScope
:
id
: an individual actor IDtype
: all actors of a given actor typeboth
: both of the above
You can also specify a cache size for the number of circuit breakers to keep in memory with the circuitBreakerCacheSize
property, providing an integer value, e.g. .
Example
Try out one of the Resiliency quickstarts: