Once Strimzi and Knative are installed, deploy the following to the default
namespace
k apply -f ...
for the topic:
apiVersion: kafka.strimzi.io/v1alpha1
kind: KafkaTopic
metadata:
namespace: kafka
name: my-demo-test-apps
--- | |
# eventing.yaml | |
apiVersion: v1 | |
kind: Namespace | |
metadata: | |
labels: | |
istio-injection: enabled | |
name: knative-eventing |
#!/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 |
apiVersion: v1 | |
kind: Namespace | |
metadata: | |
name: knative-sources | |
--- | |
apiVersion: v1 | |
kind: ServiceAccount | |
metadata: | |
name: controller-manager |
#!/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 |
apiVersion: kafka.strimzi.io/v1alpha1 | |
kind: Kafka | |
metadata: | |
name: my-cluster | |
spec: | |
kafka: | |
version: 2.1.0 | |
replicas: 1 | |
listeners: | |
plain: {} |
Once Strimzi and Knative are installed, deploy the following to the default
namespace
k apply -f ...
for the topic:
apiVersion: kafka.strimzi.io/v1alpha1
kind: KafkaTopic
metadata:
namespace: kafka
name: my-demo-test-apps
apiVersion: sources.eventing.knative.dev/v1alpha1 | |
kind: ContainerSource | |
metadata: | |
name: my-kafka-source | |
spec: | |
image: quay.io/matzew/kafka-src | |
args: | |
- '--bootstrap=my-cluster-kafka-bootstrap.myproject.svc.cluster.local:9092' | |
- '--topic=my-topic' | |
- '--groupId=foobar' |
package io.smallrye.reactive.messaging.example.eventclouds; | |
import io.smallrye.reactive.messaging.cloudevents.CloudEventMessage; | |
import io.smallrye.reactive.messaging.cloudevents.CloudEventMessageBuilder; | |
import io.smallrye.reactive.messaging.http.HttpMessage; | |
import io.smallrye.reactive.messaging.kafka.KafkaMessage; | |
import org.eclipse.microprofile.reactive.messaging.Incoming; | |
import org.eclipse.microprofile.reactive.messaging.Outgoing; | |
import javax.enterprise.context.ApplicationScoped; |
apiVersion: serving.knative.dev/v1alpha1 | |
kind: Service | |
metadata: | |
name: some-dumper | |
spec: | |
runLatest: | |
configuration: | |
revisionTemplate: | |
spec: | |
container: |