You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2021/07/23 12:01:08 UTC

[camel-k-examples] branch timestamp-router created (now 0d0b548)

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

acosentino pushed a change to branch timestamp-router
in repository https://gitbox.apache.org/repos/asf/camel-k-examples.git.


      at 0d0b548  Added a Kafka to Kafka with Timestamp Router Action Example

This branch includes the following new commits:

     new 5f88ec5  Added a Kafka to Kafka with Timestamp Router Action Example
     new 0d0b548  Added a Kafka to Kafka with Timestamp Router Action Example

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


[camel-k-examples] 01/02: Added a Kafka to Kafka with Timestamp Router Action Example

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch timestamp-router
in repository https://gitbox.apache.org/repos/asf/camel-k-examples.git

commit 5f88ec5afd1d879fd93dc0496f1e8ece3b4d3a15
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Fri Jul 23 13:54:20 2021 +0200

    Added a Kafka to Kafka with Timestamp Router Action Example
---
 .../kafka-to-kafka-with-timestamp-router/README.md | 18 +++++++++++
 .../flow-binding.yaml                              | 37 ++++++++++++++++++++++
 .../log-sink.kamelet.yaml                          | 22 +++++++++++++
 3 files changed, 77 insertions(+)

diff --git a/kamelets/kafka-to-kafka-with-timestamp-router/README.md b/kamelets/kafka-to-kafka-with-timestamp-router/README.md
new file mode 100644
index 0000000..34cf15b
--- /dev/null
+++ b/kamelets/kafka-to-kafka-with-timestamp-router/README.md
@@ -0,0 +1,18 @@
+# Kafka to Kafka with Timestamp Router
+
+- Use the quickstart for https://strimzi.io/quickstarts/ and follow the minikube guide.
+
+- The Log Sink Kamelet is not available out of the box in 1.5.0 Camel-K release so you'll have to install it before installing the flow binding.
+
+- If camel-k has been installed in a specific namespace different from the default one, you'll need to add a parameter to all the commands (-n <namespace_name>)
+
+- Run the following commands
+
+kubectl apply -f log-sink.kamelet.yaml 
+kubectl apply -f flow-binding.yaml 
+
+- Check logs
+
+kamel logs kafka-to-kafka-with-timestamp-router 
+
+You should data ingesting from test-topic topic, into a $[topic]_$[timestamp] topic, based on the record timestamp.
diff --git a/kamelets/kafka-to-kafka-with-timestamp-router/flow-binding.yaml b/kamelets/kafka-to-kafka-with-timestamp-router/flow-binding.yaml
new file mode 100644
index 0000000..0fc744a
--- /dev/null
+++ b/kamelets/kafka-to-kafka-with-timestamp-router/flow-binding.yaml
@@ -0,0 +1,37 @@
+apiVersion: camel.apache.org/v1alpha1
+kind: KameletBinding
+metadata:
+  name: kafka-to-kafka-with-timestamp-router
+spec:
+  source:
+    ref:
+      kind: Kamelet
+      apiVersion: camel.apache.org/v1alpha1
+      name: kafka-not-secured-source
+    properties:
+      brokers: 'my-cluster-kafka-bootstrap:9092'
+      topic: 'test-topic'
+  steps:
+  -  ref:
+      kind: Kamelet
+      apiVersion: camel.apache.org/v1alpha1
+      name: log-sink
+  - ref:
+      kind: Kamelet
+      apiVersion: camel.apache.org/v1alpha1
+      name: timestamp-router-action
+    properties:
+      topicFormat: '$[topic]_$[timestamp]'
+      timestampFormat: 'YYYY-MM-dd'
+  - ref:
+      kind: Kamelet
+      apiVersion: camel.apache.org/v1alpha1
+      name: log-sink
+  sink:
+    ref:
+      kind: Kamelet
+      apiVersion: camel.apache.org/v1alpha1
+      name: kafka-not-secured-sink
+    properties:
+      brokers: 'my-cluster-kafka-bootstrap:9092'
+      topic: 'test-topic-2'
diff --git a/kamelets/kafka-to-kafka-with-timestamp-router/log-sink.kamelet.yaml b/kamelets/kafka-to-kafka-with-timestamp-router/log-sink.kamelet.yaml
new file mode 100755
index 0000000..a48fb41
--- /dev/null
+++ b/kamelets/kafka-to-kafka-with-timestamp-router/log-sink.kamelet.yaml
@@ -0,0 +1,22 @@
+apiVersion: camel.apache.org/v1alpha1
+kind: Kamelet
+metadata:
+  name: log-sink
+  annotations:
+    camel.apache.org/kamelet.icon: "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNDAgMjQwIj48ZGVmcz48bGluZWFyR3JhZGllbnQgaWQ9ImEiIHgxPSIuNjY3IiB4Mj0iLjQxNyIgeTE9Ii4xNjciIHkyPSIuNzUiPjxzdG9wIG9mZnNldD0iMCIgc3RvcC1jb2xvcj0iIzM3YWVlMiIvPjxzdG9wIG9mZnNldD0iMSIgc3RvcC1jb2xvcj0iIzFlOTZjOCIvPjwvbGluZWFyR3JhZGllbnQ+PGxpbmVhckdyYWRpZW50IGlkPSJiIiB4MT0iLjY2IiB4Mj0iLjg1MSIgeTE9Ii40MzciIHkyPSIuODAyIj48c3RvcCBvZmZzZXQ9IjAiIHN0b3AtY29sb3I9IiNlZmY3Zm [...]
+    camel.apache.org/provider: "Apache Software Foundation"
+  labels:
+    camel.apache.org/kamelet.type: "sink"
+    camel.apache.org/kamelet.group: "Log"
+spec:
+  definition:
+    title: "Log Sink"
+    description: |-
+      Log something
+    type: object
+  flow:
+    from:
+      uri: "kamelet:source"
+      steps:
+      - to:
+          uri: "log:info?showAll=true"

[camel-k-examples] 02/02: Added a Kafka to Kafka with Timestamp Router Action Example

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch timestamp-router
in repository https://gitbox.apache.org/repos/asf/camel-k-examples.git

commit 0d0b548ddf2563d7a0966f5282ba992195b5b97a
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Fri Jul 23 14:00:06 2021 +0200

    Added a Kafka to Kafka with Timestamp Router Action Example
---
 kamelets/README.md | 1 +
 1 file changed, 1 insertion(+)

diff --git a/kamelets/README.md b/kamelets/README.md
index 65937b9..bfdb7a3 100644
--- a/kamelets/README.md
+++ b/kamelets/README.md
@@ -16,3 +16,4 @@ All the Kamelet examples in this folder have been tested on Camel-K 1.5.0.
 - [AWS S3 to Kafka with Timestamp router](./aws-s3-to-kafka-with-timestamp-router): Create a Kamelet binding between an AWS S3 Source Kamelet and a Kafka Sink Kamelet, with the usage of the Timestamp Router Action.
 - [Kafka to Kafka with Regex router](./kafka-to-kafka-with-regex-router): Create a Kamelet binding between a Kafka Source Kamelet and a Kafka Sink Kamelet, with the usage of the Regex Router Action.
 - [Kafka to Kafka with Manual commit](./kafka-to-kafka-with-manual-commit): Create a Kamelet binding between a Kafka Source Kamelet and a Kafka Sink Kamelet, with the usage of the Manual Commit Action.
+- [Kafka to Kafka with Timestamp router](./kafka-to-kafka-with-timestamp-router): Create a Kamelet binding between a Kafka Source Kamelet and a Kafka Sink Kamelet, with the usage of the Timestamp Router Action.