In these tutorial exercises, you learn how to enable a service to consume events on Knative Eventing.
Knative Eventing is a system that is designed to address a common need for cloud native development by providing composable primitives to enable late-binding between event producers and event consumers.
In Knative, event producers and event consumers are designed to be independent. Any producer can generate events before there are active event consumers that are listening. Any event consumer can express interest in an event or class of events, before there are producers that are creating those events.
Completing these exercises can help you understand Knative Eventing concepts and how to use these concepts to enable Knative service to consume events.
You learn two ways to consume events on Knative Eventing:
- With event sources, you can directly link an event consumer to a producer and simply define an event message flow from a producer to a consumer.
- With Broker and Trigger, you can decouple event producers and consumers. Broker is like an event hub where event producers send events to. Trigger describes an event consumer and its interested subscriptions to specific events that flow through the broker, which enables late-binding event producers and event consumers.
Before you begin, you’ll need the following:
- An IBM Cloud account.
- An IBM Kubernetes Service cluster is provisioned, with at least 2 worker nodes.
- Knative set up, as described in Setting up Knative in your cluster.
- An installed Kubernetes CLI.
- The Kubernetes CLI configured to manage the IBM Cloud Kubernetes Service, as described in Configing Kubernetes CLI to run kubectl.
It should take you about 30 minutes to complete this tutorial.
- Exercise 1: Subscribe to event producers by defining event sources
- Exercise 2: Manage events and subscriptions with
Broker
andTrigger
- Exercise 3: Add
Filter
toTrigger