From 4aa099d3c0e39a7c2ca3b74bdfac0f8eac37382c Mon Sep 17 00:00:00 2001 From: Krystof Stekovic Date: Mon, 27 Oct 2025 15:39:42 +0100 Subject: [PATCH] [WFLY-21068] Fix Kafka resource deletion order in microprofile-reactive-messaging-kafka quickstart --- .../README-source.adoc | 1 + .../charts/kafka-on-openshift.yaml | 12 ------------ .../charts/kafka-topic.yaml | 10 ++++++++++ .../helm-install-prerequisites-openshift.adoc | 8 +++++++- 4 files changed, 18 insertions(+), 13 deletions(-) create mode 100644 microprofile-reactive-messaging-kafka/charts/kafka-topic.yaml diff --git a/microprofile-reactive-messaging-kafka/README-source.adoc b/microprofile-reactive-messaging-kafka/README-source.adoc index 74aaf14de6..eeef3925f8 100644 --- a/microprofile-reactive-messaging-kafka/README-source.adoc +++ b/microprofile-reactive-messaging-kafka/README-source.adoc @@ -982,6 +982,7 @@ bin/kafka-topics.sh --create --topic testing --bootstrap-server localhost:9092 // OpenShift include::../shared-doc/build-and-run-the-quickstart-with-openshift.adoc[leveloffset=+1] ---- +$ oc delete -f ./charts/kafka-topic.yaml --wait --timeout=10m0s $ oc delete -f ./charts/kafka-on-openshift.yaml --wait --timeout=10m0s $ oc delete -f ./charts/amq-operator-on-openshift.yaml --wait --timeout=10m0s ---- diff --git a/microprofile-reactive-messaging-kafka/charts/kafka-on-openshift.yaml b/microprofile-reactive-messaging-kafka/charts/kafka-on-openshift.yaml index 3b7016b9a4..1a8800731d 100644 --- a/microprofile-reactive-messaging-kafka/charts/kafka-on-openshift.yaml +++ b/microprofile-reactive-messaging-kafka/charts/kafka-on-openshift.yaml @@ -59,15 +59,3 @@ spec: type: ephemeral entityOperator: topicOperator: {} - ---- -# create a topic in Kafka Stream instance -apiVersion: kafka.strimzi.io/v1beta2 -kind: KafkaTopic -metadata: - name: testing - labels: - strimzi.io/cluster: my-cluster -spec: - partitions: 3 - replicas: 3 \ No newline at end of file diff --git a/microprofile-reactive-messaging-kafka/charts/kafka-topic.yaml b/microprofile-reactive-messaging-kafka/charts/kafka-topic.yaml new file mode 100644 index 0000000000..68d10d7202 --- /dev/null +++ b/microprofile-reactive-messaging-kafka/charts/kafka-topic.yaml @@ -0,0 +1,10 @@ +# create a topic in Kafka Stream instance +apiVersion: kafka.strimzi.io/v1beta2 +kind: KafkaTopic +metadata: + name: testing + labels: + strimzi.io/cluster: my-cluster +spec: + partitions: 3 + replicas: 3 diff --git a/microprofile-reactive-messaging-kafka/helm-install-prerequisites-openshift.adoc b/microprofile-reactive-messaging-kafka/helm-install-prerequisites-openshift.adoc index 52064f5f6d..ef0e4aa100 100644 --- a/microprofile-reactive-messaging-kafka/helm-install-prerequisites-openshift.adoc +++ b/microprofile-reactive-messaging-kafka/helm-install-prerequisites-openshift.adoc @@ -25,12 +25,18 @@ NAME DISPLAY VERSION REPLACES amqstreams.v3.0.0-13 Streams for Apache Kafka 3.0.0-13 amq-streams.v3.0.0-9 Succeeded ---- -Then you can set up a Kafka cluster called `my-cluster` with topic `testing` in your project: +Then you can set up a Kafka cluster called `my-cluster` in your project: [options="nowrap",subs="+attributes"] ---- $ oc apply -f ./charts/kafka-on-openshift.yaml --wait --timeout=10m0s ---- +Once the Kafka cluster is ready, create the topic `testing`: +[options="nowrap",subs="+attributes"] +---- +$ oc apply -f ./charts/kafka-topic.yaml --wait --timeout=10m0s +---- + Although the above commands will return pretty immediately, your AMQ Streams instance will not be available until its entity operator is up and running. The name of the pod will be of the format `my-cluster-entity-operator-xxxxxxxxx-yyyyy`. To be on the safe side, wait until this pod is ready, as shown in this example: