Timestamp Router Action
Provided by: "Apache Software Foundation"
Support Level for this Kamelet is: "Preview"
Update the topic field as a function of the original topic name and the record timestamp.
Configuration Options
The following table summarizes the configuration options available for the timestamp-router-action
Kamelet:
Property | Name | Description | Type | Default | Example |
---|---|---|---|---|---|
Timestamp Format |
Format string for the timestamp that is compatible with java.text.SimpleDateFormat. |
string |
yyyyMMdd |
||
Timestamp Header Name |
The name of the header containing a timestamp. |
string |
kafka.TIMESTAMP |
||
Topic Format |
Format string which can contain '$[topic]' and '$[timestamp]' as placeholders for the topic and timestamp, respectively. |
string |
topic-$[timestamp] |
Dependencies
At runtime, the timestamp-router-action
Kamelet relies upon the presence of the following dependencies:
-
mvn:org.apache.camel.kamelets:camel-kamelets-utils:0.6.0
-
camel:kamelet
-
camel:core
Usage
This section describes how you can use the timestamp-router-action
.
Knative action
You can use the timestamp-router-action
Kamelet as an intermediate step in a Knative binding.
apiVersion: camel.apache.org/v1alpha1
kind: KameletBinding
metadata:
name: timestamp-router-action-binding
spec:
source:
ref:
kind: Kamelet
apiVersion: camel.apache.org/v1alpha1
name: timer-source
properties:
message: Hello
steps:
- ref:
kind: Kamelet
apiVersion: camel.apache.org/v1alpha1
name: timestamp-router-action
sink:
ref:
kind: Channel
apiVersion: messaging.knative.dev/v1
name: mychannel
Prerequisite
You have Camel K installed on the cluster.
Kafka action
You can use the timestamp-router-action
Kamelet as an intermediate step in a Kafka binding.
apiVersion: camel.apache.org/v1alpha1
kind: KameletBinding
metadata:
name: timestamp-router-action-binding
spec:
source:
ref:
kind: Kamelet
apiVersion: camel.apache.org/v1alpha1
name: timer-source
properties:
message: Hello
steps:
- ref:
kind: Kamelet
apiVersion: camel.apache.org/v1alpha1
name: timestamp-router-action
sink:
ref:
kind: KafkaTopic
apiVersion: kafka.strimzi.io/v1beta1
name: my-topic
Prerequisites
-
You’ve installed Strimzi.
-
You’ve created a topic named
my-topic
in the current namespace. -
You have Camel K installed on the cluster.