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/12/09 06:44:42 UTC
[camel-kamelets] branch main updated: #76: Add Pulsar source Kamelet
This is an automated email from the ASF dual-hosted git repository.
acosentino pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-kamelets.git
The following commit(s) were added to refs/heads/main by this push:
new 912d59f #76: Add Pulsar source Kamelet
912d59f is described below
commit 912d59f3989935380415e03235ad4a10badbf767
Author: Luigi De Masi <ld...@redhat.com>
AuthorDate: Tue Dec 7 19:18:05 2021 +0100
#76: Add Pulsar source Kamelet
---
.../ROOT/assets/images/kamelets/pulsar-source.svg | 100 ++++++++++++
docs/modules/ROOT/nav.adoc | 1 +
docs/modules/ROOT/pages/pulsar-source.adoc | 175 +++++++++++++++++++++
kamelets/pulsar-source.kamelet.yaml | 169 ++++++++++++++++++++
.../resources/kamelets/pulsar-source.kamelet.yaml | 169 ++++++++++++++++++++
.../bindings/camel-k/pulsar-source-binding.yaml | 22 +++
templates/bindings/core/pulsar-source-binding.yaml | 13 ++
7 files changed, 649 insertions(+)
diff --git a/docs/modules/ROOT/assets/images/kamelets/pulsar-source.svg b/docs/modules/ROOT/assets/images/kamelets/pulsar-source.svg
new file mode 100644
index 0000000..3fc97fc
--- /dev/null
+++ b/docs/modules/ROOT/assets/images/kamelets/pulsar-source.svg
@@ -0,0 +1,100 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ viewBox="0 0 60.973999 43.09"
+ version="1.1"
+ id="svg24"
+ sodipodi:docname="pulsar-logo.svg"
+ width="60.973999"
+ height="43.09"
+ inkscape:version="1.1.1 (3bf5ae0d25, 2021-09-20)"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <sodipodi:namedview
+ id="namedview26"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageshadow="2"
+ inkscape:pageopacity="0.0"
+ inkscape:pagecheckerboard="0"
+ showgrid="false"
+ units="px"
+ inkscape:zoom="3.0043662"
+ inkscape:cx="31.454221"
+ inkscape:cy="43.436782"
+ inkscape:window-width="1920"
+ inkscape:window-height="1080"
+ inkscape:window-x="0"
+ inkscape:window-y="0"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="svg24" />
+ <defs
+ id="defs4">
+ <style
+ id="style2">.cls-1{fill:#188fff;}.cls-2{fill:#464e56;}</style>
+ <clipPath
+ clipPathUnits="userSpaceOnUse"
+ id="clipPath316">
+ <rect
+ id="rect318"
+ width="60.973946"
+ height="43.513111"
+ x="4.0966033e-10"
+ y="-0.42311111" />
+ </clipPath>
+ </defs>
+ <title
+ id="title6">Asset 2</title>
+ <g
+ id="Layer_2"
+ data-name="Layer 2"
+ transform="translate(0.2971442,0.06848085)"
+ clip-path="url(#clipPath316)">
+ <g
+ id="Layer_1-2"
+ data-name="Layer 1">
+ <path
+ class="cls-1"
+ d="M 61,13.73 H 46.09 C 42.06,6 37.8,0 32,0 24.45,0 20.9,6.59 17.47,13 l -0.3,0.56 H 0 v 3.81 h 10 c 3.53,0 4.25,1.19 4.25,1.19 -2.77,4.3 -6.1,8.55 -11.65,8.55 H 0 v 4 h 2.62 c 10.76,0 15.46,-8.73 19.23,-15.74 C 25.31,8.91 27.72,5 32,5 c 4.44,0 9.11,9.66 13.22,18.19 0.6,1.24 1.21,2.51 1.83,3.77 -15.76,0.5 -23.27,4.19 -29.38,7.2 -4.47,2.2 -8,4.93 -13.81,4.93 H 0 v 4 h 3.83 c 7,0 11.36,-2.16 16,-4.45 6.43,-3.16 13.72,-6.74 30.9,-6.74 h 9.93 v -4 h -5.61 a 3,3 0 0 1 -2.47,-1 C 51.6 [...]
+ id="path8" />
+ <path
+ class="cls-2"
+ d="M 79.83,13.7 H 69.44 v 3.74 H 79.6 c 4.2,0 6.61,1.91 6.61,5.33 0,3.24 -2.66,5.33 -6.77,5.33 h -10 v 13 h 4 v -9.3 h 5.93 c 5.42,0 10.88,-2.83 10.88,-9.22 -0.03,-5.4 -4.11,-8.88 -10.42,-8.88 z"
+ id="path10" />
+ <path
+ class="cls-2"
+ d="m 113.31,29.57 c 0,5.31 -2.66,8.24 -7.48,8.24 -4.82,0 -7.6,-3.07 -7.6,-8.43 V 13.7 h -4 v 15.87 c 0,7.39 4.4,12 11.49,12 7.09,0 11.56,-4.57 11.56,-12.23 V 13.7 h -4 z"
+ id="path12" />
+ <polygon
+ class="cls-2"
+ points="142.22,41.14 142.22,37.39 127.33,37.39 127.33,13.7 123.36,13.7 123.36,41.14 "
+ id="polygon14" />
+ <path
+ class="cls-2"
+ d="M 156.69,25.5 C 150.95,24.27 149.9,22.97 149.9,20.76 149.9,18.55 152,17 155,17 a 11.12,11.12 0 0 1 7.32,2.76 l 0.4,0.32 2.36,-3.08 -0.37,-0.3 a 14.22,14.22 0 0 0 -9.61,-3.36 c -5.32,0 -9.18,3.24 -9.18,7.79 0,5.06 3.71,6.91 9.27,8.12 5.56,1.21 6.49,2.44 6.49,4.62 0,2.36 -2.22,4 -5.41,4 -3.37,0 -5.9,-1 -8.74,-3.62 l -0.38,-0.34 -2.49,2.95 0.36,0.32 a 15.91,15.91 0 0 0 11.14,4.36 c 5.61,0 9.52,-3.28 9.52,-8 0.01,-4.28 -2.68,-6.67 -8.99,-8.04 z"
+ id="path16" />
+ <path
+ class="cls-2"
+ d="m 180.19,13.51 -12.5,27.63 h 4.14 l 3.14,-7 h 13.76 l 3.1,7 h 4.29 l -12.5,-27.63 z m -3.61,17 5.29,-11.8 5.26,11.8 z"
+ id="path18" />
+ <path
+ class="cls-2"
+ d="m 215.18,30.15 c 4.29,-1 6.82,-4 6.82,-8.11 a 7.77,7.77 0 0 0 -2.18,-5.56 11,11 0 0 0 -7.87,-2.79 h -11.87 v 27.45 h 4 V 30.85 h 6.82 l 7.67,10.28 h 4.9 z m -11.14,-3 v -9.71 h 7.67 c 4,0 6.28,1.72 6.28,4.8 0,3.08 -2.48,5 -6.31,5 z"
+ id="path20" />
+ </g>
+ </g>
+ <metadata
+ id="metadata819">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:title>Asset 2</dc:title>
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+</svg>
diff --git a/docs/modules/ROOT/nav.adoc b/docs/modules/ROOT/nav.adoc
index 8a74379..6aa2174 100644
--- a/docs/modules/ROOT/nav.adoc
+++ b/docs/modules/ROOT/nav.adoc
@@ -114,6 +114,7 @@
* 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-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]
diff --git a/docs/modules/ROOT/pages/pulsar-source.adoc b/docs/modules/ROOT/pages/pulsar-source.adoc
new file mode 100644
index 0000000..4aced93
--- /dev/null
+++ b/docs/modules/ROOT/pages/pulsar-source.adoc
@@ -0,0 +1,175 @@
+// THIS FILE IS AUTOMATICALLY GENERATED: DO NOT EDIT
+
+= image:kamelets/pulsar-source.svg[] Pulsar Source
+
+*Provided by: "Apache Software Foundation"*
+
+*Support Level for this Kamelet is: "Preview"*
+
+Receive data from Pulsar topics.
+
+== Configuration Options
+
+The following table summarizes the configuration options available for the `pulsar-source` Kamelet:
+[width="100%",cols="2,^2,3,^2,^2,^3",options="header"]
+|===
+| Property| Name| Description| Type| Default| Example
+| *namespaceName {empty}* *| Pulsar Namespace Name| The Pulsar Namespace Name| string| |
+| *serviceUrl {empty}* *| Service URL| The Pulsar Service URL to point while creating the client from URI.| string| |
+| *tenant {empty}* *| Tenant Name| The Tenant Name| string| |
+| *topic {empty}* *| Topic Name| The topic name or regexp| string| |
+| *topicType {empty}* *| Topic Type| The topic type. Possible values are: persistent or non-persistent| string| |
+| authenticationClass| Authentication Class| The Authentication FQCN to be used while creating the client from URI.| string| |
+| authenticationParams| Authentication Params| The Authentication Parameters to be used while creating the client from URI.| string| |
+| consumerNamePrefix| Consumer Name Prefix| Prefix to add to consumer names when a SHARED or FAILOVER subscription is used| string| `"cons"`|
+| consumerQueueSize| Consumer Queue Size| Size of the consumer queue| int| `10`|
+| deadLetterTopic| Dead Letter Topic| Name of the topic where the messages which fail maxRedeliverCount times will be sent. Note: if not set, default topic name will be topicName-subscriptionName-DLQ.| int| |
+| maxRedeliverCount| Maximum Redelivery Count| Maximum number of times that a message will be redelivered before being sent to the dead letter queue. If this value is not set, no Dead Letter Policy will be created.| int| |
+| messageListener| Message Listener| Whether to use the messageListener interface, or to receive messages using a separate thread pool.| boolean| `true`|
+| negativeAckRedeliveryDelayMicros| Negative Ack Redelivery Delay in Microseconds| Set the negative acknowledgement delay.| long| `60000000`|
+| numberOfConsumerThreads| Number Of Consumer Threads| Number of threads to receive and handle messages when using a separate thread pool.| int| `1`|
+| numberOfConsumers| Number Of Consumers| Number of consumers.| int| `1`|
+| readCompacted| Read Compacted| Enable compacted topic reading.| boolean| `false`|
+| subscriptionInitialPosition| Subscription Initial Position| Control the initial position in the topic of a newly created subscription. Default is latest message.Possible values: EARLIEST or LATEST| string| `"LATEST"`|
+| subscriptionName| Subscription Name| Name of the subscription to use.| string| `"subs"`|
+| subscriptionTopicsMode| Subscription Topics Mode| Determines to which topics this consumer should be subscribed to - Persistent, Non-Persistent, or both. Only used with pattern subscriptions.Possible values: PersistentOnly, NonPersistentOnly, AllTopics| string| `"PersistentOnly"`|
+| subscriptionType| Subscription Type| Type of the subscription. Possible values: EXCLUSIVE, SHARED, FAILOVER, KEY_SHARED| string| `"EXCLUSIVE"`|
+| topicsPattern| Topic Pattern| Whether the topic is a pattern (regular expression) that allows the consumer to subscribe to all matching topics in the namespace.| boolean| `false`|
+|===
+
+NOTE: Fields marked with an asterisk ({empty}*) are mandatory.
+
+
+== Dependencies
+
+At runtime, the `pulsar-source` Kamelet relies upon the presence of the following dependencies:
+
+- camel:pulsar
+- camel:kamelet
+- camel:core
+
+== Usage
+
+This section describes how you can use the `pulsar-source`.
+
+=== Knative Source
+
+You can use the `pulsar-source` Kamelet as a Knative source by binding it to a Knative object.
+
+.pulsar-source-binding.yaml
+[source,yaml]
+----
+apiVersion: camel.apache.org/v1alpha1
+kind: KameletBinding
+metadata:
+ name: pulsar-source-binding
+spec:
+ source:
+ ref:
+ kind: Kamelet
+ apiVersion: camel.apache.org/v1alpha1
+ name: pulsar-source
+ properties:
+ namespaceName: "The Pulsar Namespace Name"
+ serviceUrl: "The Service URL"
+ tenant: "The Tenant Name"
+ topic: "The Topic Name"
+ topicType: "The Topic Type"
+ 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 `pulsar-source-binding.yaml` file to your local drive, and then edit it as needed for your configuration.
+
+. Run the source by using the following command:
++
+[source,shell]
+----
+kubectl apply -f pulsar-source-binding.yaml
+----
+
+==== *Procedure for using the Kamel CLI*
+
+Configure and run the source by using the following command:
+
+[source,shell]
+----
+kamel bind pulsar-source -p "source.namespaceName=The Pulsar Namespace Name" -p "source.serviceUrl=The Service URL" -p "source.tenant=The Tenant Name" -p "source.topic=The Topic Name" -p "source.topicType=The Topic Type" channel:mychannel
+----
+
+This command creates the KameletBinding in the current namespace on the cluster.
+
+=== Kafka Source
+
+You can use the `pulsar-source` Kamelet as a Kafka source by binding it to a Kafka topic.
+
+.pulsar-source-binding.yaml
+[source,yaml]
+----
+apiVersion: camel.apache.org/v1alpha1
+kind: KameletBinding
+metadata:
+ name: pulsar-source-binding
+spec:
+ source:
+ ref:
+ kind: Kamelet
+ apiVersion: camel.apache.org/v1alpha1
+ name: pulsar-source
+ properties:
+ namespaceName: "The Pulsar Namespace Name"
+ serviceUrl: "The Service URL"
+ tenant: "The Tenant Name"
+ topic: "The Topic Name"
+ topicType: "The Topic Type"
+ 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 `pulsar-source-binding.yaml` file to your local drive, and then edit it as needed for your configuration.
+
+. Run the source by using the following command:
++
+[source,shell]
+----
+kubectl apply -f pulsar-source-binding.yaml
+----
+
+==== *Procedure for using the Kamel CLI*
+
+Configure and run the source by using the following command:
+
+[source,shell]
+----
+kamel bind pulsar-source -p "source.namespaceName=The Pulsar Namespace Name" -p "source.serviceUrl=The Service URL" -p "source.tenant=The Tenant Name" -p "source.topic=The Topic Name" -p "source.topicType=The Topic Type" 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/pulsar-source.kamelet.yaml
+
+// THIS FILE IS AUTOMATICALLY GENERATED: DO NOT EDIT
diff --git a/kamelets/pulsar-source.kamelet.yaml b/kamelets/pulsar-source.kamelet.yaml
new file mode 100755
index 0000000..c54f58f
--- /dev/null
+++ b/kamelets/pulsar-source.kamelet.yaml
@@ -0,0 +1,169 @@
+# ---------------------------------------------------------------------------
+# 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: pulsar-source
+ 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,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjxzdmcKICAgdmlld0JveD0iMCAwIDYwLjk3Mzk5OSA0My4wOSIKICAgdmVyc2lvbj0iMS4xIgogICBpZD0ic3ZnMjQiCiAgIHNvZGlwb2RpOmRvY25hbWU9InB1bHNhci1sb2dvLnN2ZyIKICAgd2lkdGg9IjYwLjk3Mzk5OSIKICAgaGVpZ2h0PSI0My4wOSIKICAgaW5rc2NhcGU6dmVyc2lvbj0iMS4xLjEgKDNiZjVhZTBkMjUsIDIwMjEtMDktMjApIgogICB4bWxuczppbmtzY2FwZT0iaHR0cDovL3d3dy5pbmtzY2FwZS5vcmcvbmFtZXNwYWNlcy9pbmtzY2FwZSIKICAgeG [...]
+ camel.apache.org/provider: "Apache Software Foundation"
+ camel.apache.org/kamelet.group: "Pulsar"
+ labels:
+ camel.apache.org/kamelet.type: "source"
+spec:
+ dependencies:
+ - "camel:pulsar"
+ - "camel:kamelet"
+ - "camel:core"
+ definition:
+ title: "Pulsar Source"
+ description: "Receive data from Pulsar topics."
+ required:
+ - topicType
+ - topic
+ - namespaceName
+ - tenant
+ - serviceUrl
+ properties:
+ topic:
+ title: Topic Name
+ description: The topic name or regexp
+ type: string
+ tenant:
+ title: Tenant Name
+ description: The Tenant Name
+ type: string
+ topicType:
+ title: Topic Type
+ description: "The topic type. Possible values are: persistent or non-persistent"
+ type: string
+ namespaceName:
+ title: Pulsar Namespace Name
+ description: The Pulsar Namespace Name
+ type: string
+ serviceUrl:
+ title: Service URL
+ description: The Pulsar Service URL to point while creating the client from URI.
+ type: string
+ authenticationClass:
+ title: Authentication Class
+ description: The Authentication FQCN to be used while creating the client from URI.
+ type: string
+ authenticationParams:
+ title: Authentication Params
+ description: The Authentication Parameters to be used while creating the client from URI.
+ type: string
+ consumerNamePrefix:
+ title: Consumer Name Prefix
+ description: Prefix to add to consumer names when a SHARED or FAILOVER subscription is used
+ type: string
+ default: cons
+ consumerQueueSize:
+ title: Consumer Queue Size
+ description: Size of the consumer queue
+ type: int
+ default: 10
+ deadLetterTopic:
+ title: Dead Letter Topic
+ description: "Name of the topic where the messages which fail maxRedeliverCount times will be sent. Note: if not set, default topic name will be topicName-subscriptionName-DLQ."
+ type: int
+ maxRedeliverCount:
+ title: Maximum Redelivery Count
+ description: "Maximum number of times that a message will be redelivered before being sent to the dead letter queue. If this value is not set, no Dead Letter Policy will be created."
+ type: int
+ negativeAckRedeliveryDelayMicros:
+ title: Negative Ack Redelivery Delay in Microseconds
+ description: "Set the negative acknowledgement delay."
+ type: long
+ default: 60000000
+ messageListener:
+ title: Message Listener
+ description: "Whether to use the messageListener interface, or to receive messages using a separate thread pool."
+ type: boolean
+ default: true
+ x-descriptors:
+ - 'urn:alm:descriptor:com.tectonic.ui:checkbox'
+ numberOfConsumers:
+ title: Number Of Consumers
+ description: "Number of consumers."
+ type: int
+ default: 1
+ numberOfConsumerThreads:
+ title: Number Of Consumer Threads
+ description: "Number of threads to receive and handle messages when using a separate thread pool."
+ type: int
+ default: 1
+ readCompacted:
+ title: Read Compacted
+ description: "Enable compacted topic reading."
+ type: boolean
+ default: false
+ x-descriptors:
+ - 'urn:alm:descriptor:com.tectonic.ui:checkbox'
+ subscriptionInitialPosition:
+ title: Subscription Initial Position
+ description: "Control the initial position in the topic of a newly created subscription. Default is latest message.Possible values: EARLIEST or LATEST"
+ type: string
+ default: LATEST
+ subscriptionName:
+ title: Subscription Name
+ description: "Name of the subscription to use."
+ type: string
+ default: subs
+ subscriptionTopicsMode:
+ title: Subscription Topics Mode
+ description: "Determines to which topics this consumer should be subscribed to - Persistent, Non-Persistent, or both. Only used with pattern subscriptions.Possible values: PersistentOnly, NonPersistentOnly, AllTopics"
+ type: string
+ default: PersistentOnly
+ subscriptionType:
+ title: Subscription Type
+ description: "Type of the subscription. Possible values: EXCLUSIVE, SHARED, FAILOVER, KEY_SHARED"
+ type: string
+ default: EXCLUSIVE
+ topicsPattern:
+ title: Topic Pattern
+ description: "Whether the topic is a pattern (regular expression) that allows the consumer to subscribe to all matching topics in the namespace."
+ type: boolean
+ default: false
+ x-descriptors:
+ - 'urn:alm:descriptor:com.tectonic.ui:checkbox'
+ type: object
+ flow:
+ from:
+ uri: pulsar:{{topicType}}/{{tenant}}/{{namespaceName}}/{{topic}}
+ parameters:
+ serviceUrl: "{{serviceUrl}}"
+ authenticationClass: "{{?authenticationClass}}"
+ authenticationParams: "{{?authenticationParams}}"
+ consumerNamePrefix: "{{?consumerNamePrefix}}"
+ consumerQueueSize: "{{?consumerQueueSize}}"
+ deadLetterTopic: "{{?deadLetterTopic}}"
+ maxRedeliverCount: "{{?maxRedeliverCount}}"
+ negativeAckRedeliveryDelayMicros: "{{?negativeAckRedeliveryDelayMicros}}"
+ messageListener: "{{?messageListener}}"
+ numberOfConsumers: "{{?numberOfConsumers}}"
+ numberOfConsumerThreads: "{{?numberOfConsumerThreads}}"
+ readCompacted: "{{?readCompacted}}"
+ subscriptionInitialPosition: "{{?subscriptionInitialPosition}}"
+ subscriptionName: "{{?subscriptionName}}"
+ subscriptionTopicsMode: "{{?subscriptionTopicsMode}}"
+ subscriptionType: "{{?subscriptionType}}"
+ topicsPattern: "{{?topicsPattern}}"
+ steps:
+ - to: "kamelet:sink"
diff --git a/library/camel-kamelets/src/main/resources/kamelets/pulsar-source.kamelet.yaml b/library/camel-kamelets/src/main/resources/kamelets/pulsar-source.kamelet.yaml
new file mode 100644
index 0000000..c54f58f
--- /dev/null
+++ b/library/camel-kamelets/src/main/resources/kamelets/pulsar-source.kamelet.yaml
@@ -0,0 +1,169 @@
+# ---------------------------------------------------------------------------
+# 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: pulsar-source
+ 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,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjxzdmcKICAgdmlld0JveD0iMCAwIDYwLjk3Mzk5OSA0My4wOSIKICAgdmVyc2lvbj0iMS4xIgogICBpZD0ic3ZnMjQiCiAgIHNvZGlwb2RpOmRvY25hbWU9InB1bHNhci1sb2dvLnN2ZyIKICAgd2lkdGg9IjYwLjk3Mzk5OSIKICAgaGVpZ2h0PSI0My4wOSIKICAgaW5rc2NhcGU6dmVyc2lvbj0iMS4xLjEgKDNiZjVhZTBkMjUsIDIwMjEtMDktMjApIgogICB4bWxuczppbmtzY2FwZT0iaHR0cDovL3d3dy5pbmtzY2FwZS5vcmcvbmFtZXNwYWNlcy9pbmtzY2FwZSIKICAgeG [...]
+ camel.apache.org/provider: "Apache Software Foundation"
+ camel.apache.org/kamelet.group: "Pulsar"
+ labels:
+ camel.apache.org/kamelet.type: "source"
+spec:
+ dependencies:
+ - "camel:pulsar"
+ - "camel:kamelet"
+ - "camel:core"
+ definition:
+ title: "Pulsar Source"
+ description: "Receive data from Pulsar topics."
+ required:
+ - topicType
+ - topic
+ - namespaceName
+ - tenant
+ - serviceUrl
+ properties:
+ topic:
+ title: Topic Name
+ description: The topic name or regexp
+ type: string
+ tenant:
+ title: Tenant Name
+ description: The Tenant Name
+ type: string
+ topicType:
+ title: Topic Type
+ description: "The topic type. Possible values are: persistent or non-persistent"
+ type: string
+ namespaceName:
+ title: Pulsar Namespace Name
+ description: The Pulsar Namespace Name
+ type: string
+ serviceUrl:
+ title: Service URL
+ description: The Pulsar Service URL to point while creating the client from URI.
+ type: string
+ authenticationClass:
+ title: Authentication Class
+ description: The Authentication FQCN to be used while creating the client from URI.
+ type: string
+ authenticationParams:
+ title: Authentication Params
+ description: The Authentication Parameters to be used while creating the client from URI.
+ type: string
+ consumerNamePrefix:
+ title: Consumer Name Prefix
+ description: Prefix to add to consumer names when a SHARED or FAILOVER subscription is used
+ type: string
+ default: cons
+ consumerQueueSize:
+ title: Consumer Queue Size
+ description: Size of the consumer queue
+ type: int
+ default: 10
+ deadLetterTopic:
+ title: Dead Letter Topic
+ description: "Name of the topic where the messages which fail maxRedeliverCount times will be sent. Note: if not set, default topic name will be topicName-subscriptionName-DLQ."
+ type: int
+ maxRedeliverCount:
+ title: Maximum Redelivery Count
+ description: "Maximum number of times that a message will be redelivered before being sent to the dead letter queue. If this value is not set, no Dead Letter Policy will be created."
+ type: int
+ negativeAckRedeliveryDelayMicros:
+ title: Negative Ack Redelivery Delay in Microseconds
+ description: "Set the negative acknowledgement delay."
+ type: long
+ default: 60000000
+ messageListener:
+ title: Message Listener
+ description: "Whether to use the messageListener interface, or to receive messages using a separate thread pool."
+ type: boolean
+ default: true
+ x-descriptors:
+ - 'urn:alm:descriptor:com.tectonic.ui:checkbox'
+ numberOfConsumers:
+ title: Number Of Consumers
+ description: "Number of consumers."
+ type: int
+ default: 1
+ numberOfConsumerThreads:
+ title: Number Of Consumer Threads
+ description: "Number of threads to receive and handle messages when using a separate thread pool."
+ type: int
+ default: 1
+ readCompacted:
+ title: Read Compacted
+ description: "Enable compacted topic reading."
+ type: boolean
+ default: false
+ x-descriptors:
+ - 'urn:alm:descriptor:com.tectonic.ui:checkbox'
+ subscriptionInitialPosition:
+ title: Subscription Initial Position
+ description: "Control the initial position in the topic of a newly created subscription. Default is latest message.Possible values: EARLIEST or LATEST"
+ type: string
+ default: LATEST
+ subscriptionName:
+ title: Subscription Name
+ description: "Name of the subscription to use."
+ type: string
+ default: subs
+ subscriptionTopicsMode:
+ title: Subscription Topics Mode
+ description: "Determines to which topics this consumer should be subscribed to - Persistent, Non-Persistent, or both. Only used with pattern subscriptions.Possible values: PersistentOnly, NonPersistentOnly, AllTopics"
+ type: string
+ default: PersistentOnly
+ subscriptionType:
+ title: Subscription Type
+ description: "Type of the subscription. Possible values: EXCLUSIVE, SHARED, FAILOVER, KEY_SHARED"
+ type: string
+ default: EXCLUSIVE
+ topicsPattern:
+ title: Topic Pattern
+ description: "Whether the topic is a pattern (regular expression) that allows the consumer to subscribe to all matching topics in the namespace."
+ type: boolean
+ default: false
+ x-descriptors:
+ - 'urn:alm:descriptor:com.tectonic.ui:checkbox'
+ type: object
+ flow:
+ from:
+ uri: pulsar:{{topicType}}/{{tenant}}/{{namespaceName}}/{{topic}}
+ parameters:
+ serviceUrl: "{{serviceUrl}}"
+ authenticationClass: "{{?authenticationClass}}"
+ authenticationParams: "{{?authenticationParams}}"
+ consumerNamePrefix: "{{?consumerNamePrefix}}"
+ consumerQueueSize: "{{?consumerQueueSize}}"
+ deadLetterTopic: "{{?deadLetterTopic}}"
+ maxRedeliverCount: "{{?maxRedeliverCount}}"
+ negativeAckRedeliveryDelayMicros: "{{?negativeAckRedeliveryDelayMicros}}"
+ messageListener: "{{?messageListener}}"
+ numberOfConsumers: "{{?numberOfConsumers}}"
+ numberOfConsumerThreads: "{{?numberOfConsumerThreads}}"
+ readCompacted: "{{?readCompacted}}"
+ subscriptionInitialPosition: "{{?subscriptionInitialPosition}}"
+ subscriptionName: "{{?subscriptionName}}"
+ subscriptionTopicsMode: "{{?subscriptionTopicsMode}}"
+ subscriptionType: "{{?subscriptionType}}"
+ topicsPattern: "{{?topicsPattern}}"
+ steps:
+ - to: "kamelet:sink"
diff --git a/templates/bindings/camel-k/pulsar-source-binding.yaml b/templates/bindings/camel-k/pulsar-source-binding.yaml
new file mode 100644
index 0000000..6be279d
--- /dev/null
+++ b/templates/bindings/camel-k/pulsar-source-binding.yaml
@@ -0,0 +1,22 @@
+apiVersion: camel.apache.org/v1alpha1
+kind: KameletBinding
+metadata:
+ name: pulsar-source-binding
+spec:
+ source:
+ ref:
+ kind: Kamelet
+ apiVersion: camel.apache.org/v1alpha1
+ name: pulsar-source
+ properties:
+ namespaceName: "The Pulsar Namespace Name"
+ serviceUrl: "The Service URL"
+ tenant: "The Tenant Name"
+ topic: "The Topic Name"
+ topicType: "The Topic Type"
+ sink:
+ ref:
+ kind: KafkaTopic
+ apiVersion: kafka.strimzi.io/v1beta1
+ name: my-topic
+
\ No newline at end of file
diff --git a/templates/bindings/core/pulsar-source-binding.yaml b/templates/bindings/core/pulsar-source-binding.yaml
new file mode 100644
index 0000000..37ce79d
--- /dev/null
+++ b/templates/bindings/core/pulsar-source-binding.yaml
@@ -0,0 +1,13 @@
+- route:
+ from:
+ uri: "kamelet:pulsar-source"
+ parameters:
+ namespaceName: "The Pulsar Namespace Name"
+ serviceUrl: "The Service URL"
+ tenant: "The Tenant Name"
+ topic: "The Topic Name"
+ topicType: "The Topic Type"
+ steps:
+ - to:
+ uri: "log:info"
+
\ No newline at end of file