Developer configuration options

Broker configuration

  • You can specify any valid name for your broker. Using default will create a broker named default.
  • The namespace must be an existing namespace in your cluster. Using default will create the broker in the default namespace.

Event Delivery Options

  • You can use dead-letter sink for error handling and auditing of undelivered messages. Specify Kubernetes object reference where undelivered messages will be sent using ref and an optional URI to route undelivered messages using uri.
  • You can set the Backoff policies to define the delay strategy between retry attempts. It can be exponential or linear.
  • You can set the Backoff delay to specify the initial delay before retrying, using the ISO 8601 duration format.
  • You can specify the number of retry attempts before sending the event to the dead-letter sink using the retry configuration.
  • spec.delivery is used to configure event delivery options. Event delivery options specify what happens to an event that fails to be delivered to an event sink. For more information, see the documentation on Event delivery.

Advanced broker class options

When a Broker is created without a specified eventing.knative.dev/broker.class annotation, by default the MTChannelBasedBroker Broker class is used, as specified in the config-br-defaults ConfigMap.

In case you have multiple Broker classes installed in your cluster and want to use a non-default Broker class for a Broker, you can modify the eventing.knative.dev/broker.class annotation and spec.config for the Broker object.

  1. Set the eventing.knative.dev/broker.class annotation. Replace MTChannelBasedBroker in the following example with the class type you want to use. Be aware that the Broker class annoation is immutable and thus can’t be updated after the Broker got created:

  2. Configure the spec.config with the details of the ConfigMap that defines the required configuration for the Broker class (e.g. with some Channel configurations in case of the MTChannelBasedBroker):

For further information about configuring a default Broker class cluster wide or on a per namespace basis, check the Administrator configuration options.

Broker configuration example

The following is a full example of a Channel based Broker object which shows the possible configuration options that you can modify:

  1. apiVersion: eventing.knative.dev/v1
  2. kind: Broker
  3. metadata:
  4. name: default
  5. namespace: default
  6. annotations:
  7. eventing.knative.dev/broker.class: MTChannelBasedBroker
  8. spec:
  9. config:
  10. apiVersion: v1
  11. kind: ConfigMap
  12. name: config-br-default-channel
  13. namespace: knative-eventing
  14. delivery:
  15. deadLetterSink:
  16. ref:
  17. kind: Service
  18. namespace: example-namespace
  19. name: example-service
  20. apiVersion: v1
  21. uri: example-uri
  22. retry: 5
  23. backoffPolicy: exponential
  24. backoffDelay: "PT1S"