tadayosi commented on code in PR #64:
URL: https://github.com/apache/camel-k-examples/pull/64#discussion_r931706761


##########
generic-examples/kafka/sasl_ssl/SaslSSLKafkaProducer.java:
##########
@@ -23,12 +23,12 @@
 public class SaslSSLKafkaProducer extends RouteBuilder {
   @Override
   public void configure() throws Exception {
-  log.info("About to start route: Timer -> Kafka ");
-  from("timer:foo")
-    .routeId("FromTimer2Kafka")
-    .setBody()
-      .simple("Message #${exchangeProperty.CamelTimerCounter}")
-         .to("kafka:{{producer.topic}}")
-    .log("Message correctly sent to the topic!");
+    log.info("About to start route: Timer -> Kafka ");
+    from("timer:foo")

Review Comment:
   This indentation can be better. Can we have something like this?
   ```
       from("timer:foo")
           .routeId("FromTimer2Kafka")
           .setBody()
               .simple("Message #${exchangeProperty.CamelTimerCounter}")
           .to("kafka:{{producer.topic}}")
           .log("Message correctly sent to the topic!");
   ```



##########
generic-examples/kafka/README.md:
##########
@@ -1,30 +1,52 @@
-# Kafka Camel K examples
+# Camel K with Kafka examples
 
-This example shows how Camel K can be used to connect to a Kafka broker.
+These examples show how to connect to a Kafka broker in a Camel K integration.
+
+You can find more information about Apache Camel and Apache Camel K on the 
[official Camel website](https://camel.apache.org).
+
+## Before you begin
+
+Read the general instructions in the [root README.md file](/README.md) for 
setting up your environment and the Kubernetes cluster before looking at this 
example.
+
+Make sure you've read the [installation 
instructions](https://camel.apache.org/camel-k/latest/installation/installation.html)
 for your specific
+cluster before starting the example.
+
+## Additional Requirements for running the examples
+**A Kafka broker**: handles the storage and passing of messages.
 
 ## Authentication to Kafka
 
-We have a dedicated section to show [how to authenticate Camel K to 
Kafka](./sasl_ssl/).
+To use Kafka with authentication, we have a dedicated section to show [how to 
authenticate Camel K to Kafka](./sasl_ssl/). \
+For a simple use case without client authentication, continue with this guide.
+
+## Understanding the example
+- [SampleKafkaConsumer.java](./SampleKafkaConsumer.java): contains a route 
that reads message from a kafka topic and logs the message
+- [application.properties](./application.properties): holds properties 
required to connect to kafka broker and read from topic.
 
 ## Simple usage
 
-To run this example first set-up Kafka on your k8s cluster.
-A convenient way to do so is by using the Strimzi project, if you are using 
minikube follow these instructions at https://strimzi.io/quickstarts/minikube/
+To run this example, first set-up Kafka on your k8s cluster.
+A convenient way to do so is by using the Strimzi project. Visit 
https://strimzi.io/quickstarts/ for set-up instructions. For the instructions 
on the linked site, it will suffice to only apply the Strimzi installation file 
and provision the kafka cluster.
 
-For convenience create a configmap to contain the properties:
+IMPORTANT: The `kafka.host` value in `application.properties` needs to be set 
to the CLUSTER-IP address of the my-cluster-kafka-bootstrap service in the 
kafka namespace. To do this run:
 ```
-kubectl create configmap kafka.props  
--from-file=examples/kafka/application.properties
+kafkaip=`kubectl get svc/my-cluster-kafka-bootstrap -n kafka 
-ojsonpath="{.spec.clusterIP}"`; sed -i "/kafka\.host/s/<.*>/$kafkaip/g" 
application.properties
+```
+
+Create a configmap to contain the properties:
+```
+kubectl create configmap kafka.props  --from-file=application.properties
 ```
 
-IMPORTANT: The kafka.host value in application.properties needs to be set to 
the CLUSTER-IP address of the my-cluster-kafka-bootstrap service in the kafka 
namespace:
- `kubectl get services -n kafka | grep my-cluster-kafka-bootstrap | awk 
'/[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/ {print $3}'`
+
 
 Finally run this sample using the command:
 ```
-./kamel run examples/kafka/SampleKafkaConsumer.java 
--config=configmap:kafka.props
+kamel run SampleKafkaConsumer.java --config=configmap:kafka.props --dev

Review Comment:
   Here we don't specifically need `--dev`.



##########
generic-examples/kafka/README.md:
##########
@@ -1,30 +1,52 @@
-# Kafka Camel K examples
+# Camel K with Kafka examples
 
-This example shows how Camel K can be used to connect to a Kafka broker.
+These examples show how to connect to a Kafka broker in a Camel K integration.
+
+You can find more information about Apache Camel and Apache Camel K on the 
[official Camel website](https://camel.apache.org).
+
+## Before you begin
+
+Read the general instructions in the [root README.md file](/README.md) for 
setting up your environment and the Kubernetes cluster before looking at this 
example.
+
+Make sure you've read the [installation 
instructions](https://camel.apache.org/camel-k/latest/installation/installation.html)
 for your specific
+cluster before starting the example.
+
+## Additional Requirements for running the examples
+**A Kafka broker**: handles the storage and passing of messages.
 
 ## Authentication to Kafka
 
-We have a dedicated section to show [how to authenticate Camel K to 
Kafka](./sasl_ssl/).
+To use Kafka with authentication, we have a dedicated section to show [how to 
authenticate Camel K to Kafka](./sasl_ssl/). \
+For a simple use case without client authentication, continue with this guide.
+
+## Understanding the example
+- [SampleKafkaConsumer.java](./SampleKafkaConsumer.java): contains a route 
that reads message from a kafka topic and logs the message
+- [application.properties](./application.properties): holds properties 
required to connect to kafka broker and read from topic.
 
 ## Simple usage
 
-To run this example first set-up Kafka on your k8s cluster.
-A convenient way to do so is by using the Strimzi project, if you are using 
minikube follow these instructions at https://strimzi.io/quickstarts/minikube/
+To run this example, first set-up Kafka on your k8s cluster.
+A convenient way to do so is by using the Strimzi project. Visit 
https://strimzi.io/quickstarts/ for set-up instructions. For the instructions 
on the linked site, it will suffice to only apply the Strimzi installation file 
and provision the kafka cluster.
 
-For convenience create a configmap to contain the properties:
+IMPORTANT: The `kafka.host` value in `application.properties` needs to be set 
to the CLUSTER-IP address of the my-cluster-kafka-bootstrap service in the 
kafka namespace. To do this run:
 ```
-kubectl create configmap kafka.props  
--from-file=examples/kafka/application.properties
+kafkaip=`kubectl get svc/my-cluster-kafka-bootstrap -n kafka 
-ojsonpath="{.spec.clusterIP}"`; sed -i "/kafka\.host/s/<.*>/$kafkaip/g" 
application.properties
+```
+
+Create a configmap to contain the properties:
+```
+kubectl create configmap kafka.props  --from-file=application.properties
 ```
 
-IMPORTANT: The kafka.host value in application.properties needs to be set to 
the CLUSTER-IP address of the my-cluster-kafka-bootstrap service in the kafka 
namespace:
- `kubectl get services -n kafka | grep my-cluster-kafka-bootstrap | awk 
'/[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/ {print $3}'`
+
 
 Finally run this sample using the command:
 ```
-./kamel run examples/kafka/SampleKafkaConsumer.java 
--config=configmap:kafka.props
+kamel run SampleKafkaConsumer.java --config=configmap:kafka.props --dev
 ```
 
-To create messages to be read use the producer command from the Strimzi page:
+To create messages to be read, use the producer command from the Strimzi page. 
Run in another terminal:
+```
+kubectl -n kafka run kafka-producer -ti 
--image=quay.io/strimzi/kafka:0.30.0-kafka-3.2.0 --rm=true --restart=Never -- 
bin/kafka-console-producer.sh --bootstrap-server 
my-cluster-kafka-bootstrap:9092 --topic my-topic

Review Comment:
   We rarely use `--rm=true`. It can be simpler: `--rm`
   ```
   kubectl -n kafka run kafka-producer -it --rm 
--image=quay.io/strimzi/kafka:0.30.0-kafka-3.2.0 --restart=Never -- 
bin/kafka-console-producer.sh --bootstrap-server 
my-cluster-kafka-bootstrap:9092 --topic my-topic
   ```



##########
generic-examples/kafka/README.md:
##########
@@ -1,30 +1,52 @@
-# Kafka Camel K examples
+# Camel K with Kafka examples
 
-This example shows how Camel K can be used to connect to a Kafka broker.
+These examples show how to connect to a Kafka broker in a Camel K integration.
+
+You can find more information about Apache Camel and Apache Camel K on the 
[official Camel website](https://camel.apache.org).
+
+## Before you begin
+
+Read the general instructions in the [root README.md file](/README.md) for 
setting up your environment and the Kubernetes cluster before looking at this 
example.
+
+Make sure you've read the [installation 
instructions](https://camel.apache.org/camel-k/latest/installation/installation.html)
 for your specific
+cluster before starting the example.
+
+## Additional Requirements for running the examples
+**A Kafka broker**: handles the storage and passing of messages.
 
 ## Authentication to Kafka
 
-We have a dedicated section to show [how to authenticate Camel K to 
Kafka](./sasl_ssl/).
+To use Kafka with authentication, we have a dedicated section to show [how to 
authenticate Camel K to Kafka](./sasl_ssl/). \
+For a simple use case without client authentication, continue with this guide.
+
+## Understanding the example
+- [SampleKafkaConsumer.java](./SampleKafkaConsumer.java): contains a route 
that reads message from a kafka topic and logs the message
+- [application.properties](./application.properties): holds properties 
required to connect to kafka broker and read from topic.
 
 ## Simple usage
 
-To run this example first set-up Kafka on your k8s cluster.
-A convenient way to do so is by using the Strimzi project, if you are using 
minikube follow these instructions at https://strimzi.io/quickstarts/minikube/
+To run this example, first set-up Kafka on your k8s cluster.
+A convenient way to do so is by using the Strimzi project. Visit 
https://strimzi.io/quickstarts/ for set-up instructions. For the instructions 
on the linked site, it will suffice to only apply the Strimzi installation file 
and provision the kafka cluster.
 
-For convenience create a configmap to contain the properties:
+IMPORTANT: The `kafka.host` value in `application.properties` needs to be set 
to the CLUSTER-IP address of the my-cluster-kafka-bootstrap service in the 
kafka namespace. To do this run:

Review Comment:
   Since Markdown doesn't have admonition, `IMPORTANT:` can be bold 
`**IMPORTANT:**` to make it eye-catching.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@camel.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to