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 2022/04/11 04:42:17 UTC

[camel-kamelets] 01/02: [ISSUE-885] activemq sink/source kamelets

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

commit f17c6efe8ece8e8f00c280f51c2ba5c97c01e36a
Author: Anton Giertli <ag...@redhat.com>
AuthorDate: Sat Apr 9 18:14:13 2022 +0200

    [ISSUE-885] activemq sink/source kamelets
---
 kamelets/jms-apache-activemq-sink.kamelet.yaml   | 94 ++++++++++++++++++++++++
 kamelets/jms-apache-activemq-source.kamelet.yaml | 94 ++++++++++++++++++++++++
 2 files changed, 188 insertions(+)

diff --git a/kamelets/jms-apache-activemq-sink.kamelet.yaml b/kamelets/jms-apache-activemq-sink.kamelet.yaml
new file mode 100644
index 00000000..139d71a8
--- /dev/null
+++ b/kamelets/jms-apache-activemq-sink.kamelet.yaml
@@ -0,0 +1,94 @@
+# ---------------------------------------------------------------------------
+# 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: jms-apache-activemq-sink
+  annotations:
+    camel.apache.org/kamelet.icon: "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjwhLS0gQ3JlYXRlZCB3aXRoIElua3NjYXBlIChodHRwOi8vd3d3Lmlua3NjYXBlLm9yZy8pIC0tPgoKPHN2ZwogICB4bWxuczpkYz0iaHR0cDovL3B1cmwub3JnL2RjL2VsZW1lbnRzLzEuMS8iCiAgIHhtbG5zOmNjPSJodHRwOi8vY3JlYXRpdmVjb21tb25zLm9yZy9ucyMiCiAgIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyIKICAgeG1sbnM6c3ZnPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIKICAgeG1sbnM9Im [...]
+    camel.apache.org/kamelet.support.level: "Preview"
+    camel.apache.org/provider: "Apache Software Foundation"
+    camel.apache.org/catalog.version: "main-SNAPSHOT"
+    camel.apache.org/kamelet.group: "JMS"
+  labels:
+    camel.apache.org/kamelet.type: "sink"
+    camel.apache.org/requires.runtime: camel-k
+spec:
+  definition:
+    title: "JMS - Apache ActiveMQ Classic Kamelet Sink"
+    description: "A Kamelet that can produce events to an Apache ActiveMQ Classic message broker using JMS"
+    required:
+      - destinationName
+      - brokerURL
+    type: object
+    properties:
+      destinationType:
+        title: "Destination Type"
+        description: "The JMS destination type (i.e.: queue or topic)"
+        type: string
+        default: queue
+      destinationName:
+        title: "Destination Name"
+        description: "The JMS destination name"
+        type: string
+        example: person
+      brokerURL:
+        title: "Broker URL"
+        description: "The JMS URL"
+        type: string
+        example: "tcp://my-host:61616"
+      password:
+        default: admin
+        description: Target AMQ Broker password
+        example: password1!
+        title: Broker Password
+        type: string
+        format: password
+        x-descriptors:
+          - urn:alm:descriptor:com.tectonic.ui:password
+          - urn:camel:group:credentials        
+      username:
+        default: admin
+        description: Target AMQ Broker Username
+        example: userName
+        title: Broker Username
+        type: string    
+        x-descriptors:
+          - urn:camel:group:credentials             
+  dependencies:
+  - "camel:kamelet"
+  - "camel:activemq"
+  template:
+    beans:
+      - name: sinkConnectionFactoryBean-local
+        type: "#class:org.apache.activemq.ActiveMQConnectionFactory"
+        property:
+          - key: userName
+            value: '{{username}}'
+          - key: password
+            value: '{{password}}'
+          - key: brokerURL
+            value: '{{brokerURL}}'
+      - name: activemq-sink-local
+        type: '#class:org.apache.camel.component.activemq.ActiveMQComponent'      
+    from:
+      uri: "kamelet:source"
+      steps:
+      - to:
+          uri: "{{activemq-sink-local}}:{{destinationType}}:{{destinationName}}"
+          parameters:
+            connectionFactory: "#bean:{{sinkConnectionFactoryBean-local}}"
diff --git a/kamelets/jms-apache-activemq-source.kamelet.yaml b/kamelets/jms-apache-activemq-source.kamelet.yaml
new file mode 100644
index 00000000..70e771d0
--- /dev/null
+++ b/kamelets/jms-apache-activemq-source.kamelet.yaml
@@ -0,0 +1,94 @@
+# ---------------------------------------------------------------------------
+# 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: jms-apache-activemq-source
+  annotations:
+    camel.apache.org/kamelet.icon: "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjwhLS0gQ3JlYXRlZCB3aXRoIElua3NjYXBlIChodHRwOi8vd3d3Lmlua3NjYXBlLm9yZy8pIC0tPgoKPHN2ZwogICB4bWxuczpkYz0iaHR0cDovL3B1cmwub3JnL2RjL2VsZW1lbnRzLzEuMS8iCiAgIHhtbG5zOmNjPSJodHRwOi8vY3JlYXRpdmVjb21tb25zLm9yZy9ucyMiCiAgIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyIKICAgeG1sbnM6c3ZnPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIKICAgeG1sbnM9Im [...]
+    camel.apache.org/kamelet.support.level: "Preview"
+    camel.apache.org/provider: "Apache Software Foundation"
+    camel.apache.org/catalog.version: "main-SNAPSHOT"
+    camel.apache.org/kamelet.group: "JMS"
+  labels:
+    camel.apache.org/kamelet.type: "source"
+    camel.apache.org/requires.runtime: camel-k
+spec:
+  definition:
+    title: "JMS - Apache ActiveMQ Classic Kamelet Source"
+    description: "A Kamelet that can consume events from an Apache ActiveMQ Classic message broker using JMS"
+    required:
+      - destinationName
+      - brokerURL
+    type: object
+    properties:
+      destinationType:
+        title: "Destination Type"
+        description: "The JMS destination type (i.e.: queue or topic)"
+        type: string
+        default: queue
+      destinationName:
+        title: "Destination Name"
+        description: "The JMS destination name"
+        type: string
+      brokerURL:
+        title: "Broker URL"
+        description: "The JMS URL"
+        type: string
+        example: "tcp://k3s-node-master.usersys.redhat.com:31616"
+      password:
+        default: admin
+        description: Target AMQ Broker password
+        example: password1!
+        title: Broker Password
+        type: string
+        format: password
+        x-descriptors:
+          - urn:alm:descriptor:com.tectonic.ui:password
+          - urn:camel:group:credentials        
+      username:
+        default: admin
+        description: Target AMQ Broker userName
+        example: userName
+        title: Broker Username
+        type: string    
+        x-descriptors:
+          - urn:camel:group:credentials    
+
+  dependencies:
+  - "camel:activemq"
+  - "camel:kamelet"
+  template:
+    beans:
+      - name: activemq-source-local
+        type: '#class:org.apache.camel.component.activemq.ActiveMQComponent'    
+      - name: sourceConnectionFactoryBean-local
+        type: "#class:org.apache.activemq.ActiveMQConnectionFactory"
+        property:
+          - key: brokerURL
+            value: '{{brokerURL}}'
+          - key: userName
+            value: '{{username}}'
+          - key: password
+            value: '{{password}}'            
+    from:
+      uri: "{{activemq-source-local}}:{{destinationType}}:{{destinationName}}"
+      parameters:
+        connectionFactory: "#bean:{{sourceConnectionFactoryBean-local}}"
+      steps:
+      - to:
+          uri: "kamelet:sink"