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.
- Invoking an output binding.
Inbound
inbound
operations are calls from the sidecar to your application, such as:
- 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, you can specify whether circuit breaking state should be scoped to:
- An individual actor ID.
- All actors across the actor type.
Specify circuitBreakerScope
with values id
, type
, or both
.
You can specify a cache size for the number of circuit breakers to keep in memory. Do this by specifying circuitBreakerCacheSize
and providing an integer value, e.g. 5000
.
Example