Skip to content

Instantly share code, notes, and snippets.

View matzew's full-sized avatar
💩
hacking hacking hacking!

Matthias Wessendorf matzew

💩
hacking hacking hacking!
  • Red Hat
  • Emsdetten, Germany
View GitHub Profile
View Improved_Event_Delivery_Guarantees.md

Event Delivery Guarantees with Knative Broker

By default the Knative Broker does a number of retry attempts based on the response code of the Addressable. The entire list is visible here.

The default is 10 reties with exponential backoff and a delay of 0.2 second. Details about the Event-Delivery knobs for the broker can be found here.

Tweaking the broker

Below is a broker that tweaks the default settings for its needs:

View k8s-source.yaml
apiVersion: serving.knative.dev/v1
kind: Service
metadata:
name: k8s-display
spec:
template:
spec:
containers:
- image: quay.io/openshift-knative/knative-eventing-sources-event-display
---
View Knative_Event_Mesh.md
View Kafka_sample.md

Assuming Strimzi is running in KAFKA namespace

This pumps date to mytopic:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: ws-dumper
spec:
View kafkacat_debugging.md
View strimzi-tls.sh
#!/usr/bin/env bash
set -e
# Turn colors in this script off by setting the NO_COLOR variable in your
# environment to any value:
#
# $ NO_COLOR=1 test.sh
NO_COLOR=${NO_COLOR:-""}
if [ -z "$NO_COLOR" ]; then
View From_CloudEvent_to_Kafka.md

Stream Knative HTTP CloudEvents into Apache Kafka

With Knative eventing, you can use a source, to receive events for a 3rd party system, and have them sent as CloudEvents to a HTTP webserver, like:

apiVersion: sources.knative.dev/v1alpha2
kind: PingSource
metadata:
  name: ping-source
spec:
View logs.md
 k logs -f -l serving.knative.dev/service=map-display -c user-container -n debezium-knative-demo

2020-05-28 10:49:32,396 INFO  [io.sma.rea.mes.ext.MediatorManager] (main) Deployment done... start processing
2020-05-28 10:49:32,405 INFO  [io.sma.rea.mes.imp.ConfiguredChannelFactory] (main) Found incoming connectors: [smallrye-kafka]
2020-05-28 10:49:32,406 INFO  [io.sma.rea.mes.imp.ConfiguredChannelFactory] (main) Found outgoing connectors: [smallrye-kafka]
2020-05-28 10:49:32,406 INFO  [io.sma.rea.mes.imp.ConfiguredChannelFactory] (main) Stream manager initializing...
2020-05-28 10:49:32,409 INFO  [io.sma.rea.mes.ext.MediatorManager] (main) Initializing mediators
2020-05-28 10:49:32,410 INFO  [io.sma.rea.mes.ext.MediatorManager] (main) Connecting mediators
### Starting up ###
View Broker_as_non_admin.md
View error.json
{"level":"error","ts":"2020-04-03T11:56:12.512Z","logger":"mt-broker-controller","caller":"namespace/reconciler.go:195","msg":"returned an error","knative.dev/traceid":"65900ed8-0a9a-481b-95f0-73500d6e68e6","knative.dev/key":"default","targetMethod":"ReconcileKind","error":"broker: brokers.eventing.knative.dev \"default\" is forbidden: cannot set blockOwnerDeletion if an ownerReference refers to a resource you can't set finalizers on: RBAC: clusterrole.rbac.authorization.k8s.io \"knative-eventing-channel-broker-controller\" not found, <nil>","stacktrace":"knative.dev/eventing/vendor/knative.dev/pkg/client/injection/kube/reconciler/core/v1/namespace.(*reconcilerImpl).Reconcile\n\tknative.dev/eventing/vendor/knative.dev/pkg/client/injection/kube/reconciler/core/v1/namespace/reconciler.go:195\nknative.dev/eventing/vendor/knative.dev/pkg/controller.(*Impl).processNextWorkItem\n\tknative.dev/eventing/vendor/knative.dev/pkg/controller/controller.go:394\nknative.dev/eventing/vendor/knative.dev/pkg/controller.(*Imp