apiVersion: eventing.knative.dev/v1
kind: Trigger
metadata:
name: <trigger_name>
annotations:
kafka.eventing.knative.dev/delivery.order: ordered
# ...
In Knative Eventing, the delivery order of events plays a critical role in ensuring messages are processed according to application requirements. When using a Kafka broker, you can specify whether events should be delivered in order or without strict ordering. By configuring the delivery order, you can optimize event handling for use cases that require sequential processing or prioritize performance for unordered delivery.
If you are using a Kafka broker, you can configure the delivery order of events from triggers to event sinks.
The OpenShift Serverless Operator, Knative Eventing, and Knative Kafka are installed on your OpenShift Container Platform cluster.
Kafka broker is enabled for use on your cluster, and you have created a Kafka broker.
You have created a project or have access to a project with the appropriate roles and permissions to create applications and other workloads in OpenShift Container Platform.
You have installed the OpenShift (oc
) CLI.
Create or modify a Trigger
object and set the kafka.eventing.knative.dev/delivery.order
annotation using the following example Trigger YAML file::
apiVersion: eventing.knative.dev/v1
kind: Trigger
metadata:
name: <trigger_name>
annotations:
kafka.eventing.knative.dev/delivery.order: ordered
# ...
The supported consumer delivery guarantees are:
unordered
An unordered consumer is a non-blocking consumer that delivers messages unordered, while preserving proper offset management.
ordered
An ordered consumer is a per-partition blocking consumer that waits for a successful response from the CloudEvent subscriber before it delivers the next message of the partition.
The default ordering guarantee is unordered
.
Apply the Trigger
object using the following command::
$ oc apply -f <filename>
Configure event delivery parameters that are applied in cases where an event fails to be delivered to an event sink.