You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by nf...@apache.org on 2022/03/04 18:08:59 UTC

[camel-examples] 01/01: CAMEL-17727: Add the docker-compose file in jbang-kafka-health

This is an automated email from the ASF dual-hosted git repository.

nfilotto pushed a commit to branch CAMEL-17727/add-missing-docker-compose-file
in repository https://gitbox.apache.org/repos/asf/camel-examples.git

commit ab66b02b116a5420942e2de43c614f018aed4f7b
Author: Nicolas Filotto <nf...@talend.com>
AuthorDate: Fri Mar 4 19:07:12 2022 +0100

    CAMEL-17727: Add the docker-compose file in jbang-kafka-health
---
 examples/jbang-kafka-health/README.adoc        |  4 ++--
 examples/jbang-kafka-health/consumer.yaml      |  2 +-
 examples/jbang-kafka-health/docker-compose.yml | 27 ++++++++++++++++++++++++++
 examples/jbang-kafka-health/producer.yaml      |  2 +-
 4 files changed, 31 insertions(+), 4 deletions(-)

diff --git a/examples/jbang-kafka-health/README.adoc b/examples/jbang-kafka-health/README.adoc
index 66eab9a..015112a 100644
--- a/examples/jbang-kafka-health/README.adoc
+++ b/examples/jbang-kafka-health/README.adoc
@@ -25,7 +25,7 @@ and to start it again
 
 [source,sh]
 ----
-$ docker-compose stop
+$ docker-compose start
 ----
 
 And to shutdown when you no longer need the broker.
@@ -64,7 +64,7 @@ Then you can run this example using:
 
 [source,sh]
 ----
-$ camel run kafka-health.yaml --health
+$ camel run consumer.yaml producer.yaml --health
 ----
 
 Or run with JBang using the longer command line (without installing camel as app in JBang):
diff --git a/examples/jbang-kafka-health/consumer.yaml b/examples/jbang-kafka-health/consumer.yaml
index 12fa031..83ad2e0 100644
--- a/examples/jbang-kafka-health/consumer.yaml
+++ b/examples/jbang-kafka-health/consumer.yaml
@@ -4,6 +4,6 @@
     uri: "kamelet:kafka-not-secured-source"
     parameters:
       topic: "foobar"
-      bootstrapServers: 'localhost:29092'
+      bootstrapServers: 'localhost:9092'
     steps:
     - to: "log:info?showAll=true&multiline=true"
\ No newline at end of file
diff --git a/examples/jbang-kafka-health/docker-compose.yml b/examples/jbang-kafka-health/docker-compose.yml
new file mode 100644
index 0000000..ed882bf
--- /dev/null
+++ b/examples/jbang-kafka-health/docker-compose.yml
@@ -0,0 +1,27 @@
+---
+version: '3'
+services:
+  zookeeper:
+    image: confluentinc/cp-zookeeper:7.0.1
+    container_name: zookeeper
+    environment:
+      ZOOKEEPER_CLIENT_PORT: 2181
+      ZOOKEEPER_TICK_TIME: 2000
+
+  broker:
+    image: confluentinc/cp-kafka:7.0.1
+    container_name: broker
+    ports:
+      # To learn about configuring Kafka for access across networks see
+      # https://www.confluent.io/blog/kafka-client-cannot-connect-to-broker-on-aws-on-docker-etc/
+      - "9092:9092"
+    depends_on:
+      - zookeeper
+    environment:
+      KAFKA_BROKER_ID: 1
+      KAFKA_ZOOKEEPER_CONNECT: 'zookeeper:2181'
+      KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_INTERNAL:PLAINTEXT
+      KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://localhost:9092,PLAINTEXT_INTERNAL://broker:29092
+      KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
+      KAFKA_TRANSACTION_STATE_LOG_MIN_ISR: 1
+      KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR: 1
\ No newline at end of file
diff --git a/examples/jbang-kafka-health/producer.yaml b/examples/jbang-kafka-health/producer.yaml
index 18f050a..fac1aeb 100644
--- a/examples/jbang-kafka-health/producer.yaml
+++ b/examples/jbang-kafka-health/producer.yaml
@@ -4,4 +4,4 @@
     uri: "kamelet:chuck-norris-source"
     steps:
     - log: "${body}"
-    - to: "kamelet:kafka-not-secured-sink?topic=foobar&bootstrapServers=localhost:29092"
+    - to: "kamelet:kafka-not-secured-sink?topic=foobar&bootstrapServers=localhost:9092"