Sources and their slightly less visible companion, Sinks, are the bread-and-butter concepts you use most often in Knative Eventing. Quickly revisiting: a Source describes a thing that can emit CloudEvents and a place (the Sink) where those events should be sent. Sources are the canonical way of describing how CloudEvents will move between points in a Knative Eventing design. Luckily, these are not super-complicated, so this chapter will be relatively brief.
In this section, I’m going to briefly look at the anatomy of Sources, then we’ll poke one to see how it works. It’s worth remembering that while I am putting “Source” and “Sink” on the same conceptual level, Knative’s structure is that Sources are the top-level concept and that Sinks are a component of Sources.
Figure 7.1 is a representation of a Source, as seen by an X-ray machine. In figure 7.1, I’ve represented a Source as having two parts, but confusingly, only one is actually labeled ‘Source’. That box contains Sink and CloudEventOverrides. Then underneath is the very helpful ??? box. We’ll profit from ??? in a second, but first, what’s the duck inside the octagon all about?