This is an automated email from the ASF dual-hosted git repository. nferraro pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel-kamelets.git
commit bf9c06ae3d3f3b7f49e9a93bc33a7846514754b7 Author: nicolaferraro <ni.ferr...@gmail.com> AuthorDate: Wed Jan 12 13:38:52 2022 +0100 Add delay action --- .../ROOT/assets/images/kamelets/delay-action.svg | 1 + docs/modules/ROOT/nav.adoc | 156 ++++++++++++++++++++ docs/modules/ROOT/pages/delay-action.adoc | 160 +++++++++++++++++++++ kamelets/delay-action.kamelet.yaml | 51 +++++++ .../resources/kamelets/delay-action.kamelet.yaml | 51 +++++++ .../bindings/camel-k/delay-action-binding.yaml | 24 ++++ templates/bindings/core/delay-action-binding.yaml | 13 ++ 7 files changed, 456 insertions(+) diff --git a/docs/modules/ROOT/assets/images/kamelets/delay-action.svg b/docs/modules/ROOT/assets/images/kamelets/delay-action.svg new file mode 100644 index 0000000..7888f41 --- /dev/null +++ b/docs/modules/ROOT/assets/images/kamelets/delay-action.svg @@ -0,0 +1 @@ +<?xml version="1.0" encoding="utf-8"?><svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 122.88 100.6" style="enable-background:new 0 0 122.88 100.6" xml:space="preserve"><style type="text/css">.st0{fill:#272727;} .st1{fill-rule:evenodd;clip-rule:evenodd;fill:#D8453E;}</style><g><path class="st0" d="M72.58,0c6.8,0,13.3,1.36,19.23,3.81c6.16,2.55,11.7,6.29,16.33,10.92l0,0c4.63,4.63,8.37,10.17,10.92,16.3 [...] \ No newline at end of file diff --git a/docs/modules/ROOT/nav.adoc b/docs/modules/ROOT/nav.adoc index 4e9ff5e..22387eb 100644 --- a/docs/modules/ROOT/nav.adoc +++ b/docs/modules/ROOT/nav.adoc @@ -1,4 +1,5 @@ // THIS FILE IS AUTOMATICALLY GENERATED: DO NOT EDIT +<<<<<<< HEAD * xref:avro-deserialize-action.adoc[] * xref:avro-serialize-action.adoc[] * xref:aws-cloudwatch-sink.adoc[] @@ -160,4 +161,159 @@ * xref:wttrin-source.adoc[] * xref:xj-identity-action.adoc[] * xref:xj-template-action.adoc[] +======= +* xref:ROOT:avro-deserialize-action.adoc[image:kamelets/avro-deserialize-action.svg[] Avro Deserialize Action] +* xref:ROOT:avro-serialize-action.adoc[image:kamelets/avro-serialize-action.svg[] Avro Serialize Action] +* xref:ROOT:aws-cloudwatch-sink.adoc[image:kamelets/aws-cloudwatch-sink.svg[] AWS CloudWatch Metrics Sink] +* xref:ROOT:aws-ddb-streams-source.adoc[image:kamelets/aws-ddb-streams-source.svg[] AWS DynamoDB Streams Source] +* xref:ROOT:aws-ec2-sink.adoc[image:kamelets/aws-ec2-sink.svg[] AWS EC2 Sink] +* xref:ROOT:aws-kinesis-firehose-sink.adoc[image:kamelets/aws-kinesis-firehose-sink.svg[] AWS Kinesis Firehose Sink] +* xref:ROOT:aws-kinesis-sink.adoc[image:kamelets/aws-kinesis-sink.svg[] AWS Kinesis Sink] +* xref:ROOT:aws-kinesis-source.adoc[image:kamelets/aws-kinesis-source.svg[] AWS Kinesis Source] +* xref:ROOT:aws-lambda-sink.adoc[image:kamelets/aws-lambda-sink.svg[] AWS Lambda Sink] +* xref:ROOT:aws-redshift-sink.adoc[image:kamelets/aws-redshift-sink.svg[] AWS Redshift Sink] +* xref:ROOT:aws-redshift-source.adoc[image:kamelets/aws-redshift-source.svg[] AWS Redshift Source] +* xref:ROOT:aws-s3-sink.adoc[image:kamelets/aws-s3-sink.svg[] AWS S3 Sink] +* xref:ROOT:aws-s3-source.adoc[image:kamelets/aws-s3-source.svg[] AWS S3 Source] +* xref:ROOT:aws-s3-streaming-upload-sink.adoc[image:kamelets/aws-s3-streaming-upload-sink.svg[] AWS S3 Streaming upload Sink] +* xref:ROOT:aws-secrets-manager-sink.adoc[image:kamelets/aws-secrets-manager-sink.svg[] AWS Secrets Manager Sink] +* xref:ROOT:aws-sns-fifo-sink.adoc[image:kamelets/aws-sns-fifo-sink.svg[] AWS SNS FIFO Sink] +* xref:ROOT:aws-sns-sink.adoc[image:kamelets/aws-sns-sink.svg[] AWS SNS Sink] +* xref:ROOT:aws-sqs-batch-sink.adoc[image:kamelets/aws-sqs-batch-sink.svg[] AWS SQS Batch Sink] +* xref:ROOT:aws-sqs-fifo-sink.adoc[image:kamelets/aws-sqs-fifo-sink.svg[] AWS SQS FIFO Sink] +* xref:ROOT:aws-sqs-sink.adoc[image:kamelets/aws-sqs-sink.svg[] AWS SQS Sink] +* xref:ROOT:aws-sqs-source.adoc[image:kamelets/aws-sqs-source.svg[] AWS SQS Source] +* xref:ROOT:aws-translate-action.adoc[image:kamelets/aws-translate-action.svg[] AWS Translate Action] +* xref:ROOT:azure-cosmosdb-source.adoc[image:kamelets/azure-cosmosdb-source.svg[] Azure CosmosDB Source] +* xref:ROOT:azure-eventhubs-sink.adoc[image:kamelets/azure-eventhubs-sink.svg[] Azure Eventhubs Sink] +* xref:ROOT:azure-eventhubs-source.adoc[image:kamelets/azure-eventhubs-source.svg[] Azure Eventhubs Source] +* xref:ROOT:azure-storage-blob-sink.adoc[image:kamelets/azure-storage-blob-sink.svg[] Azure Storage Blob Sink] +* xref:ROOT:azure-storage-blob-source.adoc[image:kamelets/azure-storage-blob-source.svg[] Azure Storage Blob Source] +* xref:ROOT:azure-storage-queue-sink.adoc[image:kamelets/azure-storage-queue-sink.svg[] Azure Storage Queue Sink] +* xref:ROOT:azure-storage-queue-source.adoc[image:kamelets/azure-storage-queue-source.svg[] Azure Storage Queue Source] +* xref:ROOT:bitcoin-source.adoc[image:kamelets/bitcoin-source.svg[] Bitcoin Source] +* xref:ROOT:caffeine-action.adoc[image:kamelets/caffeine-action.svg[] Caffeine Action] +* xref:ROOT:cassandra-sink.adoc[image:kamelets/cassandra-sink.svg[] Cassandra Sink] +* xref:ROOT:cassandra-source.adoc[image:kamelets/cassandra-source.svg[] Cassandra Source] +* xref:ROOT:chuck-norris-source.adoc[image:kamelets/chuck-norris-source.svg[] Chuck Norris Source] +* xref:ROOT:chunk-template-action.adoc[image:kamelets/chunk-template-action.svg[] Chunk Template Action] +* xref:ROOT:couchbase-sink.adoc[image:kamelets/couchbase-sink.svg[] Couchbase Sink] +* xref:ROOT:cron-source.adoc[image:kamelets/cron-source.svg[] Cron Source] +* xref:ROOT:delay-action.adoc[image:kamelets/delay-action.svg[] Delay Action] +* xref:ROOT:dns-dig-action.adoc[image:kamelets/dns-dig-action.svg[] DNS DIG Action] +* xref:ROOT:dns-ip-action.adoc[image:kamelets/dns-ip-action.svg[] DNS IP Action] +* xref:ROOT:dns-lookup-action.adoc[image:kamelets/dns-lookup-action.svg[] DNS Lookup Action] +* xref:ROOT:dropbox-sink.adoc[image:kamelets/dropbox-sink.svg[] Dropbox Sink] +* xref:ROOT:dropbox-source.adoc[image:kamelets/dropbox-source.svg[] Dropbox Source] +* xref:ROOT:earthquake-source.adoc[image:kamelets/earthquake-source.svg[] Earthquake Source] +* xref:ROOT:elasticsearch-index-sink.adoc[image:kamelets/elasticsearch-index-sink.svg[] ElasticSearch Index Sink] +* xref:ROOT:elasticsearch-search-source.adoc[image:kamelets/elasticsearch-search-source.svg[] ElasticSearch Search Source] +* xref:ROOT:exec-sink.adoc[image:kamelets/exec-sink.svg[] Exec Sink] +* xref:ROOT:extract-field-action.adoc[image:kamelets/extract-field-action.svg[] Extract Field Action] +* xref:ROOT:fhir-source.adoc[image:kamelets/fhir-source.svg[] Fhir Source] +* xref:ROOT:file-watch-source.adoc[image:kamelets/file-watch-source.svg[] File Watch Source] +* xref:ROOT:freemarker-template-action.adoc[image:kamelets/freemarker-template-action.svg[] Freemarker Template Action] +* xref:ROOT:ftp-sink.adoc[image:kamelets/ftp-sink.svg[] FTP Sink] +* xref:ROOT:ftp-source.adoc[image:kamelets/ftp-source.svg[] FTP Source] +* xref:ROOT:ftps-sink.adoc[image:kamelets/ftps-sink.svg[] FTPS Sink] +* xref:ROOT:ftps-source.adoc[image:kamelets/ftps-source.svg[] FTPS Source] +* xref:ROOT:github-source.adoc[image:kamelets/github-source.svg[] Github Source] +* xref:ROOT:google-calendar-source.adoc[image:kamelets/google-calendar-source.svg[] Google Calendar Source] +* xref:ROOT:google-mail-source.adoc[image:kamelets/google-mail-source.svg[] Google Mail Source] +* xref:ROOT:google-pubsub-sink.adoc[image:kamelets/google-pubsub-sink.svg[] Google Pubsub Sink] +* xref:ROOT:google-pubsub-source.adoc[image:kamelets/google-pubsub-source.svg[] Google Pubsub Source] +* xref:ROOT:google-sheets-source.adoc[image:kamelets/google-sheets-source.svg[] Google Sheets Source] +* xref:ROOT:has-header-filter-action.adoc[image:kamelets/has-header-filter-action.svg[] Has Header Filter Action] +* xref:ROOT:header-matches-filter-action.adoc[image:kamelets/header-matches-filter-action.svg[] Header Matches Filter Action] +* xref:ROOT:hoist-field-action.adoc[image:kamelets/hoist-field-action.svg[] Hoist Field Action] +* xref:ROOT:http-secured-sink.adoc[image:kamelets/http-secured-sink.svg[] Secured HTTP Sink] +* xref:ROOT:http-secured-source.adoc[image:kamelets/http-secured-source.svg[] HTTP Secured Source] +* xref:ROOT:http-sink.adoc[image:kamelets/http-sink.svg[] HTTP Sink] +* xref:ROOT:http-source.adoc[image:kamelets/http-source.svg[] HTTP Source] +* xref:ROOT:infinispan-sink.adoc[image:kamelets/infinispan-sink.svg[] Infinispan Sink] +* xref:ROOT:infinispan-source.adoc[image:kamelets/infinispan-source.svg[] Infinispan Source] +* xref:ROOT:insert-field-action.adoc[image:kamelets/insert-field-action.svg[] Insert Field Action] +* xref:ROOT:insert-header-action.adoc[image:kamelets/insert-header-action.svg[] Insert Header Action] +* xref:ROOT:is-tombstone-filter-action.adoc[image:kamelets/is-tombstone-filter-action.svg[] Is Tombstone Filter Action] +* xref:ROOT:jira-source.adoc[image:kamelets/jira-source.svg[] Jira Source] +* xref:ROOT:jms-amqp-10-sink.adoc[image:kamelets/jms-amqp-10-sink.svg[] JMS - AMQP 1.0 Kamelet Sink] +* xref:ROOT:jms-amqp-10-source.adoc[image:kamelets/jms-amqp-10-source.svg[] JMS - AMQP 1.0 Kamelet Source] +* xref:ROOT:jms-apache-artemis-sink.adoc[image:kamelets/jms-apache-artemis-sink.svg[] JMS - Apache Artemis Kamelet Sink] +* xref:ROOT:jms-apache-artemis-source.adoc[image:kamelets/jms-apache-artemis-source.svg[] JMS - Apache Artemis Kamelet Source] +* xref:ROOT:jolt-transformation-action.adoc[image:kamelets/jolt-transformation-action.svg[] Jolt Transformation Action] +* xref:ROOT:json-deserialize-action.adoc[image:kamelets/json-deserialize-action.svg[] Json Deserialize Action] +* xref:ROOT:json-schema-validator-action.adoc[image:kamelets/json-schema-validator-action.svg[] Json Schema Validator Action] +* xref:ROOT:json-serialize-action.adoc[image:kamelets/json-serialize-action.svg[] Json Serialize Action] +* xref:ROOT:jsonata-action.adoc[image:kamelets/jsonata-action.svg[] Jsonata Action] +* xref:ROOT:kafka-manual-commit-action.adoc[image:kamelets/kafka-manual-commit-action.svg[] Kafka Manual Commit Action] +* xref:ROOT:kafka-not-secured-sink.adoc[image:kamelets/kafka-not-secured-sink.svg[] Kafka Not Secured Sink] +* xref:ROOT:kafka-not-secured-source.adoc[image:kamelets/kafka-not-secured-source.svg[] Kafka Not Secured Source] +* xref:ROOT:kafka-sink.adoc[image:kamelets/kafka-sink.svg[] Kafka Sink] +* xref:ROOT:kafka-source.adoc[image:kamelets/kafka-source.svg[] Kafka Source] +* xref:ROOT:kubernetes-namespaces-source.adoc[image:kamelets/kubernetes-namespaces-source.svg[] Kubernetes Namespaces Source] +* xref:ROOT:kubernetes-nodes-source.adoc[image:kamelets/kubernetes-nodes-source.svg[] Kubernetes Nodes Source] +* xref:ROOT:kubernetes-pods-source.adoc[image:kamelets/kubernetes-pods-source.svg[] Kubernetes Pods Source] +* xref:ROOT:log-sink.adoc[image:kamelets/log-sink.svg[] Log Sink] +* xref:ROOT:mail-imap-source.adoc[image:kamelets/mail-imap-source.svg[] Mail IMAP Source] +* xref:ROOT:mail-sink.adoc[image:kamelets/mail-sink.svg[] Mail Sink] +* xref:ROOT:mariadb-sink.adoc[image:kamelets/mariadb-sink.svg[] MariaDB Sink] +* xref:ROOT:mariadb-source.adoc[image:kamelets/mariadb-source.svg[] MariaDB Source] +* xref:ROOT:mask-field-action.adoc[image:kamelets/mask-field-action.svg[] Mask Fields Action] +* xref:ROOT:message-timestamp-router-action.adoc[image:kamelets/message-timestamp-router-action.svg[] Message Timestamp Router Action] +* xref:ROOT:minio-sink.adoc[image:kamelets/minio-sink.svg[] Minio Sink] +* xref:ROOT:minio-source.adoc[image:kamelets/minio-source.svg[] Minio Source] +* xref:ROOT:mongodb-sink.adoc[image:kamelets/mongodb-sink.svg[] MongoDB Sink] +* xref:ROOT:mongodb-source.adoc[image:kamelets/mongodb-source.svg[] MongoDB Source] +* xref:ROOT:mqtt-sink.adoc[image:kamelets/mqtt-sink.svg[] MQTT Sink] +* xref:ROOT:mqtt-source.adoc[image:kamelets/mqtt-source.svg[] MQTT Source] +* xref:ROOT:mustache-template-action.adoc[image:kamelets/mustache-template-action.svg[] Mustache Template Action] +* xref:ROOT:mvel-template-action.adoc[image:kamelets/mvel-template-action.svg[] Mvel Template Action] +* xref:ROOT:mysql-sink.adoc[image:kamelets/mysql-sink.svg[] MySQL Sink] +* xref:ROOT:mysql-source.adoc[image:kamelets/mysql-source.svg[] MySQL Source] +* xref:ROOT:nats-sink.adoc[image:kamelets/nats-sink.svg[] NATS Sink] +* xref:ROOT:nats-source.adoc[image:kamelets/nats-source.svg[] NATS Source] +* xref:ROOT:openai-classification-action.adoc[image:kamelets/openai-classification-action.svg[] OpenAI Classification Action] +* xref:ROOT:openai-completion-action.adoc[image:kamelets/openai-completion-action.svg[] OpenAI Completion Action] +* xref:ROOT:pdf-action.adoc[image:kamelets/pdf-action.svg[] PDF Action] +* xref:ROOT:postgresql-sink.adoc[image:kamelets/postgresql-sink.svg[] PostgreSQL Sink] +* xref:ROOT:postgresql-source.adoc[image:kamelets/postgresql-source.svg[] PostgreSQL Source] +* xref:ROOT:predicate-filter-action.adoc[image:kamelets/predicate-filter-action.svg[] Predicate Filter Action] +* xref:ROOT:protobuf-deserialize-action.adoc[image:kamelets/protobuf-deserialize-action.svg[] Protobuf Deserialize Action] +* xref:ROOT:protobuf-serialize-action.adoc[image:kamelets/protobuf-serialize-action.svg[] Protobuf Serialize Action] +* xref:ROOT:pulsar-sink.adoc[image:kamelets/pulsar-sink.svg[] Pulsar Sink] +* xref:ROOT:pulsar-source.adoc[image:kamelets/pulsar-source.svg[] Pulsar Source] +* xref:ROOT:rabbitmq-source.adoc[image:kamelets/rabbitmq-source.svg[] RabbitMQ Source] +* xref:ROOT:redis-sink.adoc[image:kamelets/redis-sink.svg[] Redis Sink] +* xref:ROOT:redis-source.adoc[image:kamelets/redis-source.svg[] Redis Source] +* xref:ROOT:regex-router-action.adoc[image:kamelets/regex-router-action.svg[] Regex Router Action] +* xref:ROOT:replace-field-action.adoc[image:kamelets/replace-field-action.svg[] Replace Field Action] +* xref:ROOT:salesforce-source.adoc[image:kamelets/salesforce-source.svg[] Salesforce Source] +* xref:ROOT:sftp-sink.adoc[image:kamelets/sftp-sink.svg[] SFTP Sink] +* xref:ROOT:sftp-source.adoc[image:kamelets/sftp-source.svg[] SFTP Source] +* xref:ROOT:slack-sink.adoc[image:kamelets/slack-sink.svg[] Slack Sink] +* xref:ROOT:slack-source.adoc[image:kamelets/slack-source.svg[] Slack Source] +* xref:ROOT:solr-sink.adoc[image:kamelets/solr-sink.svg[] Solr Sink] +* xref:ROOT:solr-source.adoc[image:kamelets/solr-source.svg[] Solr Source] +* xref:ROOT:sqlserver-sink.adoc[image:kamelets/sqlserver-sink.svg[] Microsoft SQL Server Sink] +* xref:ROOT:sqlserver-source.adoc[image:kamelets/sqlserver-source.svg[] Microsoft SQL Server Source] +* xref:ROOT:ssh-sink.adoc[image:kamelets/ssh-sink.svg[] SSH Sink] +* xref:ROOT:ssh-source.adoc[image:kamelets/ssh-source.svg[] SSH Source] +* xref:ROOT:string-template-action.adoc[image:kamelets/string-template-action.svg[] String Template Action] +* xref:ROOT:telegram-sink.adoc[image:kamelets/telegram-sink.svg[] Telegram Sink] +* xref:ROOT:telegram-source.adoc[image:kamelets/telegram-source.svg[] Telegram Source] +* xref:ROOT:throttle-action.adoc[image:kamelets/throttle-action.svg[] Throttle Action] +* xref:ROOT:timer-source.adoc[image:kamelets/timer-source.svg[] Timer Source] +* xref:ROOT:timestamp-router-action.adoc[image:kamelets/timestamp-router-action.svg[] Timestamp Router Action] +* xref:ROOT:topic-name-matches-filter-action.adoc[image:kamelets/topic-name-matches-filter-action.svg[] Kafka Topic Name Matches Filter Action] +* xref:ROOT:twitter-directmessage-source.adoc[image:kamelets/twitter-directmessage-source.svg[] Twitter Direct Message Source] +* xref:ROOT:twitter-search-source.adoc[image:kamelets/twitter-search-source.svg[] Twitter Search Source] +* xref:ROOT:twitter-timeline-source.adoc[image:kamelets/twitter-timeline-source.svg[] Twitter Timeline Source] +* xref:ROOT:value-to-key-action.adoc[image:kamelets/value-to-key-action.svg[] Value to Key Action] +* xref:ROOT:velocity-template-action.adoc[image:kamelets/velocity-template-action.svg[] Velocity Template Action] +* xref:ROOT:webhook-source.adoc[image:kamelets/webhook-source.svg[] Webhook Source] +* xref:ROOT:websocket-source.adoc[image:kamelets/websocket-source.svg[] Websocket Source] +* xref:ROOT:wttrin-source.adoc[image:kamelets/wttrin-source.svg[] wttr.in Source] +* xref:ROOT:xj-identity-action.adoc[image:kamelets/xj-identity-action.svg[] XJ Identity Action] +* xref:ROOT:xj-template-action.adoc[image:kamelets/xj-template-action.svg[] XJ Template Action] +>>>>>>> 99266ed (Add delay action) // THIS FILE IS AUTOMATICALLY GENERATED: DO NOT EDIT diff --git a/docs/modules/ROOT/pages/delay-action.adoc b/docs/modules/ROOT/pages/delay-action.adoc new file mode 100644 index 0000000..5fd1566 --- /dev/null +++ b/docs/modules/ROOT/pages/delay-action.adoc @@ -0,0 +1,160 @@ +// THIS FILE IS AUTOMATICALLY GENERATED: DO NOT EDIT + += image:kamelets/delay-action.svg[] Delay Action + +*Provided by: "Apache Software Foundation"* + +*Support Level for this Kamelet is: "Preview"* + +Delay the processing using a specific amount of time + +== Configuration Options + +The following table summarizes the configuration options available for the `delay-action` Kamelet: +[width="100%",cols="2,^2,3,^2,^2,^3",options="header"] +|=== +| Property| Name| Description| Type| Default| Example +| *milliseconds {empty}* *| Milliseconds| The number of milliseconds of delay| integer| | `1000` +|=== + +NOTE: Fields marked with an asterisk ({empty}*) are mandatory. + + +== Dependencies + +At runtime, the `delay-action` Kamelet relies upon the presence of the following dependencies: + +- camel:core +- camel:kamelet + +== Usage + +This section describes how you can use the `delay-action`. + +=== Knative Action + +You can use the `delay-action` Kamelet as an intermediate step in a Knative binding. + +.delay-action-binding.yaml +[source,yaml] +---- +apiVersion: camel.apache.org/v1alpha1 +kind: KameletBinding +metadata: + name: delay-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: delay-action + properties: + milliseconds: 1000 + sink: + ref: + kind: Channel + apiVersion: messaging.knative.dev/v1 + name: mychannel + +---- + +==== *Prerequisite* + +You have xref:{camel-k-version}@camel-k::installation/installation.adoc[Camel K installed] on the cluster. + +==== *Procedure for using the cluster CLI* + +. Save the `delay-action-binding.yaml` file to your local drive, and then edit it as needed for your configuration. + +. Run the action by using the following command: ++ +[source,shell] +---- +kubectl apply -f delay-action-binding.yaml +---- + +==== *Procedure for using the Kamel CLI* + +Configure and run the action by using the following command: + +[source,shell] +---- +kamel bind timer-source?message=Hello --step delay-action -p step-0.milliseconds=1000 channel:mychannel +---- + +This command creates the KameletBinding in the current namespace on the cluster. + +=== Kafka Action + +You can use the `delay-action` Kamelet as an intermediate step in a Kafka binding. + +.delay-action-binding.yaml +[source,yaml] +---- +apiVersion: camel.apache.org/v1alpha1 +kind: KameletBinding +metadata: + name: delay-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: delay-action + properties: + milliseconds: 1000 + sink: + ref: + kind: KafkaTopic + apiVersion: kafka.strimzi.io/v1beta1 + name: my-topic + +---- + +==== *Prerequisites* + +* You've installed https://strimzi.io/[Strimzi]. +* You've created a topic named `my-topic` in the current namespace. +* You have xref:{camel-k-version}@camel-k::installation/installation.adoc[Camel K installed] on the cluster. + +==== *Procedure for using the cluster CLI* + +. Save the `delay-action-binding.yaml` file to your local drive, and then edit it as needed for your configuration. + +. Run the action by using the following command: ++ +[source,shell] +---- +kubectl apply -f delay-action-binding.yaml +---- + +==== *Procedure for using the Kamel CLI* + +Configure and run the action by using the following command: + +[source,shell] +---- +kamel bind timer-source?message=Hello --step delay-action -p step-0.milliseconds=1000 kafka.strimzi.io/v1beta1:KafkaTopic:my-topic +---- + +This command creates the KameletBinding in the current namespace on the cluster. + +== Kamelet source file + +https://github.com/apache/camel-kamelets/blob/main/kamelets/delay-action.kamelet.yaml + +// THIS FILE IS AUTOMATICALLY GENERATED: DO NOT EDIT diff --git a/kamelets/delay-action.kamelet.yaml b/kamelets/delay-action.kamelet.yaml new file mode 100644 index 0000000..88c265c --- /dev/null +++ b/kamelets/delay-action.kamelet.yaml @@ -0,0 +1,51 @@ +# --------------------------------------------------------------------------- +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# --------------------------------------------------------------------------- +apiVersion: camel.apache.org/v1alpha1 +kind: Kamelet +metadata: + name: delay-action + annotations: + camel.apache.org/kamelet.support.level: "Preview" + camel.apache.org/catalog.version: "main-SNAPSHOT" + camel.apache.org/kamelet.icon: "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz48c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IiB2aWV3Qm94PSIwIDAgMTIyLjg4IDEwMC42IiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCAxMjIuODggMTAwLjYiIHhtbDpzcGFjZT0icHJlc2VydmUiPjxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyI+LnN0MHtmaWxsOiMyNzI3Mjc7fSAuc3Qxe2ZpbGwtcnVsZTpldmVub2 [...] + camel.apache.org/provider: "Apache Software Foundation" + camel.apache.org/kamelet.group: "Delay" + labels: + camel.apache.org/kamelet.type: "action" +spec: + definition: + title: "Delay Action" + description: |- + Delay the processing using a specific amount of time + required: + - milliseconds + type: object + properties: + milliseconds: + title: Milliseconds + description: The number of milliseconds of delay + type: integer + example: 1000 + dependencies: + - "camel:core" + - "camel:kamelet" + flow: + from: + uri: "kamelet:source" + steps: + - delay: + constant: "{{milliseconds}}" diff --git a/library/camel-kamelets/src/main/resources/kamelets/delay-action.kamelet.yaml b/library/camel-kamelets/src/main/resources/kamelets/delay-action.kamelet.yaml new file mode 100644 index 0000000..88c265c --- /dev/null +++ b/library/camel-kamelets/src/main/resources/kamelets/delay-action.kamelet.yaml @@ -0,0 +1,51 @@ +# --------------------------------------------------------------------------- +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# --------------------------------------------------------------------------- +apiVersion: camel.apache.org/v1alpha1 +kind: Kamelet +metadata: + name: delay-action + annotations: + camel.apache.org/kamelet.support.level: "Preview" + camel.apache.org/catalog.version: "main-SNAPSHOT" + camel.apache.org/kamelet.icon: "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz48c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IiB2aWV3Qm94PSIwIDAgMTIyLjg4IDEwMC42IiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCAxMjIuODggMTAwLjYiIHhtbDpzcGFjZT0icHJlc2VydmUiPjxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyI+LnN0MHtmaWxsOiMyNzI3Mjc7fSAuc3Qxe2ZpbGwtcnVsZTpldmVub2 [...] + camel.apache.org/provider: "Apache Software Foundation" + camel.apache.org/kamelet.group: "Delay" + labels: + camel.apache.org/kamelet.type: "action" +spec: + definition: + title: "Delay Action" + description: |- + Delay the processing using a specific amount of time + required: + - milliseconds + type: object + properties: + milliseconds: + title: Milliseconds + description: The number of milliseconds of delay + type: integer + example: 1000 + dependencies: + - "camel:core" + - "camel:kamelet" + flow: + from: + uri: "kamelet:source" + steps: + - delay: + constant: "{{milliseconds}}" diff --git a/templates/bindings/camel-k/delay-action-binding.yaml b/templates/bindings/camel-k/delay-action-binding.yaml new file mode 100644 index 0000000..b6b3b75 --- /dev/null +++ b/templates/bindings/camel-k/delay-action-binding.yaml @@ -0,0 +1,24 @@ +apiVersion: camel.apache.org/v1alpha1 +kind: KameletBinding +metadata: + name: delay-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: delay-action + properties: + milliseconds: 1000 + sink: + ref: + kind: KafkaTopic + apiVersion: kafka.strimzi.io/v1beta1 + name: my-topic diff --git a/templates/bindings/core/delay-action-binding.yaml b/templates/bindings/core/delay-action-binding.yaml new file mode 100644 index 0000000..b9f4d73 --- /dev/null +++ b/templates/bindings/core/delay-action-binding.yaml @@ -0,0 +1,13 @@ +- route: + from: + uri: "kamelet:timer-source" + parameters: + period: 1000 + message: "{ \"foo\": \"John\"}" + steps: + - to: + uri: "kamelet:delay-action" + parameters: + milliseconds: 1000 + - to: + uri: "log:info"