- You need to have knative-service and knative-eventing in your kubernetes:
kubectl get namespaces
- Then, you should have a broker created named example-broker, if not you can create it with:
kn broker create example-broker
- Create the cloudevents player:
kn service create cloudevents-player -image quay.io/ruben/cloudevents-player:latest
- Define a sink between the cloudevents player and the broker:
kn source binding create ce-player-binding --subject "Service:serving.knative.dev/v1:cloudevents-player" --sink broker:example-broker
- Deploy python service:
cd knative-eventing-cloudevents-python
kn func build . -i dev.local/knative-eventing-cloudevents-python:latest
kubectl apply -f service.yaml
cd ..
- Deploy quarkus service:
cd knative-eventing-cloudevents-quarkus
kn func build . -i dev.local/knative-eventing-cloudevents-quarkus:latest
kubectl apply -f service.yaml
cd ..
- Check that the services are running:
kn service list
- Create the triggers:
kn trigger create cloudevents-trigger --sink cloudevents-player --broker example-broker
kn trigger create quarkus-trigger --sink ke-ce-quarkus --broker example-broker --filter type=event.type3
kn trigger create python-trigger --sink ke-ce-python --broker example-broker --filter type=event.type2
- Check that everything is ready:
kn trigger list
kn source list
kn service list
- Go to your cloudevent player http page in your browser (you can check the endpoint with kn service list).
- Send a message of type event.type2.
{"type": "type2", "users":[{"age":15,"name":"Luis"}]}
you should see that the cloudevent player receive three different events: