Knative: Operator’s Handbook

Replying to events

A Service can optionally reply to an event with another event. The reply will go back into Knative Eventing system like any other event.

This is an example from Knative Docs on how to reply to an event in Go:

newEvent := cloudevents.NewEvent()
newEvent.SetID(uuid.New().String())
newEvent.SetSource("knative/eventing/samples/hello-world")
newEvent.SetType("dev.knative.samples.hifromknative")
newEvent.SetData(HiFromKnative{Msg: "Hi from Knative!"})
response.RespondWith(200, &newEvent)

The reply is routed per delivery method: