We use analytics and cookies to understand site traffic. Information about your use of our site is shared with Google for that purpose. Learn more.
Event delivery
You can configure how events are delivered for each broker by adding a delivery
spec, as shown in the following example:
apiVersion: eventing.knative.dev/v1
kind: Broker
metadata:
name: with-dead-letter-sink
spec:
delivery:
deadLetterSink:
ref:
apiVersion: serving.knative.dev/v1
kind: Service
name: example-sink
backoffDelay: <duration>
backoffPolicy: <policy-type>
retry: <integer>
Where
- The
deadLetterSink
spec contains configuration settings to enable using a dead letter sink. This tells the subscription what happens to events that cannot be delivered to the subscriber. When this is configured, events that fail to be delivered are sent to the dead letter sink destination. The destination can be any Addressable object that conforms to the Knative Eventing sink contract, such as a Knative service, a Kubernetes service, or a URI. In the example, the destination is aService
object, or Knative service, namedexample-sink
. - The
backoffDelay
delivery parameter specifies the time delay before an event delivery retry is attempted after a failure. The duration of thebackoffDelay
parameter is specified using the ISO 8601 format. For example,PT1S
specifies a 1 second delay. - The
backoffPolicy
delivery parameter can be used to specify the retry back off policy. The policy can be specified as eitherlinear
orexponential
. When using thelinear
back off policy, the back off delay is the time interval specified between retries. This is a linearly increasing delay, which means that the back off delay increases by the given interval for each retry. When using theexponential
back off policy, the back off delay increases by a multiplier of the given interval for each retry. retry
specifies the number of times that event delivery is retried before the event is sent to the dead letter sink. The initial delivery attempt is not included in the retry count, so the total number of delivery attempts is equal to theretry
value +1.
Broker Support
The following table summarizes which delivery parameters are supported for each broker implementation type:
Broker Class | Supported Delivery Parameters |
---|---|
googlecloud | deadLetterSink 1, retry , backoffPolicy , backoffDelay 2 |
Kafka | deadLetterSink , retry , backoffPolicy , backoffDelay |
MTChannelBasedBroker | depends on the underlying channel |
RabbitMQBroker | deadLetterSink , retry , backoffPolicy , backoffDelay |
-
deadLetterSink must be a GCP Pub/Sub topic URI:
deadLetterSink: uri: pubsub://dead-letter-topic
See the
config-br-delivery
ConfigMap for a complete example. ↩︎ -
The
googlecloud
broker only supports theexponential
back off policy. ↩︎
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.